Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2001 09:02:56 +0100
From:      Joerg Wunsch <j@uriah.heep.sax.de>
To:        Warner Losh <imp@harmony.village.org>
Cc:        John Baldwin <jhb@FreeBSD.org>, 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>
In-Reply-To: <200112182253.fBIMrdM92149@harmony.village.org>; from imp@harmony.village.org on Tue, Dec 18, 2001 at 03:53:39PM -0700
References:  <XFMail.011218143607.jhb@FreeBSD.org> <200112182253.fBIMrdM92149@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <machine/param.h> 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




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