linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: tom_gall@vnet.ibm.com
To: linuxppc-commit@fsmlabs.com, linuxppc-dev@lists.linuxppc.org
Subject: compiler or kernel source defines
Date: Thu, 12 Apr 2001 18:38:10 +0000	[thread overview]
Message-ID: <3AD5F612.E3E282E8@vnet.ibm.com> (raw)


Hi All,

  Mike Corrigan one of the PPC 64 developers dropped by today with an
interesting set of questions that I think we need to give some thought to.

  Currently today there are places in the code (for /proc for example) where
there are some tests for the __powerpc__ define.

  This is a define that of course gcc defines and passes in for free.

  However the test for this particular code is really "are we powerpc32 or are
we powerpc64?", not are we on the powerpc architecture.

  One *COULD* again rely on gcc defines that you get for free to determine this
test at compile time, __PPC64__ as a recall, however is this the right thing to
do?

  Is there are larger design approach question, where we should NOT depend on
the defines that come for free from gcc but instead rely on say a CONFIG that
comes from the config.in that we can test again ... so CONFIG_PPC64/CONFIG_PPC32
or some such.

  Personally I feel safe using the gcc defines we get for free, and just
patching the set of device drivers or other offending code that is using
__powerppc__ when it really should be testing conceptually using:

#ifdef defined(__powerpc__) and !defined(__PPC64__)

32 bit PPC kernel code

#elif defined(__powerpc__) and defined(__PPC64__)

64 bit PPC kernel code

#endif

  Seems like the only risk here is that one always assumes to be using gcc and
that's perfectly valid to me.

  Opinions? Feedback?

--
Tom Gall - PowerPC Linux Team    "Where's the ka-boom? There was
Linux Technology Center           supposed to be an earth
(w) tom_gall@vnet.ibm.com         shattering ka-boom!"
(w) 507-253-4558                 -- Marvin Martian
(h) tgall@rochcivictheatre.org
http://oss.software.ibm.com/developerworks/opensource/linux

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

             reply	other threads:[~2001-04-12 18:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-12 18:38 tom_gall [this message]
2001-04-12 21:58 ` compiler or kernel source defines Cort Dougan
2001-04-12 23:23 ` Anton Blanchard

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=3AD5F612.E3E282E8@vnet.ibm.com \
    --to=tom_gall@vnet.ibm.com \
    --cc=linuxppc-commit@fsmlabs.com \
    --cc=linuxppc-dev@lists.linuxppc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).