Re: about __BITS_PER_LONG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

In user space, the CONFIG_* symbols are meaningless.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux