All of lore.kernel.org
 help / color / mirror / Atom feed
* When to #ifdef on CPUs?
@ 2002-09-13  1:58 Matthew Dharm
  2002-09-13  7:22 ` Maciej W. Rozycki
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Matthew Dharm @ 2002-09-13  1:58 UTC (permalink / raw)
  To: Linux-MIPS

I'm basically done with my task of porting linux to our SR71000-based
board.  I'm getting ready to start feeding patches to Ralf, and
something occured to me....

Sometimes, in some places, we use CONFIG_ options to select the
apropriate CPU.  Other places, we probe for the CPU based on the PRID
register.

In some places, the reason for the choice is clear -- it's just much
easier to select the cache library based on a CONFIG_ option in a
Makefile than trying to do run-time assignment of many function
pointers.

However, is some places, the choice is not clear.  In cpu-probe.c, for
example, several of the CPU identification routines are wrapped in
#ifdef's -- odd, since the wrong 'case' of the switch statements
should never get executed, even if compiled in....

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...

Matt

--
Matthew D. Dharm                            Senior Software Designer
Momentum Computer Inc.                      1815 Aston Ave.  Suite 107
(760) 431-8663 X-115                        Carlsbad, CA 92008-7310
Momentum Works For You                      www.momenco.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-13 10:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-13  1:58 When to #ifdef on CPUs? Matthew Dharm
2002-09-13  7:22 ` Maciej W. Rozycki
2002-09-13  9:08 ` Kevin D. Kissell
2002-09-13 10:34   ` Maciej W. Rozycki
2002-09-13 10:51 ` Kevin D. Kissell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.