[PATCH] powerpc: Don't use CONFIG_PPC64 in user-visible header files

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Dec 13 09:50:01 EST 2005


On Mon, 2005-12-12 at 23:28 +0100, Arnd Bergmann wrote:
> I have checked the usage of CONFIG_PPC64 vs. __powerpc64__ and found that
> at least io.h and vdso_datapage.h get it wrong by using CONFIG_PPC64 outside
> of #ifdef __KERNEL__. This will cause any user space application that 
> (probably without a good reason) includes these files gets the ppc32 version 
> even if compiling for 64 bits.

They should not to that.

> I originally argued that we should only use __powerpc64__ in header files for 
> just this reason. 

Userspace has no business including vdso_data.h at least and I fail to
see what business it would have including io.h 

> The other files that do use CONFIG_PPC64 outside of 
> __KERNEL__ are dma-mapping.h, mmu_context.h, mmu.h, pci-bridge.h,
> pgalloc.h, pgtable.h, pmc.h, ppc_asm.h and spinlock.h. However, including
> one of these files in user space is already impossible, so the only thing
> that might help there would be to wrap them completely in #ifdef __KERNEL__.
> 
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> 
> ---
> 
> Am Montag 12 Dezember 2005 22:33 schrieb Olof Johansson:
> > >  
> > >
> > > > I know they were just moved, but should we use CONFIG_PPC64 instead to
> > > > keep it similar with the other CONFIG_* tests?
> > >
> > > I originally thought that then I noticed __powerpc64__ is pretty
> > > widespread, in fact it outnumbers the number of CONFIG_PPC64 uses in
> > > include/asm-powerpc :) Either way Im OK.
> >
> > Interesting. Ok, nevermind then. :)
> 
> diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
> index 48938d8..c8d075a 100644
> --- a/include/asm-powerpc/io.h
> +++ b/include/asm-powerpc/io.h
> @@ -8,7 +8,7 @@
>   * 2 of the License, or (at your option) any later version.
>   */
>  
> -#ifndef CONFIG_PPC64
> +#ifndef __powerpc64__
>  #include <asm-ppc/io.h>
>  #else
>  
> diff --git a/include/asm-powerpc/vdso_datapage.h 
> b/include/asm-powerpc/vdso_datapage.h
> index 411832d..f8fece7 100644
> --- a/include/asm-powerpc/vdso_datapage.h
> +++ b/include/asm-powerpc/vdso_datapage.h
> @@ -45,7 +45,7 @@
>   * So here is the ppc64 backward compatible version
>   */
>  
> -#ifdef CONFIG_PPC64
> +#ifdef __powerpc64__
>  
>  struct vdso_data {
>  	__u8  eye_catcher[16];		/* Eyecatcher: SYSTEMCFG:PPC64	0x00 */
> _______________________________________________
> Linuxppc64-dev mailing list
> Linuxppc64-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc64-dev




More information about the Linuxppc64-dev mailing list