Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Sep 2001 00:17:44 -0600
From:      Warner Losh <imp@harmony.village.org>
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        Marcel Moolenaar <marcel@xcllnt.net>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: hw.machine vs hw.machine_arch (was: Re: cvs commit: src/sbin/reboot Makefile) 
Message-ID:  <200109130617.f8D6Hit95540@harmony.village.org>
In-Reply-To: Your message of "Thu, 13 Sep 2001 09:10:43 %2B0300." <20010913091043.C10963@sunbay.com> 
References:  <20010913091043.C10963@sunbay.com>  <200109122216.f8CMGLt43250@harmony.village.org> <20010912134640.A639@dhcp01.pn.xcllnt.net> <200109121221.f8CCL9q93334@freefall.freebsd.org> <200109122216.f8CMGLt43250@harmony.village.org> <200109122218.f8CMIst43283@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010913091043.C10963@sunbay.com> Ruslan Ermilov writes:
: On Wed, Sep 12, 2001 at 04:18:54PM -0600, Warner Losh wrote:
: > In message <200109122216.f8CMGLt43250@harmony.village.org> Warner Losh writes:
: > : : >   Use ${MACHINE}, it works with cross-builds.
: > : : 
: > : : More specifically, ${MACHINE} can be pc98 while ${MACHINE_ARCH}
: > : : is i386. In userland you want to test for i386; not pc98.
: > : 
: > : uname -m is the ${MACHINE_ARCH}, so that should be used instead.
: > : Marcel is right.
: > 
: > I just confirmed on my pc98 machine.  arch -m is "i386" on pc98.
: > 
: Hmm, I always thought that hw.machine_arch should be what the
: ${MACHINE_ARCH} is set to during `buildworld', and hw.machine
: should be what the ${MACHINE} is.  And we know that the only
: exotic combination currently is i386/pc98.  Well, well...
: 
: `uname -m' fetches the value of:
: 
: 	if (flags & MFLAG) {
: 		mib[0] = CTL_HW;
: 		mib[1] = HW_MACHINE;
: 	...
: 
: Not the HW_MACHINE_ARCH.

uname -m says "i386" on my pc98 machine, reguardless of what the
source might lead one to believe.

: But then in sys/i386/i386/identcpu.c (which is also in files.pc98)
: we have:
: 
: char machine[] = "i386";
: SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
:     machine, 0, "Machine class");
: 
: I wonder, should that be "pc98" for PC98's.  Anyone cares to explain
: why it is "i386" on PC98, and why then we have both hw.machine and
: hw.machine_arch?

hw.machine has traditionally been ${MACHINE_ARCH} on FreeBSD/i386,
FreeBSD/alpha and FreeBSD/pc98.  I don't know what hw.machine_arch is
for, and don't recall seeing it before now. :-)

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109130617.f8D6Hit95540>