public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Guan Xuetao" <gxt@mprc.pku.edu.cn>
To: "'Arnd Bergmann'" <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>
Subject: RE: about __BITS_PER_LONG
Date: Tue, 12 Apr 2011 09:24:02 +0800	[thread overview]
Message-ID: <004901cbf8b0$4eec1b60$ecc45220$@mprc.pku.edu.cn> (raw)
In-Reply-To: <201104111724.57607.arnd@arndb.de>



> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Monday, April 11, 2011 11:25 PM
> To: Guan Xuetao
> Cc: linux-kernel@vger.kernel.org; linux-arch@vger.kernel.org
> Subject: Re: about __BITS_PER_LONG
> 
> On Monday 11 April 2011, Guan Xuetao wrote:
> > --- a/include/asm-generic/bitsperlong.h
> > +++ b/include/asm-generic/bitsperlong.h
> > @@ -9,7 +9,11 @@
> >   * to decide it, but rather check a compiler provided macro.
> >   */
> >  #ifndef __BITS_PER_LONG
> > -#define __BITS_PER_LONG 32
> > +#   ifdef CONFIG_64BIT
> > +#      define __BITS_PER_LONG 64
> > +#   else
> > +#      define __BITS_PER_LONG 32
> > +#   endif /* CONFIG_64BIT */
> >  #endif
> >
> 
> Unfortunately, this does not work, because the __BITS_PER_LONG definition is meant
> for user space. You have to make this depend on a preprocessor macro that
> is provided by the compiler based on the command line switches (e.g. -m64) that
> a use could pass to the compiler.
However,  there is no conflict between the definition depending on a preprocessor macro and 
the definition of asm-generic header.

> 
> In user space, the CONFIG_* symbols are meaningless.
Yes, that's the problem. I have not notice it before.
So, only one value can be reserved in such circumstances.

> 
> 	Arnd

Thanks & Regards.

Guan Xuetao


      reply	other threads:[~2011-04-12  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11  7:34 about __BITS_PER_LONG Guan Xuetao
2011-04-11 15:24 ` Arnd Bergmann
2011-04-12  1:24   ` Guan Xuetao [this message]

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='004901cbf8b0$4eec1b60$ecc45220$@mprc.pku.edu.cn' \
    --to=gxt@mprc.pku.edu.cn \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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