linux-mips
[Top] [All Lists]

Re: When to #ifdef on CPUs?

To: Matthew Dharm <mdharm@momenco.com>
Subject: Re: When to #ifdef on CPUs?
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Fri, 13 Sep 2002 09:22:06 +0200 (MET DST)
Cc: Linux-MIPS <linux-mips@linux-mips.org>
In-reply-to: <NEBBLJGMNKKEEMNLHGAIMEPBCIAA.mdharm@momenco.com>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 12 Sep 2002, Matthew Dharm wrote:

> So, what's the rule here?  When do I used #ifdef and when do I just
> let the PRID stuff work it's magic?
> 
> I mean, heck... it might be nice to put a check to see if the detected
> CPU matches what the kernel was compiled for...

 Well, we might be able to build generic kernels one day.  So you need to
judge whether some bits of code are needed/useful if run on your processor
in a generic configuration (use PRId then) or are specific to a
configuration dedicated to your processor (use a config option then).

 There are places in the existing code that violate the rule but the
reasons are mostly historical and they will hopefully get cleaned up
sooner or later (I have a few of them on my to-do list, too).  Thus please
don't be much too influenced by old code.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>