From owner-cvs-all Wed Sep 12 23:17:55 2001 Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id BDE1B37B401; Wed, 12 Sep 2001 23:17:46 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f8D6Hi616106; Thu, 13 Sep 2001 00:17:44 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.3/8.11.4) with ESMTP id f8D6Hit95540; Thu, 13 Sep 2001 00:17:44 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200109130617.f8D6Hit95540@harmony.village.org> To: Ruslan Ermilov Subject: Re: hw.machine vs hw.machine_arch (was: Re: cvs commit: src/sbin/reboot Makefile) Cc: Marcel Moolenaar , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-reply-to: Your message of "Thu, 13 Sep 2001 09:10:43 +0300." <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> Date: Thu, 13 Sep 2001 00:17:44 -0600 From: Warner Losh Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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