From owner-cvs-all Tue Dec 18 23:51:42 2001 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 5845837B419; Tue, 18 Dec 2001 23:51:26 -0800 (PST) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id fBJ7pJV97239; Wed, 19 Dec 2001 09:51:19 +0200 (EET) (envelope-from ru) Date: Wed, 19 Dec 2001 09:51:19 +0200 From: Ruslan Ermilov To: Joerg Wunsch Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/isa fd.c Message-ID: <20011219095119.B93645@sunbay.com> References: <200112182216.fBIMGX179954@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200112182216.fBIMGX179954@freefall.freebsd.org> User-Agent: Mutt/1.3.23i 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 On Tue, Dec 18, 2001 at 02:16:33PM -0800, Joerg Wunsch wrote: > joerg 2001/12/18 14:16:33 PST > > Modified files: > sys/isa fd.c > Log: > Change the test for _MACHINE_ARCH == i386 into #ifdef __i386__ since it > otherwise breaks on the Alpha arch. I think this is wrong since i'd > actually like to probe for a PC architecture, not for a particular CPU > type. Anyway, now it's again the way it used to be. > > Revision Changes Path > 1.224 +8 -2 src/sys/isa/fd.c > This is because _MACHINE_ARCH is a bogus define. On i386's, ``cpp -dM /dev/null'' shows the following: [...] #define i386 1 [...] So, the ``#define _MACHINE_ARCH i386'' from actually defines _MACHINE_ARCH as 1. Then, the #if _MACHINE_ARCH == i386 becomes #if 1 == 1. On alphas, ``cpp -dM /dev/null'' doesn't define "alpha" as 1, so _MACHINE_ARCH is ``alpha'' (not a string constant!), and i386 is not defined either, so #if _MACHINE == i386 becomes #if alpha == i386 becomes #if 0 == 0 What you should be actually testing is MACHINE_ARCH, but it's still not suitable in this case, because MACHINE_ARCH is "i386" on PC98. Moreover, MACHINE is also "i386" on PC98. (Don't obfuscate this with make(1)'s MACHINE variable, which is set to "pc98" by config(8).) Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message