From: "Matthew Dharm" <mdharm@momenco.com>
To: "Linux-MIPS" <linux-mips@linux-mips.org>
Subject: When to #ifdef on CPUs?
Date: Thu, 12 Sep 2002 18:58:57 -0700 [thread overview]
Message-ID: <NEBBLJGMNKKEEMNLHGAIMEPBCIAA.mdharm@momenco.com> (raw)
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
next reply other threads:[~2002-09-13 1:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-13 1:58 Matthew Dharm [this message]
2002-09-13 7:22 ` When to #ifdef on CPUs? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=NEBBLJGMNKKEEMNLHGAIMEPBCIAA.mdharm@momenco.com \
--to=mdharm@momenco.com \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.