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

[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
#ifndef _ASM_POWERPC_ABS_ADDR_H #ifndef _ASM_POWERPC_ABS_ADDR_H
#define _ASM_POWERPC_ABS_ADDR_H #define _ASM_POWERPC_ABS_ADDR_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
...@@ -70,4 +71,5 @@ static inline unsigned long phys_to_abs(unsigned long pa) ...@@ -70,4 +71,5 @@ static inline unsigned long phys_to_abs(unsigned long pa)
#define iseries_hv_addr(virtaddr) \ #define iseries_hv_addr(virtaddr) \
(0x8000000000000000 | virt_to_abs(virtaddr)) (0x8000000000000000 | virt_to_abs(virtaddr))
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_ABS_ADDR_H */ #endif /* _ASM_POWERPC_ABS_ADDR_H */
#ifndef _ASM_POWERPC_AGP_H #ifndef _ASM_POWERPC_AGP_H
#define _ASM_POWERPC_AGP_H #define _ASM_POWERPC_AGP_H
#ifdef __KERNEL__
#include <asm/io.h> #include <asm/io.h>
...@@ -18,4 +19,5 @@ ...@@ -18,4 +19,5 @@
#define free_gatt_pages(table, order) \ #define free_gatt_pages(table, order) \
free_pages((unsigned long)(table), (order)) free_pages((unsigned long)(table), (order))
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_AGP_H */ #endif /* _ASM_POWERPC_AGP_H */
#ifndef _ASM_POWERPC_ASM_COMPAT_H #ifndef _ASM_POWERPC_ASM_COMPAT_H
#define _ASM_POWERPC_ASM_COMPAT_H #define _ASM_POWERPC_ASM_COMPAT_H
#include <linux/config.h>
#include <asm/types.h> #include <asm/types.h>
#ifdef __ASSEMBLY__ #ifdef __ASSEMBLY__
...@@ -41,6 +40,7 @@ ...@@ -41,6 +40,7 @@
#endif #endif
#ifdef __KERNEL__
#ifdef CONFIG_IBM405_ERR77 #ifdef CONFIG_IBM405_ERR77
/* Erratum #77 on the 405 means we need a sync or dcbt before every /* 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. * stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
...@@ -51,5 +51,6 @@ ...@@ -51,5 +51,6 @@
#define PPC405_ERR77(ra,rb) #define PPC405_ERR77(ra,rb)
#define PPC405_ERR77_SYNC #define PPC405_ERR77_SYNC
#endif #endif
#endif
#endif /* _ASM_POWERPC_ASM_COMPAT_H */ #endif /* _ASM_POWERPC_ASM_COMPAT_H */
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifndef __ASM_BOOTX_H__ #ifndef __ASM_BOOTX_H__
#define __ASM_BOOTX_H__ #define __ASM_BOOTX_H__
#include <asm/types.h>
#ifdef macintosh #ifdef macintosh
#include <Types.h> #include <Types.h>
#include "linux_type_defs.h" #include "linux_type_defs.h"
...@@ -122,6 +124,7 @@ typedef struct boot_infos ...@@ -122,6 +124,7 @@ typedef struct boot_infos
} boot_infos_t; } boot_infos_t;
#ifdef __KERNEL__
/* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index /* (*) 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 * is represented by 3 short words containing a 16 bits (unsigned) color
* component. Later versions may contain the gamma table for direct-color * component. Later versions may contain the gamma table for direct-color
...@@ -159,6 +162,8 @@ struct bootx_dt_node { ...@@ -159,6 +162,8 @@ struct bootx_dt_node {
extern void bootx_init(unsigned long r4, unsigned long phys); extern void bootx_init(unsigned long r4, unsigned long phys);
#endif /* __KERNEL__ */
#ifdef macintosh #ifdef macintosh
#pragma options align=reset #pragma options align=reset
#endif #endif
......
#ifndef _ASM_POWERPC_BUG_H #ifndef _ASM_POWERPC_BUG_H
#define _ASM_POWERPC_BUG_H #define _ASM_POWERPC_BUG_H
#ifdef __KERNEL__
#include <asm/asm-compat.h> #include <asm/asm-compat.h>
/* /*
...@@ -67,4 +68,5 @@ struct bug_entry *find_bug(unsigned long bugaddr); ...@@ -67,4 +68,5 @@ struct bug_entry *find_bug(unsigned long bugaddr);
#include <asm-generic/bug.h> #include <asm-generic/bug.h>
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_BUG_H */ #endif /* _ASM_POWERPC_BUG_H */
#ifndef _ASM_POWERPC_CHECKSUM_H #ifndef _ASM_POWERPC_CHECKSUM_H
#define _ASM_POWERPC_CHECKSUM_H #define _ASM_POWERPC_CHECKSUM_H
#ifdef __KERNEL__
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -129,4 +130,5 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, ...@@ -129,4 +130,5 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
} }
#endif #endif
#endif /* __KERNEL__ */
#endif #endif
#ifndef _ASM_POWERPC_COMPAT_H #ifndef _ASM_POWERPC_COMPAT_H
#define _ASM_POWERPC_COMPAT_H #define _ASM_POWERPC_COMPAT_H
#ifdef __KERNEL__
/* /*
* Architecture specific compatibility types * Architecture specific compatibility types
*/ */
...@@ -202,4 +203,5 @@ struct compat_shmid64_ds { ...@@ -202,4 +203,5 @@ struct compat_shmid64_ds {
compat_ulong_t __unused6; compat_ulong_t __unused6;
}; };
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_COMPAT_H */ #endif /* _ASM_POWERPC_COMPAT_H */
#ifndef __ASM_POWERPC_CPUTABLE_H #ifndef __ASM_POWERPC_CPUTABLE_H
#define __ASM_POWERPC_CPUTABLE_H #define __ASM_POWERPC_CPUTABLE_H
#include <linux/config.h>
#include <asm/asm-compat.h> #include <asm/asm-compat.h>
#define PPC_FEATURE_32 0x80000000 #define PPC_FEATURE_32 0x80000000
......
#ifndef _ASM_POWERPC_CURRENT_H #ifndef _ASM_POWERPC_CURRENT_H
#define _ASM_POWERPC_CURRENT_H #define _ASM_POWERPC_CURRENT_H
#ifdef __KERNEL__
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -24,4 +25,5 @@ register struct task_struct *current asm ("r2"); ...@@ -24,4 +25,5 @@ register struct task_struct *current asm ("r2");
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_CURRENT_H */ #endif /* _ASM_POWERPC_CURRENT_H */
#ifndef _ASM_POWERPC_DELAY_H #ifndef _ASM_POWERPC_DELAY_H
#define _ASM_POWERPC_DELAY_H #define _ASM_POWERPC_DELAY_H
#ifdef __KERNEL__
/* /*
* Copyright 1996, Paul Mackerras. * Copyright 1996, Paul Mackerras.
...@@ -16,4 +17,5 @@ ...@@ -16,4 +17,5 @@
extern void __delay(unsigned long loops); extern void __delay(unsigned long loops);
extern void udelay(unsigned long usecs); extern void udelay(unsigned long usecs);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_DELAY_H */ #endif /* _ASM_POWERPC_DELAY_H */
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#ifndef _ASM_DMA_MAPPING_H #ifndef _ASM_DMA_MAPPING_H
#define _ASM_DMA_MAPPING_H #define _ASM_DMA_MAPPING_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -282,4 +283,5 @@ struct dma_mapping_ops { ...@@ -282,4 +283,5 @@ struct dma_mapping_ops {
int (*dac_dma_supported)(struct device *dev, u64 mask); int (*dac_dma_supported)(struct device *dev, u64 mask);
}; };
#endif /* __KERNEL__ */
#endif /* _ASM_DMA_MAPPING_H */ #endif /* _ASM_DMA_MAPPING_H */
#ifndef _ASM_POWERPC_DMA_H #ifndef _ASM_POWERPC_DMA_H
#define _ASM_POWERPC_DMA_H #define _ASM_POWERPC_DMA_H
#ifdef __KERNEL__
/* /*
* Defines for using and allocating dma channels. * Defines for using and allocating dma channels.
...@@ -387,4 +388,5 @@ extern int isa_dma_bridge_buggy; ...@@ -387,4 +388,5 @@ extern int isa_dma_bridge_buggy;
#endif /* !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) */ #endif /* !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_DMA_H */ #endif /* _ASM_POWERPC_DMA_H */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#ifndef _PPC64_EEH_H #ifndef _PPC64_EEH_H
#define _PPC64_EEH_H #define _PPC64_EEH_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -373,4 +374,5 @@ static inline void eeh_insl_ns(unsigned long port, void * buf, int nl) ...@@ -373,4 +374,5 @@ static inline void eeh_insl_ns(unsigned long port, void * buf, int nl)
eeh_check_failure((void __iomem *)(port), *(u32*)buf); eeh_check_failure((void __iomem *)(port), *(u32*)buf);
} }
#endif /* __KERNEL__ */
#endif /* _PPC64_EEH_H */ #endif /* _PPC64_EEH_H */
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef ASM_PPC64_EEH_EVENT_H #ifndef ASM_PPC64_EEH_EVENT_H
#define ASM_PPC64_EEH_EVENT_H #define ASM_PPC64_EEH_EVENT_H
#ifdef __KERNEL__
/** EEH event -- structure holding pci controller data that describes /** EEH event -- structure holding pci controller data that describes
* a change in the isolation status of a PCI slot. A pointer * a change in the isolation status of a PCI slot. A pointer
...@@ -49,4 +50,5 @@ int eeh_send_failure_event (struct device_node *dn, ...@@ -49,4 +50,5 @@ int eeh_send_failure_event (struct device_node *dn,
int reset_state, int reset_state,
int time_unavail); int time_unavail);
#endif /* __KERNEL__ */
#endif /* ASM_PPC64_EEH_EVENT_H */ #endif /* ASM_PPC64_EEH_EVENT_H */
#ifndef _ASM_POWERPC_ELF_H #ifndef _ASM_POWERPC_ELF_H
#define _ASM_POWERPC_ELF_H #define _ASM_POWERPC_ELF_H
#ifdef __KERNEL__
#include <linux/sched.h> /* for task_struct */ #include <linux/sched.h> /* for task_struct */
#endif
#include <asm/types.h> #include <asm/types.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/cputable.h> #include <asm/cputable.h>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#ifndef __ASM_POWERPC_FLOPPY_H #ifndef __ASM_POWERPC_FLOPPY_H
#define __ASM_POWERPC_FLOPPY_H #define __ASM_POWERPC_FLOPPY_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <asm/machdep.h> #include <asm/machdep.h>
...@@ -102,4 +103,5 @@ static int FDC2 = -1; ...@@ -102,4 +103,5 @@ static int FDC2 = -1;
#define EXTRA_FLOPPY_PARAMS #define EXTRA_FLOPPY_PARAMS
#endif /* __KERNEL__ */
#endif /* __ASM_POWERPC_FLOPPY_H */ #endif /* __ASM_POWERPC_FLOPPY_H */
#ifndef _ASM_POWERPC_GRACKLE_H
#define _ASM_POWERPC_GRACKLE_H
#ifdef __KERNEL__
/* /*
* Functions for setting up and using a MPC106 northbridge * Functions for setting up and using a MPC106 northbridge
*/ */
...@@ -5,3 +8,5 @@ ...@@ -5,3 +8,5 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
extern void setup_grackle(struct pci_controller *hose); extern void setup_grackle(struct pci_controller *hose);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_GRACKLE_H */
#ifndef _ASM_POWERPC_HARDIRQ_H #ifndef _ASM_POWERPC_HARDIRQ_H
#define _ASM_POWERPC_HARDIRQ_H #define _ASM_POWERPC_HARDIRQ_H
#ifdef __KERNEL__
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/bug.h> #include <asm/bug.h>
...@@ -24,4 +25,5 @@ static inline void ack_bad_irq(int irq) ...@@ -24,4 +25,5 @@ static inline void ack_bad_irq(int irq)
BUG(); BUG();
} }
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HARDIRQ_H */ #endif /* _ASM_POWERPC_HARDIRQ_H */
#ifndef _ASM_POWERPC_HEATHROW_H
#define _ASM_POWERPC_HEATHROW_H
#ifndef __KERNEL__
/* /*
* heathrow.h: definitions for using the "Heathrow" I/O controller chip. * heathrow.h: definitions for using the "Heathrow" I/O controller chip.
* *
...@@ -60,3 +63,5 @@ ...@@ -60,3 +63,5 @@
/* Looks like Heathrow has some sort of GPIOs as well... */ /* Looks like Heathrow has some sort of GPIOs as well... */
#define HRW_GPIO_MODEM_RESET 0x6d #define HRW_GPIO_MODEM_RESET 0x6d
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HEATHROW_H */
#ifndef _ASM_POWERPC_HVCALL_H #ifndef _ASM_POWERPC_HVCALL_H
#define _ASM_POWERPC_HVCALL_H #define _ASM_POWERPC_HVCALL_H
#ifdef __KERNEL__
#define HVSC .long 0x44000022 #define HVSC .long 0x44000022
...@@ -170,4 +171,5 @@ long plpar_hcall_4out(unsigned long opcode, ...@@ -170,4 +171,5 @@ long plpar_hcall_4out(unsigned long opcode,
unsigned long *out4); unsigned long *out4);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */ #endif /* _ASM_POWERPC_HVCALL_H */
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#ifndef _PPC64_HVCONSOLE_H #ifndef _PPC64_HVCONSOLE_H
#define _PPC64_HVCONSOLE_H #define _PPC64_HVCONSOLE_H
#ifdef __KERNEL__
/* /*
* This is the max number of console adapters that can/will be found as * This is the max number of console adapters that can/will be found as
...@@ -46,4 +47,5 @@ extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq, ...@@ -46,4 +47,5 @@ extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq,
struct hv_ops *ops); struct hv_ops *ops);
/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */ /* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */
extern int __devexit hvc_remove(struct hvc_struct *hp); extern int __devexit hvc_remove(struct hvc_struct *hp);
#endif /* __KERNEL__ */
#endif /* _PPC64_HVCONSOLE_H */ #endif /* _PPC64_HVCONSOLE_H */
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#ifndef _PPC64_HVCSERVER_H #ifndef _PPC64_HVCSERVER_H
#define _PPC64_HVCSERVER_H #define _PPC64_HVCSERVER_H
#ifdef __KERNEL__
#include <linux/list.h> #include <linux/list.h>
...@@ -54,4 +55,5 @@ extern int hvcs_register_connection(uint32_t unit_address, ...@@ -54,4 +55,5 @@ extern int hvcs_register_connection(uint32_t unit_address,
uint32_t p_partition_ID, uint32_t p_unit_address); uint32_t p_partition_ID, uint32_t p_unit_address);
extern int hvcs_free_connection(uint32_t unit_address); extern int hvcs_free_connection(uint32_t unit_address);
#endif /* __KERNEL__ */
#endif /* _PPC64_HVCSERVER_H */ #endif /* _PPC64_HVCSERVER_H */
#ifndef _ASM_POWERPC_I8259_H #ifndef _ASM_POWERPC_I8259_H
#define _ASM_POWERPC_I8259_H #define _ASM_POWERPC_I8259_H
#ifdef __KERNEL__
#include <linux/irq.h> #include <linux/irq.h>
...@@ -9,4 +10,5 @@ extern void i8259_init(unsigned long intack_addr, int offset); ...@@ -9,4 +10,5 @@ extern void i8259_init(unsigned long intack_addr, int offset);
extern int i8259_irq(struct pt_regs *regs); extern int i8259_irq(struct pt_regs *regs);
extern int i8259_irq_cascade(struct pt_regs *regs, void *unused); extern int i8259_irq_cascade(struct pt_regs *regs, void *unused);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_I8259_H */ #endif /* _ASM_POWERPC_I8259_H */
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#ifndef _ASM_EBUS_H #ifndef _ASM_EBUS_H
#define _ASM_EBUS_H #define _ASM_EBUS_H
#ifdef __KERNEL__
#include <linux/device.h> #include <linux/device.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -80,4 +81,5 @@ static inline struct ibmebus_dev *to_ibmebus_dev(struct device *dev) ...@@ -80,4 +81,5 @@ static inline struct ibmebus_dev *to_ibmebus_dev(struct device *dev)
} }
#endif /* __KERNEL__ */
#endif /* _ASM_IBMEBUS_H */ #endif /* _ASM_IBMEBUS_H */
#ifndef _ASM_POWERPC_IO_H #ifndef _ASM_POWERPC_IO_H
#define _ASM_POWERPC_IO_H #define _ASM_POWERPC_IO_H
#ifdef __KERNEL__
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -186,7 +187,6 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); ...@@ -186,7 +187,6 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
#define IO_SPACE_LIMIT ~(0UL) #define IO_SPACE_LIMIT ~(0UL)
#ifdef __KERNEL__
extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr, extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr,
unsigned long size, unsigned long flags); unsigned long size, unsigned long flags);
extern void __iomem *__ioremap(unsigned long address, unsigned long size, extern void __iomem *__ioremap(unsigned long address, unsigned long size,
...@@ -256,8 +256,6 @@ static inline void * phys_to_virt(unsigned long address) ...@@ -256,8 +256,6 @@ static inline void * phys_to_virt(unsigned long address)
*/ */
#define BIO_VMERGE_BOUNDARY 0 #define BIO_VMERGE_BOUNDARY 0
#endif /* __KERNEL__ */
static inline void iosync(void) static inline void iosync(void)
{ {
__asm__ __volatile__ ("sync" : : : "memory"); __asm__ __volatile__ ("sync" : : : "memory");
...@@ -405,8 +403,6 @@ static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long ...@@ -405,8 +403,6 @@ static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long
#include <asm/eeh.h> #include <asm/eeh.h>
#endif #endif
#ifdef __KERNEL__
/** /**
* check_signature - find BIOS signatures * check_signature - find BIOS signatures
* @io_addr: mmio address to check * @io_addr: mmio address to check
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef _ASM_IOMMU_H #ifndef _ASM_IOMMU_H
#define _ASM_IOMMU_H #define _ASM_IOMMU_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <asm/types.h> #include <asm/types.h>
...@@ -115,4 +116,5 @@ static inline void pci_iommu_init(void) { } ...@@ -115,4 +116,5 @@ static inline void pci_iommu_init(void) { }
extern void alloc_dart_table(void); extern void alloc_dart_table(void);
#endif /* __KERNEL__ */
#endif /* _ASM_IOMMU_H */ #endif /* _ASM_IOMMU_H */
#ifndef _ASM_POWERPC_KDEBUG_H #ifndef _ASM_POWERPC_KDEBUG_H
#define _ASM_POWERPC_KDEBUG_H #define _ASM_POWERPC_KDEBUG_H
#ifdef __KERNEL__
/* nearly identical to x86_64/i386 code */ /* nearly identical to x86_64/i386 code */
...@@ -39,4 +40,5 @@ static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,lon ...@@ -39,4 +40,5 @@ static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,lon
return notifier_call_chain(&powerpc_die_chain, val, &args); return notifier_call_chain(&powerpc_die_chain, val, &args);
} }
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_KDEBUG_H */ #endif /* _ASM_POWERPC_KDEBUG_H */
#ifndef _ASM_POWERPC_KEXEC_H #ifndef _ASM_POWERPC_KEXEC_H
#define _ASM_POWERPC_KEXEC_H #define _ASM_POWERPC_KEXEC_H
#ifdef __KERNEL__
/* /*
* Maximum page that is mapped directly into kernel memory. * Maximum page that is mapped directly into kernel memory.
...@@ -58,4 +59,5 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs); ...@@ -58,4 +59,5 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs);
#endif /* !CONFIG_KEXEC */ #endif /* !CONFIG_KEXEC */
#endif /* ! __ASSEMBLY__ */ #endif /* ! __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_KEXEC_H */ #endif /* _ASM_POWERPC_KEXEC_H */
#ifndef _ASM_POWERPC_KEYLARGO_H
#define _ASM_POWERPC_KEYLARGO_H
#ifdef __KERNEL__
/* /*
* keylargo.h: definitions for using the "KeyLargo" I/O controller chip. * keylargo.h: definitions for using the "KeyLargo" I/O controller chip.
* *
...@@ -254,3 +257,5 @@ ...@@ -254,3 +257,5 @@
#define SH_FCR1_I2S2_ENABLE 0x00000080 #define SH_FCR1_I2S2_ENABLE 0x00000080
#define SH_FCR3_I2S2_CLK18_ENABLE 0x00008000 #define SH_FCR3_I2S2_CLK18_ENABLE 0x00008000
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_KEYLARGO_H */
#ifndef _ASM_POWERPC_KPROBES_H #ifndef _ASM_POWERPC_KPROBES_H
#define _ASM_POWERPC_KPROBES_H #define _ASM_POWERPC_KPROBES_H
#ifdef __KERNEL__
/* /*
* Kernel Probes (KProbes) * Kernel Probes (KProbes)
* *
...@@ -78,4 +79,5 @@ static inline int kprobe_exceptions_notify(struct notifier_block *self, ...@@ -78,4 +79,5 @@ static inline int kprobe_exceptions_notify(struct notifier_block *self,
return 0; return 0;
} }
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_KPROBES_H */ #endif /* _ASM_POWERPC_KPROBES_H */
#ifndef _PPC64_LMB_H #ifndef _PPC64_LMB_H
#define _PPC64_LMB_H #define _PPC64_LMB_H
#ifdef __KERNEL__
/* /*
* Definitions for talking to the Open Firmware PROM on * Definitions for talking to the Open Firmware PROM on
...@@ -78,4 +79,5 @@ lmb_end_pfn(struct lmb_region *type, unsigned long region_nr) ...@@ -78,4 +79,5 @@ lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
lmb_size_pages(type, region_nr); lmb_size_pages(type, region_nr);
} }
#endif /* __KERNEL__ */
#endif /* _PPC64_LMB_H */ #endif /* _PPC64_LMB_H */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#ifndef _ASM_POWERPC_LPPACA_H #ifndef _ASM_POWERPC_LPPACA_H
#define _ASM_POWERPC_LPPACA_H #define _ASM_POWERPC_LPPACA_H
#ifdef __KERNEL__
//============================================================================= //=============================================================================
// //
...@@ -128,4 +129,5 @@ struct lppaca { ...@@ -128,4 +129,5 @@ struct lppaca {
u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF
}; };
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_LPPACA_H */ #endif /* _ASM_POWERPC_LPPACA_H */
#ifndef __MACIO_ASIC_H__ #ifndef __MACIO_ASIC_H__
#define __MACIO_ASIC_H__ #define __MACIO_ASIC_H__
#ifdef __KERNEL__
#include <asm/of_device.h> #include <asm/of_device.h>
...@@ -137,4 +138,5 @@ struct macio_driver ...@@ -137,4 +138,5 @@ struct macio_driver
extern int macio_register_driver(struct macio_driver *); extern int macio_register_driver(struct macio_driver *);
extern void macio_unregister_driver(struct macio_driver *); extern void macio_unregister_driver(struct macio_driver *);
#endif /* __KERNEL__ */
#endif /* __MACIO_ASIC_H__ */ #endif /* __MACIO_ASIC_H__ */
#ifndef _ASM_POWERPC_MMU_H_ #ifndef _ASM_POWERPC_MMU_H_
#define _ASM_POWERPC_MMU_H_ #define _ASM_POWERPC_MMU_H_
#ifdef __KERNEL__
#ifndef CONFIG_PPC64 #ifndef CONFIG_PPC64
#include <asm-ppc/mmu.h> #include <asm-ppc/mmu.h>
...@@ -402,4 +403,5 @@ typedef unsigned long phys_addr_t; ...@@ -402,4 +403,5 @@ typedef unsigned long phys_addr_t;
#endif /* __ASSEMBLY */ #endif /* __ASSEMBLY */
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MMU_H_ */ #endif /* _ASM_POWERPC_MMU_H_ */
#ifndef __ASM_POWERPC_MMU_CONTEXT_H #ifndef __ASM_POWERPC_MMU_CONTEXT_H
#define __ASM_POWERPC_MMU_CONTEXT_H #define __ASM_POWERPC_MMU_CONTEXT_H
#ifdef __KERNEL__
#ifndef CONFIG_PPC64 #ifndef CONFIG_PPC64
#include <asm-ppc/mmu_context.h> #include <asm-ppc/mmu_context.h>
...@@ -86,4 +87,5 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) ...@@ -86,4 +87,5 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
} }
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
#endif /* __ASM_POWERPC_MMU_CONTEXT_H */ #endif /* __ASM_POWERPC_MMU_CONTEXT_H */
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#ifndef _ASM_MMZONE_H_ #ifndef _ASM_MMZONE_H_
#define _ASM_MMZONE_H_ #define _ASM_MMZONE_H_
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
...@@ -47,4 +48,5 @@ extern unsigned long max_pfn; ...@@ -47,4 +48,5 @@ extern unsigned long max_pfn;
extern int __init early_pfn_to_nid(unsigned long pfn); extern int __init early_pfn_to_nid(unsigned long pfn);
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_MMZONE_H_ */ #endif /* _ASM_MMZONE_H_ */
#ifndef _ASM_POWERPC_MODULE_H #ifndef _ASM_POWERPC_MODULE_H
#define _ASM_POWERPC_MODULE_H #define _ASM_POWERPC_MODULE_H
#ifdef __KERNEL__
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -74,4 +75,5 @@ struct exception_table_entry; ...@@ -74,4 +75,5 @@ struct exception_table_entry;
void sort_ex_table(struct exception_table_entry *start, void sort_ex_table(struct exception_table_entry *start,
struct exception_table_entry *finish); struct exception_table_entry *finish);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MODULE_H */ #endif /* _ASM_POWERPC_MODULE_H */
#ifndef _ASM_POWERPC_MPIC_H #ifndef _ASM_POWERPC_MPIC_H
#define _ASM_POWERPC_MPIC_H #define _ASM_POWERPC_MPIC_H
#ifdef __KERNEL__
#include <linux/irq.h> #include <linux/irq.h>
...@@ -286,4 +287,5 @@ extern int mpic_get_irq(struct pt_regs *regs); ...@@ -286,4 +287,5 @@ extern int mpic_get_irq(struct pt_regs *regs);
/* global mpic for pSeries */ /* global mpic for pSeries */
extern struct mpic *pSeries_mpic; extern struct mpic *pSeries_mpic;
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MPIC_H */ #endif /* _ASM_POWERPC_MPIC_H */
#ifndef _ASM_POWERPC_MAX_NUMNODES_H #ifndef _ASM_POWERPC_MAX_NUMNODES_H
#define _ASM_POWERPC_MAX_NUMNODES_H #define _ASM_POWERPC_MAX_NUMNODES_H
#ifdef __KERNEL__
/* Max 16 Nodes */ /* Max 16 Nodes */
#define NODES_SHIFT 4 #define NODES_SHIFT 4
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_MAX_NUMNODES_H */ #endif /* _ASM_POWERPC_MAX_NUMNODES_H */
...@@ -55,6 +55,7 @@ struct nvram_header { ...@@ -55,6 +55,7 @@ struct nvram_header {
char name[12]; char name[12];
}; };
#ifdef __KERNEL__
struct nvram_partition { struct nvram_partition {
struct list_head partition; struct list_head partition;
struct nvram_header header; struct nvram_header header;
...@@ -69,6 +70,7 @@ extern struct nvram_partition *nvram_find_partition(int sig, const char *name); ...@@ -69,6 +70,7 @@ extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
extern int pSeries_nvram_init(void); extern int pSeries_nvram_init(void);
extern int mmio_nvram_init(void); extern int mmio_nvram_init(void);
#endif /* __KERNEL__ */
/* PowerMac specific nvram stuffs */ /* PowerMac specific nvram stuffs */
...@@ -78,6 +80,7 @@ enum { ...@@ -78,6 +80,7 @@ enum {
pmac_nvram_NR /* MacOS Name Registry partition */ pmac_nvram_NR /* MacOS Name Registry partition */
}; };
#ifdef __KERNEL__
/* Return partition offset in nvram */ /* Return partition offset in nvram */
extern int pmac_get_partition(int partition); extern int pmac_get_partition(int partition);
...@@ -91,6 +94,7 @@ extern void nvram_sync(void); ...@@ -91,6 +94,7 @@ extern void nvram_sync(void);
/* Normal access to NVRAM */ /* Normal access to NVRAM */
extern unsigned char nvram_read_byte(int i); extern unsigned char nvram_read_byte(int i);
extern void nvram_write_byte(unsigned char c, int i); extern void nvram_write_byte(unsigned char c, int i);
#endif
/* Some offsets in XPRAM */ /* Some offsets in XPRAM */
#define PMAC_XPRAM_MACHINE_LOC 0xe4 #define PMAC_XPRAM_MACHINE_LOC 0xe4
......
#ifndef _ASM_POWERPC_OF_DEVICE_H #ifndef _ASM_POWERPC_OF_DEVICE_H
#define _ASM_POWERPC_OF_DEVICE_H #define _ASM_POWERPC_OF_DEVICE_H
#ifdef __KERNEL__
#include <linux/device.h> #include <linux/device.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
...@@ -61,4 +62,5 @@ extern struct of_device *of_platform_device_create(struct device_node *np, ...@@ -61,4 +62,5 @@ extern struct of_device *of_platform_device_create(struct device_node *np,
struct device *parent); struct device *parent);
extern void of_release_dev(struct device *dev); extern void of_release_dev(struct device *dev);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_OF_DEVICE_H */ #endif /* _ASM_POWERPC_OF_DEVICE_H */
#ifndef _ASM_POWERPC_OHARE_H
#define _ASM_POWERPC_OHARE_H
#ifndef __KERNEL__
/* /*
* ohare.h: definitions for using the "O'Hare" I/O controller chip. * ohare.h: definitions for using the "O'Hare" I/O controller chip.
* *
...@@ -46,3 +49,6 @@ ...@@ -46,3 +49,6 @@
* Contributed by Harry Eaton. * Contributed by Harry Eaton.
*/ */
#define STARMAX_FEATURES 0xbeff7a #define STARMAX_FEATURES 0xbeff7a
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_OHARE_H */
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifndef _ASM_POWERPC_OPROFILE_IMPL_H #ifndef _ASM_POWERPC_OPROFILE_IMPL_H
#define _ASM_POWERPC_OPROFILE_IMPL_H #define _ASM_POWERPC_OPROFILE_IMPL_H
#ifdef __KERNEL__
#define OP_MAX_COUNTER 8 #define OP_MAX_COUNTER 8
...@@ -133,4 +134,5 @@ static inline void ctr_write(unsigned int i, unsigned int val) ...@@ -133,4 +134,5 @@ static inline void ctr_write(unsigned int i, unsigned int val)
} }
#endif /* !CONFIG_FSL_BOOKE */ #endif /* !CONFIG_FSL_BOOKE */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_OPROFILE_IMPL_H */ #endif /* _ASM_POWERPC_OPROFILE_IMPL_H */
#ifndef _PPC64_PSERIES_RECONFIG_H #ifndef _PPC64_PSERIES_RECONFIG_H
#define _PPC64_PSERIES_RECONFIG_H #define _PPC64_PSERIES_RECONFIG_H
#ifdef __KERNEL__
#include <linux/notifier.h> #include <linux/notifier.h>
...@@ -22,4 +23,5 @@ static inline int pSeries_reconfig_notifier_register(struct notifier_block *nb) ...@@ -22,4 +23,5 @@ static inline int pSeries_reconfig_notifier_register(struct notifier_block *nb)
static inline void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) { } static inline void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) { }
#endif /* CONFIG_PPC_PSERIES */ #endif /* CONFIG_PPC_PSERIES */
#endif /* __KERNEL__ */
#endif /* _PPC64_PSERIES_RECONFIG_H */ #endif /* _PPC64_PSERIES_RECONFIG_H */
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#ifndef _ASM_POWERPC_PACA_H #ifndef _ASM_POWERPC_PACA_H
#define _ASM_POWERPC_PACA_H #define _ASM_POWERPC_PACA_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <asm/types.h> #include <asm/types.h>
...@@ -110,4 +111,5 @@ struct paca_struct { ...@@ -110,4 +111,5 @@ struct paca_struct {
extern struct paca_struct paca[]; extern struct paca_struct paca[];
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PACA_H */ #endif /* _ASM_POWERPC_PACA_H */
#ifndef _ASM_POWERPC_PAGE_32_H #ifndef _ASM_POWERPC_PAGE_32_H
#define _ASM_POWERPC_PAGE_32_H #define _ASM_POWERPC_PAGE_32_H
#ifdef __KERNEL__
#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 #define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
...@@ -37,4 +38,5 @@ extern __inline__ int get_order(unsigned long size) ...@@ -37,4 +38,5 @@ extern __inline__ int get_order(unsigned long size)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PAGE_32_H */ #endif /* _ASM_POWERPC_PAGE_32_H */
#ifndef _ASM_POWERPC_PAGE_64_H #ifndef _ASM_POWERPC_PAGE_64_H
#define _ASM_POWERPC_PAGE_64_H #define _ASM_POWERPC_PAGE_64_H
#ifdef __KERNEL__
/* /*
* Copyright (C) 2001 PPC64 Team, IBM Corp * Copyright (C) 2001 PPC64 Team, IBM Corp
...@@ -170,4 +171,5 @@ extern unsigned int HPAGE_SHIFT; ...@@ -170,4 +171,5 @@ extern unsigned int HPAGE_SHIFT;
#include <asm-generic/page.h> #include <asm-generic/page.h>
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PAGE_64_H */ #endif /* _ASM_POWERPC_PAGE_64_H */
#ifndef _ASM_POWERPC_PARAM_H #ifndef _ASM_POWERPC_PARAM_H
#define _ASM_POWERPC_PARAM_H #define _ASM_POWERPC_PARAM_H
#include <linux/config.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#define HZ CONFIG_HZ /* internal kernel timer frequency */ #define HZ CONFIG_HZ /* internal kernel timer frequency */
#define USER_HZ 100 /* for user interfaces in "ticks" */ #define USER_HZ 100 /* for user interfaces in "ticks" */
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifndef _ASM_POWERPC_PARPORT_H #ifndef _ASM_POWERPC_PARPORT_H
#define _ASM_POWERPC_PARPORT_H #define _ASM_POWERPC_PARPORT_H
#ifdef __KERNEL__
static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
...@@ -15,4 +16,5 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) ...@@ -15,4 +16,5 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
return parport_pc_find_isa_ports (autoirq, autodma); return parport_pc_find_isa_ports (autoirq, autodma);
} }
#endif /* __KERNEL__ */
#endif /* !(_ASM_POWERPC_PARPORT_H) */ #endif /* !(_ASM_POWERPC_PARPORT_H) */
#ifndef _ASM_POWERPC_PCI_BRIDGE_H #ifndef _ASM_POWERPC_PCI_BRIDGE_H
#define _ASM_POWERPC_PCI_BRIDGE_H #define _ASM_POWERPC_PCI_BRIDGE_H
#ifdef __KERNEL__
#ifndef CONFIG_PPC64 #ifndef CONFIG_PPC64
#include <asm-ppc/pci-bridge.h> #include <asm-ppc/pci-bridge.h>
...@@ -172,4 +173,5 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) ...@@ -172,4 +173,5 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address)
#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
#endif #endif
#ifndef _ASM_POWERPC_PGALLOC_H #ifndef _ASM_POWERPC_PGALLOC_H
#define _ASM_POWERPC_PGALLOC_H #define _ASM_POWERPC_PGALLOC_H
#ifdef __KERNEL__
#ifndef CONFIG_PPC64 #ifndef CONFIG_PPC64
#include <asm-ppc/pgalloc.h> #include <asm-ppc/pgalloc.h>
...@@ -153,4 +154,5 @@ extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf); ...@@ -153,4 +154,5 @@ extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
#define check_pgt_cache() do { } while (0) #define check_pgt_cache() do { } while (0)
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PGALLOC_H */ #endif /* _ASM_POWERPC_PGALLOC_H */
#ifndef _ASM_POWERPC_PGTABLE_64K_H
#define _ASM_POWERPC_PGTABLE_64K_H
#ifdef __KERNEL__
#include <asm-generic/pgtable-nopud.h> #include <asm-generic/pgtable-nopud.h>
...@@ -88,3 +92,5 @@ ...@@ -88,3 +92,5 @@
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PGTABLE_64K_H */
#ifndef _ASM_POWERPC_PGTABLE_H #ifndef _ASM_POWERPC_PGTABLE_H
#define _ASM_POWERPC_PGTABLE_H #define _ASM_POWERPC_PGTABLE_H
#ifdef __KERNEL__
#ifndef CONFIG_PPC64 #ifndef CONFIG_PPC64
#include <asm-ppc/pgtable.h> #include <asm-ppc/pgtable.h>
...@@ -532,4 +533,5 @@ void pgtable_cache_init(void); ...@@ -532,4 +533,5 @@ void pgtable_cache_init(void);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* CONFIG_PPC64 */ #endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PGTABLE_H */ #endif /* _ASM_POWERPC_PGTABLE_H */
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#ifndef __PMAC_LOW_I2C_H__ #ifndef __PMAC_LOW_I2C_H__
#define __PMAC_LOW_I2C_H__ #define __PMAC_LOW_I2C_H__
#ifdef __KERNEL__
/* i2c mode (based on the platform functions format) */ /* i2c mode (based on the platform functions format) */
enum { enum {
...@@ -40,4 +41,5 @@ int pmac_low_i2c_setmode(struct device_node *np, int mode); ...@@ -40,4 +41,5 @@ int pmac_low_i2c_setmode(struct device_node *np, int mode);
int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len); int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len);
#endif /* __KERNEL__ */
#endif /* __PMAC_LOW_I2C_H__ */ #endif /* __PMAC_LOW_I2C_H__ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#ifndef _POWERPC_PMC_H #ifndef _POWERPC_PMC_H
#define _POWERPC_PMC_H #define _POWERPC_PMC_H
#ifdef __KERNEL__
#include <asm/ptrace.h> #include <asm/ptrace.h>
...@@ -44,4 +45,5 @@ void dump_pmcs(void); ...@@ -44,4 +45,5 @@ void dump_pmcs(void);
extern struct op_powerpc_model op_model_fsl_booke; extern struct op_powerpc_model op_model_fsl_booke;
#endif #endif
#endif /* __KERNEL__ */
#endif /* _POWERPC_PMC_H */ #endif /* _POWERPC_PMC_H */
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#ifndef _ASM_POWERPC_PPC_PCI_H #ifndef _ASM_POWERPC_PPC_PCI_H
#define _ASM_POWERPC_PPC_PCI_H #define _ASM_POWERPC_PPC_PCI_H
#ifdef __KERNEL__
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
...@@ -93,4 +94,5 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag); ...@@ -93,4 +94,5 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag);
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PPC_PCI_H */ #endif /* _ASM_POWERPC_PPC_PCI_H */
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
#define RFDI .long 0x4c00004e /* rfdi instruction */ #define RFDI .long 0x4c00004e /* rfdi instruction */
#define RFMCI .long 0x4c00004c /* rfmci instruction */ #define RFMCI .long 0x4c00004c /* rfmci instruction */
#ifdef __KERNEL__
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
#define XGLUE(a,b) a##b #define XGLUE(a,b) a##b
...@@ -325,6 +326,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) ...@@ -325,6 +326,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
#define CLR_TOP32(r) #define CLR_TOP32(r)
#endif #endif
#endif /* __KERNEL__ */
/* The boring bits... */ /* The boring bits... */
/* Condition Register Bit Fields */ /* Condition Register Bit Fields */
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <asm/reg.h> #include <asm/reg.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -50,6 +49,7 @@ ...@@ -50,6 +49,7 @@
#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */
#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */
#ifdef __KERNEL__
#define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \
_machine == PLATFORM_PSERIES_LPAR) _machine == PLATFORM_PSERIES_LPAR)
#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) #define platform_is_lpar() (!!(_machine & PLATFORM_LPAR))
...@@ -81,7 +81,7 @@ extern unsigned char ucBoardRevMaj, ucBoardRevMin; ...@@ -81,7 +81,7 @@ extern unsigned char ucBoardRevMaj, ucBoardRevMin;
#else #else
#define _machine 0 #define _machine 0
#endif /* CONFIG_PPC_MULTIPLATFORM */ #endif /* CONFIG_PPC_MULTIPLATFORM */
#endif /* __KERNEL__ */
/* /*
* Default implementation of macro that returns current * Default implementation of macro that returns current
* instruction pointer ("program counter"). * instruction pointer ("program counter").
......
#ifndef _POWERPC_RTAS_H #ifndef _POWERPC_RTAS_H
#define _POWERPC_RTAS_H #define _POWERPC_RTAS_H
#ifdef __KERNEL__
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -229,4 +230,5 @@ extern unsigned long rtas_rmo_buf; ...@@ -229,4 +230,5 @@ extern unsigned long rtas_rmo_buf;
#define GLOBAL_INTERRUPT_QUEUE 9005 #define GLOBAL_INTERRUPT_QUEUE 9005
#endif /* __KERNEL__ */
#endif /* _POWERPC_RTAS_H */ #endif /* _POWERPC_RTAS_H */
#ifndef _ASM_POWERPC_SECCOMP_H #ifndef _ASM_POWERPC_SECCOMP_H
#define _ASM_POWERPC_SECCOMP_H
#ifndef __KERNEL__
#include <linux/thread_info.h> #include <linux/thread_info.h>
#endif
#include <linux/unistd.h> #include <linux/unistd.h>
#define __NR_seccomp_read __NR_read #define __NR_seccomp_read __NR_read
......
#ifndef _ASM_POWERPC_SECTIONS_H #ifndef _ASM_POWERPC_SECTIONS_H
#define _ASM_POWERPC_SECTIONS_H #define _ASM_POWERPC_SECTIONS_H
#ifdef __KERNEL__
#include <asm-generic/sections.h> #include <asm-generic/sections.h>
...@@ -17,4 +18,5 @@ static inline int in_kernel_text(unsigned long addr) ...@@ -17,4 +18,5 @@ static inline int in_kernel_text(unsigned long addr)
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_SECTIONS_H */ #endif /* _ASM_POWERPC_SECTIONS_H */
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
#define _ASM_POWERPC_SIGNAL_H #define _ASM_POWERPC_SIGNAL_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/config.h>
#define _NSIG 64 #define _NSIG 64
#define _NSIG_BPW BITS_PER_LONG #ifdef __powerpc64__
#define _NSIG_BPW 64
#else
#define _NSIG_BPW 32
#endif
#define _NSIG_WORDS (_NSIG / _NSIG_BPW) #define _NSIG_WORDS (_NSIG / _NSIG_BPW)
typedef unsigned long old_sigset_t; /* at least 32 bits */ typedef unsigned long old_sigset_t; /* at least 32 bits */
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
/* /*
* Definitions for talking to the SMU chip in newer G5 PowerMacs * Definitions for talking to the SMU chip in newer G5 PowerMacs
*/ */
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <linux/list.h> #include <linux/list.h>
#endif
#include <linux/types.h>
/* /*
* Known SMU commands * Known SMU commands
...@@ -487,8 +489,8 @@ struct smu_sdbp_slotspow { ...@@ -487,8 +489,8 @@ struct smu_sdbp_slotspow {
#define SMU_SDB_SENSORTREE_ID 0x25 #define SMU_SDB_SENSORTREE_ID 0x25
struct smu_sdbp_sensortree { struct smu_sdbp_sensortree {
u8 model_id; __u8 model_id;
u8 unknown[3]; __u8 unknown[3];
}; };
/* This partition contains CPU thermal control PID informations. So far /* This partition contains CPU thermal control PID informations. So far
...@@ -498,13 +500,13 @@ struct smu_sdbp_sensortree { ...@@ -498,13 +500,13 @@ struct smu_sdbp_sensortree {
#define SMU_SDB_CPUPIDDATA_ID 0x17 #define SMU_SDB_CPUPIDDATA_ID 0x17
struct smu_sdbp_cpupiddata { struct smu_sdbp_cpupiddata {
u8 unknown1; __u8 unknown1;
u8 target_temp_delta; __u8 target_temp_delta;
u8 unknown2; __u8 unknown2;
u8 history_len; __u8 history_len;
s16 power_adj; __s16 power_adj;
u16 max_power; __u16 max_power;
s32 gp,gr,gd; __s32 gp,gr,gd;
}; };
......
#ifndef _ASM_POWERPC_SPARSEMEM_H #ifndef _ASM_POWERPC_SPARSEMEM_H
#define _ASM_POWERPC_SPARSEMEM_H 1 #define _ASM_POWERPC_SPARSEMEM_H 1
#ifdef __KERNEL__
#ifdef CONFIG_SPARSEMEM #ifdef CONFIG_SPARSEMEM
/* /*
...@@ -25,4 +26,5 @@ static inline int hot_add_scn_to_nid(unsigned long scn_addr) ...@@ -25,4 +26,5 @@ static inline int hot_add_scn_to_nid(unsigned long scn_addr)
#endif /* CONFIG_SPARSEMEM */ #endif /* CONFIG_SPARSEMEM */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_SPARSEMEM_H */ #endif /* _ASM_POWERPC_SPARSEMEM_H */
#ifndef __ASM_SPINLOCK_H #ifndef __ASM_SPINLOCK_H
#define __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H
#ifdef __KERNEL__
/* /*
* Simple spin lock operations. * Simple spin lock operations.
...@@ -266,4 +267,5 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) ...@@ -266,4 +267,5 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
rw->lock = 0; rw->lock = 0;
} }
#endif /* __KERNEL__ */
#endif /* __ASM_SPINLOCK_H */ #endif /* __ASM_SPINLOCK_H */
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#ifndef _SPU_H #ifndef _SPU_H
#define _SPU_H #define _SPU_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <linux/kref.h> #include <linux/kref.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
...@@ -578,4 +580,5 @@ struct spu_priv1 { ...@@ -578,4 +580,5 @@ struct spu_priv1 {
u64 spu_trace_cntl; /* 0x1070 */ u64 spu_trace_cntl; /* 0x1070 */
} __attribute__ ((aligned(0x2000))); } __attribute__ ((aligned(0x2000)));
#endif /* __KERNEL__ */
#endif #endif
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#ifndef _SPU_CSA_H_ #ifndef _SPU_CSA_H_
#define _SPU_CSA_H_ #define _SPU_CSA_H_
#ifdef __KERNEL__
/* /*
* Total number of 128-bit registers. * Total number of 128-bit registers.
...@@ -89,8 +90,6 @@ struct spu_lscsa { ...@@ -89,8 +90,6 @@ struct spu_lscsa {
unsigned char ls[LS_SIZE]; unsigned char ls[LS_SIZE];
}; };
#ifdef __KERNEL__
/* /*
* struct spu_problem_collapsed - condensed problem state area, w/o pads. * struct spu_problem_collapsed - condensed problem state area, w/o pads.
*/ */
......
#ifndef _ASM_POWERPC_SYNCH_H #ifndef _ASM_POWERPC_SYNCH_H
#define _ASM_POWERPC_SYNCH_H #define _ASM_POWERPC_SYNCH_H
#ifdef __KERNEL__
#include <linux/config.h>
#ifdef __powerpc64__ #ifdef __powerpc64__
#define __SUBARCH_HAS_LWSYNC #define __SUBARCH_HAS_LWSYNC
...@@ -47,5 +46,6 @@ static inline void isync(void) ...@@ -47,5 +46,6 @@ static inline void isync(void)
#define isync_on_smp() __asm__ __volatile__("": : :"memory") #define isync_on_smp() __asm__ __volatile__("": : :"memory")
#endif #endif
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_SYNCH_H */ #endif /* _ASM_POWERPC_SYNCH_H */
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#ifndef _ASM_POWERPC_SYSTEM_H #ifndef _ASM_POWERPC_SYSTEM_H
#define _ASM_POWERPC_SYSTEM_H #define _ASM_POWERPC_SYSTEM_H
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
...@@ -42,6 +41,7 @@ ...@@ -42,6 +41,7 @@
#define set_mb(var, value) do { var = value; mb(); } while (0) #define set_mb(var, value) do { var = value; mb(); } while (0)
#define set_wmb(var, value) do { var = value; wmb(); } while (0) #define set_wmb(var, value) do { var = value; wmb(); } while (0)
#ifdef __KERNEL__
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define smp_mb() mb() #define smp_mb() mb()
#define smp_rmb() rmb() #define smp_rmb() rmb()
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#define smp_read_barrier_depends() do { } while(0) #define smp_read_barrier_depends() do { } while(0)
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#ifdef __KERNEL__
struct task_struct; struct task_struct;
struct pt_regs; struct pt_regs;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef _ASM_POWERPC_TCE_H #ifndef _ASM_POWERPC_TCE_H
#define _ASM_POWERPC_TCE_H #define _ASM_POWERPC_TCE_H
#ifdef __KERNEL__
/* /*
* Tces come in two formats, one for the virtual bus and a different * Tces come in two formats, one for the virtual bus and a different
...@@ -61,4 +62,5 @@ union tce_entry { ...@@ -61,4 +62,5 @@ union tce_entry {
}; };
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_TCE_H */ #endif /* _ASM_POWERPC_TCE_H */
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#ifndef _ASM_POWERPC_TLB_H #ifndef _ASM_POWERPC_TLB_H
#define _ASM_POWERPC_TLB_H #define _ASM_POWERPC_TLB_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#ifndef __powerpc64__ #ifndef __powerpc64__
...@@ -67,4 +68,5 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, ...@@ -67,4 +68,5 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
} }
#endif #endif
#endif /* __KERNEL__ */
#endif /* __ASM_POWERPC_TLB_H */ #endif /* __ASM_POWERPC_TLB_H */
#ifndef _ASM_POWERPC_TOPOLOGY_H #ifndef _ASM_POWERPC_TOPOLOGY_H
#define _ASM_POWERPC_TOPOLOGY_H #define _ASM_POWERPC_TOPOLOGY_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
...@@ -65,4 +66,5 @@ static inline void dump_numa_cpu_topology(void) {} ...@@ -65,4 +66,5 @@ static inline void dump_numa_cpu_topology(void) {}
#endif /* CONFIG_NUMA */ #endif /* CONFIG_NUMA */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_TOPOLOGY_H */ #endif /* _ASM_POWERPC_TOPOLOGY_H */
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#ifndef _ASM_POWERPC_UDBG_H #ifndef _ASM_POWERPC_UDBG_H
#define _ASM_POWERPC_UDBG_H #define _ASM_POWERPC_UDBG_H
#ifdef __KERNEL__
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -34,4 +35,5 @@ extern void udbg_scc_init(int force_scc); ...@@ -34,4 +35,5 @@ extern void udbg_scc_init(int force_scc);
extern int udbg_adb_init(int force_btext); extern int udbg_adb_init(int force_btext);
extern void udbg_adb_init_early(void); extern void udbg_adb_init_early(void);
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */ #endif /* _ASM_POWERPC_UDBG_H */
#ifndef _VDSO_DATAPAGE_H #ifndef _VDSO_DATAPAGE_H
#define _VDSO_DATAPAGE_H #define _VDSO_DATAPAGE_H
#ifdef __KERNEL__
/* /*
* Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM
...@@ -105,4 +106,5 @@ extern struct vdso_data *vdso_data; ...@@ -105,4 +106,5 @@ extern struct vdso_data *vdso_data;
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _SYSTEMCFG_H */ #endif /* _SYSTEMCFG_H */
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#ifndef _ASM_POWERPC_VIO_H #ifndef _ASM_POWERPC_VIO_H
#define _ASM_POWERPC_VIO_H #define _ASM_POWERPC_VIO_H
#ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -103,4 +104,5 @@ static inline struct vio_dev *to_vio_dev(struct device *dev) ...@@ -103,4 +104,5 @@ static inline struct vio_dev *to_vio_dev(struct device *dev)
return container_of(dev, struct vio_dev, dev); return container_of(dev, struct vio_dev, dev);
} }
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_VIO_H */ #endif /* _ASM_POWERPC_VIO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment