From owner-cvs-all Wed Dec 19 0:20:29 2001 Delivered-To: cvs-all@freebsd.org Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (Postfix) with ESMTP id 6945E37B405; Wed, 19 Dec 2001 00:20:19 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id JAA05962; Wed, 19 Dec 2001 09:20:10 +0100 (CET) Received: (from j@localhost) by uriah.heep.sax.de (8.11.6/8.11.6) id fBJ82u510811; Wed, 19 Dec 2001 09:02:56 +0100 (MET) (envelope-from j) Date: Wed, 19 Dec 2001 09:02:56 +0100 From: Joerg Wunsch To: Warner Losh Cc: John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/isa fd.c Message-ID: <20011219090256.E97821@uriah.heep.sax.de> Reply-To: Joerg Wunsch Mail-Followup-To: Joerg Wunsch , Warner Losh , John Baldwin , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org References: <200112182253.fBIMrdM92149@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200112182253.fBIMrdM92149@harmony.village.org>; from imp@harmony.village.org on Tue, Dec 18, 2001 at 03:53:39PM -0700 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E 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 As Warner Losh wrote: > __i386__ is defined on both FreeBSD/i386 and FreeBSD/pc98. There's no > unique symbole for FreeBSD/i386, so that should be > > #if defined(__i386__) && !defined(PC98) But that wouldn't exclude any further (hypothetical) architecture using an IA32-class CPU. I still think we should make our _MACHINE and MACHINE macros that are defined in work well enough for cpp conditionals. Thinking a bit more of it, it's probably that all of those files define _MACHINE to something like i386, alpha, ia64 etc., but there aren't actually any definitions for the right hand side, so they eventually all end up being 0 when you use them in a conditional. But then, what are they good for if i can't use them for a comparision? And no, using MACHINE (without the underscore) can't be used either since it evaluates to a string literal, which cannot be compared in cpp. > if you want it only on PC-AT machines. However, for this file, it > is moot since it isn't used on pc98 (pc98 has its own driver for fd, > iirc). My hope is we could once unite those drivers again. Still, i think we should have some cpp mechanism that can be probed to distinguish just a single machine class instead of a CPU class. For the time being, using __i386__ certainly does the trick here, but it'll only defer the decision until next time it might be needed... IMHO, we should really define all the right hand side's constants that are used in _MACHINE and _MACHINE_ARCH to yield a distinguishable integer number. This would solve the entire problem. Right now, those macros are just moot and cannot be used for any purpose. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message