Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88ced031 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Paul Mackerras
Browse files

[PATCH] powerpc: sanitize header files for user space includes



include/asm-ppc/ had #ifdef __KERNEL__ in all header files that
are not meant for use by user space, include/asm-powerpc does
not have this yet.

This patch gets us a lot closer there. There are a few cases
where I was not sure, so I left them out. I have verified
that no CONFIG_* symbols are used outside of __KERNEL__
any more and that there are no obvious compile errors when
including any of the headers in user space libraries.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e1333803
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
#ifndef _ASM_POWERPC_ABS_ADDR_H
#define _ASM_POWERPC_ABS_ADDR_H
#ifdef __KERNEL__

#include <linux/config.h>

@@ -70,4 +71,5 @@ static inline unsigned long phys_to_abs(unsigned long pa)
#define iseries_hv_addr(virtaddr)	\
	(0x8000000000000000 | virt_to_abs(virtaddr))

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ABS_ADDR_H */
+2 −0
Original line number Diff line number Diff line
#ifndef _ASM_POWERPC_AGP_H
#define _ASM_POWERPC_AGP_H
#ifdef __KERNEL__

#include <asm/io.h>

@@ -18,4 +19,5 @@
#define free_gatt_pages(table, order)	\
	free_pages((unsigned long)(table), (order))

#endif /* __KERNEL__ */
#endif	/* _ASM_POWERPC_AGP_H */
+2 −1
Original line number Diff line number Diff line
#ifndef _ASM_POWERPC_ASM_COMPAT_H
#define _ASM_POWERPC_ASM_COMPAT_H

#include <linux/config.h>
#include <asm/types.h>

#ifdef __ASSEMBLY__
@@ -41,6 +40,7 @@

#endif

#ifdef __KERNEL__
#ifdef CONFIG_IBM405_ERR77
/* Erratum #77 on the 405 means we need a sync or dcbt before every
 * stwcx.  The old ATOMIC_SYNC_FIX covered some but not all of this.
@@ -51,5 +51,6 @@
#define PPC405_ERR77(ra,rb)
#define PPC405_ERR77_SYNC
#endif
#endif

#endif /* _ASM_POWERPC_ASM_COMPAT_H */
+5 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@
#ifndef __ASM_BOOTX_H__
#define __ASM_BOOTX_H__

#include <asm/types.h>

#ifdef macintosh
#include <Types.h>
#include "linux_type_defs.h"
@@ -122,6 +124,7 @@ typedef struct boot_infos

} boot_infos_t;

#ifdef __KERNEL__
/* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index
 * is represented by 3 short words containing a 16 bits (unsigned) color
 * component. Later versions may contain the gamma table for direct-color
@@ -159,6 +162,8 @@ struct bootx_dt_node {

extern void bootx_init(unsigned long r4, unsigned long phys);

#endif /* __KERNEL__ */

#ifdef macintosh
#pragma options align=reset
#endif
+2 −0
Original line number Diff line number Diff line
#ifndef _ASM_POWERPC_BUG_H
#define _ASM_POWERPC_BUG_H
#ifdef __KERNEL__

#include <asm/asm-compat.h>
/*
@@ -67,4 +68,5 @@ struct bug_entry *find_bug(unsigned long bugaddr);

#include <asm-generic/bug.h>

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_BUG_H */
Loading