summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc')
-rw-r--r--include/asm-ppc/8xx_immap.h2
-rw-r--r--include/asm-ppc/amigahw.h2
-rw-r--r--include/asm-ppc/amigaints.h2
-rw-r--r--include/asm-ppc/amigappc.h2
-rw-r--r--include/asm-ppc/backlight.h2
-rw-r--r--include/asm-ppc/bitops.h2
-rw-r--r--include/asm-ppc/board.h2
-rw-r--r--include/asm-ppc/bootinfo.h2
-rw-r--r--include/asm-ppc/byteorder.h9
-rw-r--r--include/asm-ppc/cache.h2
-rw-r--r--include/asm-ppc/checksum.h2
-rw-r--r--include/asm-ppc/cpm_8260.h2
-rw-r--r--include/asm-ppc/current.h2
-rw-r--r--include/asm-ppc/dbdma.h2
-rw-r--r--include/asm-ppc/delay.h2
-rw-r--r--include/asm-ppc/dma.h3
-rw-r--r--include/asm-ppc/elf.h42
-rw-r--r--include/asm-ppc/feature.h2
-rw-r--r--include/asm-ppc/floppy.h2
-rw-r--r--include/asm-ppc/gemini.h2
-rw-r--r--include/asm-ppc/gemini_serial.h2
-rw-r--r--include/asm-ppc/hardirq.h2
-rw-r--r--include/asm-ppc/highmem.h17
-rw-r--r--include/asm-ppc/hw_irq.h2
-rw-r--r--include/asm-ppc/ide.h4
-rw-r--r--include/asm-ppc/immap_8260.h2
-rw-r--r--include/asm-ppc/init.h2
-rw-r--r--include/asm-ppc/io.h9
-rw-r--r--include/asm-ppc/ipcbuf.h24
-rw-r--r--include/asm-ppc/irq.h5
-rw-r--r--include/asm-ppc/kgdb.h2
-rw-r--r--include/asm-ppc/kmap_types.h2
-rw-r--r--include/asm-ppc/linux_logo.h2
-rw-r--r--include/asm-ppc/machdep.h3
-rw-r--r--include/asm-ppc/mbx.h3
-rw-r--r--include/asm-ppc/mc146818rtc.h2
-rw-r--r--include/asm-ppc/md.h2
-rw-r--r--include/asm-ppc/mediabay.h4
-rw-r--r--include/asm-ppc/mmu.h2
-rw-r--r--include/asm-ppc/mmu_context.h2
-rw-r--r--include/asm-ppc/module.h11
-rw-r--r--include/asm-ppc/mpc8260.h2
-rw-r--r--include/asm-ppc/mpc8xx.h2
-rw-r--r--include/asm-ppc/msgbuf.h1
-rw-r--r--include/asm-ppc/namei.h2
-rw-r--r--include/asm-ppc/nvram.h2
-rw-r--r--include/asm-ppc/oak.h2
-rw-r--r--include/asm-ppc/page.h12
-rw-r--r--include/asm-ppc/param.h4
-rw-r--r--include/asm-ppc/pci-bridge.h2
-rw-r--r--include/asm-ppc/pci.h2
-rw-r--r--include/asm-ppc/pgalloc.h29
-rw-r--r--include/asm-ppc/pgtable.h5
-rw-r--r--include/asm-ppc/pnp.h2
-rw-r--r--include/asm-ppc/prep_nvram.h2
-rw-r--r--include/asm-ppc/processor.h2
-rw-r--r--include/asm-ppc/prom.h2
-rw-r--r--include/asm-ppc/ptrace.h38
-rw-r--r--include/asm-ppc/raven.h2
-rw-r--r--include/asm-ppc/residual.h2
-rw-r--r--include/asm-ppc/rpxclassic.h2
-rw-r--r--include/asm-ppc/rpxlite.h2
-rw-r--r--include/asm-ppc/scatterlist.h2
-rw-r--r--include/asm-ppc/semaphore-helper.h2
-rw-r--r--include/asm-ppc/sembuf.h1
-rw-r--r--include/asm-ppc/serial.h2
-rw-r--r--include/asm-ppc/setup.h2
-rw-r--r--include/asm-ppc/shmbuf.h12
-rw-r--r--include/asm-ppc/siginfo.h2
-rw-r--r--include/asm-ppc/signal.h2
-rw-r--r--include/asm-ppc/smp.h2
-rw-r--r--include/asm-ppc/smplock.h2
-rw-r--r--include/asm-ppc/softirq.h2
-rw-r--r--include/asm-ppc/spinlock.h2
-rw-r--r--include/asm-ppc/stat.h2
-rw-r--r--include/asm-ppc/string.h4
-rw-r--r--include/asm-ppc/system.h2
-rw-r--r--include/asm-ppc/termbits.h2
-rw-r--r--include/asm-ppc/time.h2
-rw-r--r--include/asm-ppc/timex.h2
-rw-r--r--include/asm-ppc/tqm860.h2
-rw-r--r--include/asm-ppc/tqm8xxL.h2
-rw-r--r--include/asm-ppc/types.h8
-rw-r--r--include/asm-ppc/uaccess.h2
-rw-r--r--include/asm-ppc/unaligned.h2
-rw-r--r--include/asm-ppc/uninorth.h4
-rw-r--r--include/asm-ppc/user.h2
-rw-r--r--include/asm-ppc/vga.h2
-rw-r--r--include/asm-ppc/walnut.h2
-rw-r--r--include/asm-ppc/xor.h1
90 files changed, 262 insertions, 123 deletions
diff --git a/include/asm-ppc/8xx_immap.h b/include/asm-ppc/8xx_immap.h
index 0223fe275..d470233e3 100644
--- a/include/asm-ppc/8xx_immap.h
+++ b/include/asm-ppc/8xx_immap.h
@@ -10,6 +10,7 @@
* a combination that I found difficult to separate into logical
* functional files.....but anyone else is welcome to try. -- Dan
*/
+#ifdef __KERNEL__
#ifndef __IMMAP_8XX__
#define __IMMAP_8XX__
@@ -453,3 +454,4 @@ typedef struct immap {
} immap_t;
#endif /* __IMMAP_8XX__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigahw.h b/include/asm-ppc/amigahw.h
index 491547376..8c98945e7 100644
--- a/include/asm-ppc/amigahw.h
+++ b/include/asm-ppc/amigahw.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASMPPC_AMIGAHW_H
#define __ASMPPC_AMIGAHW_H
@@ -13,3 +14,4 @@
#endif /* __ASMPPC_AMIGAHW_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigaints.h b/include/asm-ppc/amigaints.h
index c7a50189e..a5e1c4850 100644
--- a/include/asm-ppc/amigaints.h
+++ b/include/asm-ppc/amigaints.h
@@ -10,6 +10,7 @@
** Created 10/2/92 by Greg Harp
*/
+#ifdef __KERNEL__
#ifndef _ASMm68k_AMIGAINTS_H_
#define _ASMm68k_AMIGAINTS_H_
@@ -133,3 +134,4 @@ extern unsigned char cia_set_irq(unsigned int irq, int set);
extern unsigned char cia_able_irq(unsigned int irq, int enable);
#endif /* asm-m68k/amigaints.h */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigappc.h b/include/asm-ppc/amigappc.h
index 96e5e8f09..8750af77a 100644
--- a/include/asm-ppc/amigappc.h
+++ b/include/asm-ppc/amigappc.h
@@ -11,6 +11,7 @@
** Created: 7/22/97 by Jesper Skov
*/
+#ifdef __KERNEL__
#ifndef _M68K_AMIGAPPC_H
#define _M68K_AMIGAPPC_H
@@ -81,3 +82,4 @@ do { \
#define INTLVL_MASK (0x7f)
#endif /* _M68k_AMIGAPPC_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/backlight.h b/include/asm-ppc/backlight.h
index 79756eca3..2f070ef6f 100644
--- a/include/asm-ppc/backlight.h
+++ b/include/asm-ppc/backlight.h
@@ -4,6 +4,7 @@
* For now, implementation resides in arch/ppc/kernel/pmac_support.c
*
*/
+#ifdef __KERNEL__
#ifndef __ASM_PPC_BACKLIGHT_H
#define __ASM_PPC_BACKLIGHT_H
@@ -26,3 +27,4 @@ extern int set_backlight_level(int level);
extern int get_backlight_level(void);
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index b82a9fc21..c31e5c5eb 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -3,6 +3,7 @@
* bitops.h: Bit string operations on the ppc
*/
+#ifdef __KERNEL__
#ifndef _PPC_BITOPS_H
#define _PPC_BITOPS_H
@@ -351,3 +352,4 @@ found_middle:
#endif /* __KERNEL__ */
#endif /* _PPC_BITOPS_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/board.h b/include/asm-ppc/board.h
index 1476a232a..d1d3ba68a 100644
--- a/include/asm-ppc/board.h
+++ b/include/asm-ppc/board.h
@@ -10,6 +10,7 @@
*
*/
+#ifdef __KERNEL__
#ifndef __BOARD_H__
#define __BOARD_H__
@@ -40,3 +41,4 @@ extern unsigned char __res[];
#endif
#endif /* __BOARD_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
index af614d798..84e7a7c8f 100644
--- a/include/asm-ppc/bootinfo.h
+++ b/include/asm-ppc/bootinfo.h
@@ -6,6 +6,7 @@
*/
+#ifdef __KERNEL__
#ifndef _PPC_BOOTINFO_H
#define _PPC_BOOTINFO_H
@@ -33,3 +34,4 @@ struct bi_record {
#endif /* _PPC_BOOTINFO_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h
index 02454f6cf..2da8cfd6c 100644
--- a/include/asm-ppc/byteorder.h
+++ b/include/asm-ppc/byteorder.h
@@ -7,6 +7,7 @@
#include <asm/types.h>
+#ifdef __KERNEL__
#ifdef __GNUC__
extern __inline__ unsigned ld_le16(const volatile unsigned short *addr)
@@ -72,11 +73,13 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 value)
#define __arch__swab16s(addr) st_le16(addr,*addr)
#define __arch__swab32s(addr) st_le32(addr,*addr)
-#endif /* __GNUC__ */
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#ifndef __STRICT_ANSI__
#define __BYTEORDER_HAS_U64__
#endif
+
+#endif /* __GNUC__ */
+#endif /* __KERNEL__ */
+
#include <linux/byteorder/big_endian.h>
#endif /* _PPC_BYTEORDER_H */
diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h
index c45fd8409..e4bcdde00 100644
--- a/include/asm-ppc/cache.h
+++ b/include/asm-ppc/cache.h
@@ -1,6 +1,7 @@
/*
* include/asm-ppc/cache.h
*/
+#ifdef __KERNEL__
#ifndef __ARCH_PPC_CACHE_H
#define __ARCH_PPC_CACHE_H
@@ -83,3 +84,4 @@ extern void flush_dcache_range(unsigned long start, unsigned long stop);
#endif /* CONFIG_8xx */
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h
index e635ff599..48c8ca7b5 100644
--- a/include/asm-ppc/checksum.h
+++ b/include/asm-ppc/checksum.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_CHECKSUM_H
#define _PPC_CHECKSUM_H
@@ -111,3 +112,4 @@ extern unsigned short csum_tcpudp_magic(unsigned long saddr,
unsigned int sum);
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/cpm_8260.h b/include/asm-ppc/cpm_8260.h
index 427ec1884..b612cf02f 100644
--- a/include/asm-ppc/cpm_8260.h
+++ b/include/asm-ppc/cpm_8260.h
@@ -8,6 +8,7 @@
* All CPM control and status is available through the MPC8260 internal
* memory map. See immap.h for details.
*/
+#ifdef __KERNEL__
#ifndef __CPM_82XX__
#define __CPM_82XX__
@@ -697,3 +698,4 @@ typedef struct iic {
#define BD_IIC_START ((ushort)0x0400)
#endif /* __CPM_82XX__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/current.h b/include/asm-ppc/current.h
index 49415ce9f..8d41501ba 100644
--- a/include/asm-ppc/current.h
+++ b/include/asm-ppc/current.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_CURRENT_H
#define _PPC_CURRENT_H
@@ -7,3 +8,4 @@
register struct task_struct *current asm ("r2");
#endif /* !(_PPC_CURRENT_H) */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/dbdma.h b/include/asm-ppc/dbdma.h
index 38cd15803..0590cb454 100644
--- a/include/asm-ppc/dbdma.h
+++ b/include/asm-ppc/dbdma.h
@@ -5,6 +5,7 @@
* Copyright (C) 1996 Paul Mackerras.
*/
+#ifdef __KERNEL__
#ifndef _ASM_DBDMA_H_
#define _ASM_DBDMA_H_
/*
@@ -90,3 +91,4 @@ struct dbdma_cmd {
#define DBDMA_ALIGN(x) (((unsigned)(x) + sizeof(struct dbdma_cmd) - 1) \
& -sizeof(struct dbdma_cmd))
#endif /* _ASM_DBDMA_H_ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/delay.h b/include/asm-ppc/delay.h
index 239e0d3ac..2116a2f2c 100644
--- a/include/asm-ppc/delay.h
+++ b/include/asm-ppc/delay.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_DELAY_H
#define _PPC_DELAY_H
@@ -31,3 +32,4 @@ extern __inline__ void udelay(unsigned long usecs)
}
#endif /* defined(_PPC_DELAY_H) */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/dma.h b/include/asm-ppc/dma.h
index 5cac2be5e..735d91d1f 100644
--- a/include/asm-ppc/dma.h
+++ b/include/asm-ppc/dma.h
@@ -6,6 +6,8 @@
* Changes for ppc sound by Christoph Nadig
*/
+#ifdef __KERNEL__
+
#include <linux/config.h>
#include <asm/io.h>
#include <linux/spinlock.h>
@@ -410,3 +412,4 @@ extern int isa_dma_bridge_buggy;
#define isa_dma_bridge_buggy (0)
#endif
#endif /* _ASM_DMA_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h
index 75b515e18..6a0e2e874 100644
--- a/include/asm-ppc/elf.h
+++ b/include/asm-ppc/elf.h
@@ -11,38 +11,41 @@
#define ELF_NVRREG 33 /* includes vscr */
/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x) ((x)->e_machine == EM_PPC)
-
-/*
* These are used to set parameters in the core dumps.
*/
#define ELF_ARCH EM_PPC
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB
-#define USE_ELF_CORE_DUMP
-#define ELF_EXEC_PAGESIZE 4096
-
-/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
- use of this is to invoke "./ld.so someprog" to test out a new version of
- the loader. We need to make sure that it is out of the way of the program
- that it will "exec", and that there is sufficient room for the brk. */
-
-#define ELF_ET_DYN_BASE (0x08000000)
-
+/* General registers */
typedef unsigned long elf_greg_t;
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+/* Floating point registers */
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-#ifdef __KERNEL__
/* Altivec registers */
-typedef vector128 elf_vrreg_t;
+typedef __vector128 elf_vrreg_t;
typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
-#endif /* __KERNEL__ */
+
+#ifdef __KERNEL__
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+
+#define elf_check_arch(x) ((x)->e_machine == EM_PPC)
+
+/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
+ use of this is to invoke "./ld.so someprog" to test out a new version of
+ the loader. We need to make sure that it is out of the way of the program
+ that it will "exec", and that there is sufficient room for the brk. */
+
+#define ELF_ET_DYN_BASE (0x08000000)
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE 4096
#define ELF_CORE_COPY_REGS(gregs, regs) \
memcpy(gregs, regs, \
@@ -65,8 +68,7 @@ typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
#define ELF_PLATFORM (NULL)
-#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
-#endif
+#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-ppc/feature.h b/include/asm-ppc/feature.h
index ca4ca4692..7a33ea8d3 100644
--- a/include/asm-ppc/feature.h
+++ b/include/asm-ppc/feature.h
@@ -12,6 +12,7 @@
*
*
*/
+#ifdef __KERNEL__
#ifndef __ASM_PPC_FEATURE_H
#define __ASM_PPC_FEATURE_H
@@ -93,3 +94,4 @@ extern void feature_prepare_for_sleep(void);
extern void feature_wake_up(void);
#endif /* __ASM_PPC_FEATURE_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h
index f12eae65f..f04178736 100644
--- a/include/asm-ppc/floppy.h
+++ b/include/asm-ppc/floppy.h
@@ -7,6 +7,7 @@
*
* Copyright (C) 1995
*/
+#ifdef __KERNEL__
#ifndef __ASM_PPC_FLOPPY_H
#define __ASM_PPC_FLOPPY_H
@@ -54,3 +55,4 @@ static int FDC2 = -1;
#define CROSS_64KB(a,s) (0)
#endif /* __ASM_PPC_FLOPPY_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/gemini.h b/include/asm-ppc/gemini.h
index 7e681e043..ebd01c9b6 100644
--- a/include/asm-ppc/gemini.h
+++ b/include/asm-ppc/gemini.h
@@ -6,6 +6,7 @@
* "Gemini" boards.
*
*/
+#ifdef __KERNEL__
#ifndef __PPC_GEMINI_H
#define __PPC_GEMINI_H
@@ -164,3 +165,4 @@ extern void gemini_prom_init(void);
extern void gemini_init_l2(void);
#endif /* __ASSEMBLY__ */
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/gemini_serial.h b/include/asm-ppc/gemini_serial.h
index 089a0ce60..e4e08467e 100644
--- a/include/asm-ppc/gemini_serial.h
+++ b/include/asm-ppc/gemini_serial.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASMPPC_GEMINI_SERIAL_H
#define __ASMPPC_GEMINI_SERIAL_H
@@ -37,3 +38,4 @@
PU32_SERIAL_PORT_DEFNS
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
index f7c12df77..8a270c8c1 100644
--- a/include/asm-ppc/hardirq.h
+++ b/include/asm-ppc/hardirq.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASM_HARDIRQ_H
#define __ASM_HARDIRQ_H
@@ -99,3 +100,4 @@ extern void synchronize_irq(void);
#endif /* CONFIG_SMP */
#endif /* __ASM_HARDIRQ_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
index 428a59d1c..38114e564 100644
--- a/include/asm-ppc/highmem.h
+++ b/include/asm-ppc/highmem.h
@@ -49,19 +49,19 @@ extern void kmap_init(void) __init;
#define KMAP_FIX_BEGIN (0xfe400000UL)
-extern unsigned long kmap_high(struct page *page);
+extern void *kmap_high(struct page *page);
extern void kunmap_high(struct page *page);
-extern inline unsigned long kmap(struct page *page)
+static inline void *kmap(struct page *page)
{
if (in_interrupt())
BUG();
if (page < highmem_start_page)
- return (unsigned long) page_address(page);
+ return page_address(page);
return kmap_high(page);
}
-extern inline void kunmap(struct page *page)
+static inline void kunmap(struct page *page)
{
if (in_interrupt())
BUG();
@@ -76,13 +76,13 @@ extern inline void kunmap(struct page *page)
* be used in IRQ contexts, so in some (very limited) cases we need
* it.
*/
-extern inline unsigned long kmap_atomic(struct page *page, enum km_type type)
+static inline void *kmap_atomic(struct page *page, enum km_type type)
{
unsigned int idx;
unsigned long vaddr;
if (page < highmem_start_page)
- return (unsigned long) page_address(page);
+ return page_address(page);
idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
@@ -93,12 +93,13 @@ extern inline unsigned long kmap_atomic(struct page *page, enum km_type type)
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
flush_hash_page(0, vaddr);
- return vaddr;
+ return (void*) vaddr;
}
-extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type)
+static inline void kunmap_atomic(void *kvaddr, enum km_type type)
{
#if HIGHMEM_DEBUG
+ unsigned long vaddr = (unsigned long) kvaddr;
unsigned int idx = type + KM_TYPE_NR*smp_processor_id();
if (vaddr < KMAP_FIX_BEGIN) // FIXME
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h
index 28a47906c..7d4790171 100644
--- a/include/asm-ppc/hw_irq.h
+++ b/include/asm-ppc/hw_irq.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
*/
+#ifdef __KERNEL__
#ifndef _PPC_HW_IRQ_H
#define _PPC_HW_IRQ_H
@@ -40,3 +41,4 @@ extern atomic_t ppc_n_lost_interrupts;
#define mask_and_ack_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->ack) irq_desc[irq].handler->ack(irq);})
#endif /* _PPC_HW_IRQ_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index 8b50f862b..179bdec67 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -10,6 +10,8 @@
#ifndef __ASMPPC_IDE_H
#define __ASMPPC_IDE_H
+#ifdef __KERNEL__
+
#include <linux/sched.h>
#include <asm/processor.h>
@@ -19,8 +21,6 @@
#include <asm/hdreg.h>
-#ifdef __KERNEL__
-
#include <linux/config.h>
#include <linux/hdreg.h>
#include <linux/ioport.h>
diff --git a/include/asm-ppc/immap_8260.h b/include/asm-ppc/immap_8260.h
index 298276363..32eb50b8c 100644
--- a/include/asm-ppc/immap_8260.h
+++ b/include/asm-ppc/immap_8260.h
@@ -7,6 +7,7 @@
* this will be, as I don't have any knowledge of the subsequent
* parts at this time. I copied this from the 8xx_immap.h.
*/
+#ifdef __KERNEL__
#ifndef __IMMAP_82XX__
#define __IMMAP_82XX__
@@ -433,3 +434,4 @@ typedef struct immap {
immap_t *immr;
#endif /* __IMMAP_82XX__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/init.h b/include/asm-ppc/init.h
index 00a1c79cc..d4976d863 100644
--- a/include/asm-ppc/init.h
+++ b/include/asm-ppc/init.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_INIT_H
#define _PPC_INIT_H
@@ -35,3 +36,4 @@
__argopenfirmware
#endif /* _PPC_INIT_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 45b2531a3..03f9db09a 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_IO_H
#define _PPC_IO_H
@@ -92,7 +93,7 @@ extern __inline__ unsigned int name(unsigned int port) \
"3: li %0,-1\n" \
" b 2b\n" \
".previous\n" \
- ".section __ex_table,\"ax\"\n" \
+ ".section __ex_table,\"a\"\n" \
" .align 2\n" \
" .long 1b,3b\n" \
".previous" \
@@ -108,7 +109,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \
op " %0,0,%1\n" \
"1: sync\n" \
"2:\n" \
- ".section __ex_table,\"ax\"\n" \
+ ".section __ex_table,\"a\"\n" \
" .align 2\n" \
" .long 1b,2b\n" \
".previous" \
@@ -347,7 +348,6 @@ extern inline void out_be32(volatile unsigned *addr, int val)
__asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
}
-#ifdef __KERNEL__
static inline int check_signature(unsigned long io_addr,
const unsigned char *signature, int length)
{
@@ -370,6 +370,5 @@ out:
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)
-#endif /* __KERNEL__ */
-
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ipcbuf.h b/include/asm-ppc/ipcbuf.h
index 98c75e646..fab6752c7 100644
--- a/include/asm-ppc/ipcbuf.h
+++ b/include/asm-ppc/ipcbuf.h
@@ -2,10 +2,28 @@
#define __PPC_IPCBUF_H__
/*
- * The ipc64_perm structure for the PPC is identical to kern_ipc_perm
- * as we have always had 32-bit UIDs and GIDs in the kernel.
+ * The ipc64_perm structure for PPC architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 1 32-bit value to fill up for 8-byte alignment
+ * - 2 miscellaneous 64-bit values (so that this structure matches
+ * PPC64 ipc64_perm)
*/
-#define ipc64_perm kern_ipc_perm
+struct ipc64_perm
+{
+ __kernel_key_t key;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_uid_t cuid;
+ __kernel_gid_t cgid;
+ __kernel_mode_t mode;
+ unsigned long seq;
+ unsigned int __pad2;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
+};
#endif /* __PPC_IPCBUF_H__ */
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index 86647a0e6..c3ae15763 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -1,8 +1,8 @@
-#include <linux/config.h>
-
+#ifdef __KERNEL__
#ifndef _ASM_IRQ_H
#define _ASM_IRQ_H
+#include <linux/config.h>
#include <asm/machdep.h> /* ppc_md */
extern void disable_irq(unsigned int);
@@ -217,3 +217,4 @@ static __inline__ int irq_cannonicalize(int irq)
extern unsigned int ppc_lost_interrupts[NR_MASK_WORDS];
#endif /* _ASM_IRQ_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kgdb.h b/include/asm-ppc/kgdb.h
index 51c868b36..7337be058 100644
--- a/include/asm-ppc/kgdb.h
+++ b/include/asm-ppc/kgdb.h
@@ -6,6 +6,7 @@
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
+#ifdef __KERNEL__
#ifndef _PPC_KGDB_H
#define _PPC_KGDB_H
@@ -46,3 +47,4 @@ extern char getDebugChar(void); /* read and return a single char */
#endif /* !(__ASSEMBLY__) */
#endif /* !(_PPC_KGDB_H) */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h
index d92d81b20..a1483ed3b 100644
--- a/include/asm-ppc/kmap_types.h
+++ b/include/asm-ppc/kmap_types.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _ASM_KMAP_TYPES_H
#define _ASM_KMAP_TYPES_H
@@ -8,3 +9,4 @@ enum km_type {
};
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/linux_logo.h b/include/asm-ppc/linux_logo.h
index 33ad40f64..c35e6db5b 100644
--- a/include/asm-ppc/linux_logo.h
+++ b/include/asm-ppc/linux_logo.h
@@ -10,6 +10,7 @@
* values have to start from 0x20
* (i.e. linux_logo_{red,green,blue}[0] is color 0x20)
*/
+#ifdef __KERNEL__
#include <linux/init.h>
@@ -39,3 +40,4 @@ extern unsigned char linux_logo16_blue[];
extern unsigned char linux_logo16[];
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 709827f29..67111965f 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -1,4 +1,4 @@
-
+#ifdef __KERNEL__
#ifndef _PPC_MACHDEP_H
#define _PPC_MACHDEP_H
@@ -101,3 +101,4 @@ typedef enum sys_ctrler_kind {
extern sys_ctrler_t sys_ctrler;
#endif /* _PPC_MACHDEP_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mbx.h b/include/asm-ppc/mbx.h
index 6c84b8955..a3e8f9b32 100644
--- a/include/asm-ppc/mbx.h
+++ b/include/asm-ppc/mbx.h
@@ -1,4 +1,3 @@
-
/*
* A collection of structures, addresses, and values associated with
* the Motorola MBX boards. This was originally created for the
@@ -8,6 +7,7 @@
*
* Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
*/
+#ifdef __KERNEL__
#ifndef __MACH_MBX_DEFS
#define __MACH_MBX_DEFS
@@ -87,3 +87,4 @@ typedef struct bd_info {
*/
#define _MACH_8xx (_MACH_mbx)
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mc146818rtc.h b/include/asm-ppc/mc146818rtc.h
index f7a479fff..227018b2f 100644
--- a/include/asm-ppc/mc146818rtc.h
+++ b/include/asm-ppc/mc146818rtc.h
@@ -1,6 +1,7 @@
/*
* Machine dependent access functions for RTC registers.
*/
+#ifdef __KERNEL__
#ifndef __ASM_PPC_MC146818RTC_H
#define __ASM_PPC_MC146818RTC_H
@@ -27,3 +28,4 @@ outb_p((val),RTC_PORT(1)); \
#define RTC_IRQ 8
#endif /* __ASM_PPC_MC146818RTC_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/md.h b/include/asm-ppc/md.h
index 0ff3e7e92..79c3a22c6 100644
--- a/include/asm-ppc/md.h
+++ b/include/asm-ppc/md.h
@@ -3,6 +3,7 @@
*
*/
+#ifdef __KERNEL__
#ifndef __ASM_MD_H
#define __ASM_MD_H
@@ -11,3 +12,4 @@
#define MD_XORBLOCK_ALIGNMENT sizeof(long)
#endif /* __ASM_MD_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mediabay.h b/include/asm-ppc/mediabay.h
index a634d7f20..963555776 100644
--- a/include/asm-ppc/mediabay.h
+++ b/include/asm-ppc/mediabay.h
@@ -7,13 +7,13 @@
#ifndef _PPC_MEDIABAY_H
#define _PPC_MEDIABAY_H
+#ifdef __KERNEL__
+
#define MB_FD 0 /* media bay contains floppy drive */
#define MB_FD1 1 /* media bay contains floppy drive */
#define MB_CD 3 /* media bay contains ATA drive such as CD */
#define MB_NO 7 /* media bay contains nothing */
-#ifdef __KERNEL__
-
void media_bay_init(void);
int check_media_bay(struct device_node *which_bay, int what);
int check_media_bay_by_base(unsigned long base, int what);
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 4a3a42f26..2fe5cfe71 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -2,6 +2,7 @@
* PowerPC memory management structures
*/
+#ifdef __KERNEL__
#ifndef _PPC_MMU_H_
#define _PPC_MMU_H_
@@ -363,3 +364,4 @@ extern void _tlbia(void); /* invalidate all TLB entries */
#define TLB_G 0x00000001 /* Memory is guarded from prefetch */
#endif /* _PPC_MMU_H_ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 414dd1cdc..fed474d14 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -1,5 +1,6 @@
#include <linux/config.h>
+#ifdef __KERNEL__
#ifndef __PPC_MMU_CONTEXT_H
#define __PPC_MMU_CONTEXT_H
@@ -112,3 +113,4 @@ static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm
((segment < 8) ? ((segment) | (context)<<4) : (segment))
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/module.h b/include/asm-ppc/module.h
new file mode 100644
index 000000000..77133a1cf
--- /dev/null
+++ b/include/asm-ppc/module.h
@@ -0,0 +1,11 @@
+#ifndef _ASM_PPC_MODULE_H
+#define _ASM_PPC_MODULE_H
+/*
+ * This file contains the PPC architecture specific module code.
+ */
+
+#define module_map(x) vmalloc(x)
+#define module_unmap(x) vfree(x)
+#define module_arch_init(x) (0)
+
+#endif /* _ASM_PPC_MODULE_H */
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index 10d586cad..94a054b57 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -5,6 +5,7 @@
* file that has to include MPC8260 configuration, they all include
* this one and the configuration switching is done here.
*/
+#ifdef __KERNEL__
#ifndef __CONFIG_8260_DEFS
#define __CONFIG_8260_DEFS
@@ -40,3 +41,4 @@ extern int request_8xxirq(unsigned int irq,
#endif /* CONFIG_8260 */
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index db327b76a..2476f7540 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -5,6 +5,7 @@
* file that has to include MPC8xx configuration, they all include
* this one and the configuration switching is done here.
*/
+#ifdef __KERNEL__
#ifndef __CONFIG_8xx_DEFS
#define __CONFIG_8xx_DEFS
@@ -79,3 +80,4 @@ extern int request_8xxirq(unsigned int irq,
void *dev_id);
#endif /* CONFIG_8xx */
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/msgbuf.h b/include/asm-ppc/msgbuf.h
index ebfb950a2..3432b9b36 100644
--- a/include/asm-ppc/msgbuf.h
+++ b/include/asm-ppc/msgbuf.h
@@ -7,7 +7,6 @@
struct msqid64_ds {
struct ipc64_perm msg_perm;
- unsigned int __unused0;
unsigned int __unused1;
__kernel_time_t msg_stime; /* last msgsnd time */
unsigned int __unused2;
diff --git a/include/asm-ppc/namei.h b/include/asm-ppc/namei.h
index cd871903d..0bd54a034 100644
--- a/include/asm-ppc/namei.h
+++ b/include/asm-ppc/namei.h
@@ -5,6 +5,7 @@
* Included from linux/fs/namei.c
*/
+#ifdef __KERNEL__
#ifndef __PPC_NAMEI_H
#define __PPC_NAMEI_H
@@ -16,3 +17,4 @@
#define __emul_prefix() NULL
#endif /* __PPC_NAMEI_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h
index 144d518b9..7f6fc08b1 100644
--- a/include/asm-ppc/nvram.h
+++ b/include/asm-ppc/nvram.h
@@ -2,6 +2,7 @@
* PreP compliant NVRAM access
*/
+#ifdef __KERNEL__
#ifndef _PPC_NVRAM_H
#define _PPC_NVRAM_H
@@ -64,3 +65,4 @@ struct pmac_machine_location {
#define PMAC_NVRAM_GET_OFFSET _IOWR('p', 0x40, int) /* Get NVRAM partition offset */
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/oak.h b/include/asm-ppc/oak.h
index c906f5c4d..63f316401 100644
--- a/include/asm-ppc/oak.h
+++ b/include/asm-ppc/oak.h
@@ -11,6 +11,7 @@
*
*/
+#ifdef __KERNEL__
#ifndef __OAK_H__
#define __OAK_H__
@@ -66,3 +67,4 @@ typedef struct board_info {
#endif
#endif /* __OAK_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index dee0ced3a..d4c104f8d 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -1,8 +1,3 @@
-#include <linux/config.h>
-#ifndef __ASSEMBLY__
-#include <asm/system.h> /* for xmon definition */
-#endif /* ndef __ASSEMBLY__ */
-
#ifndef _PPC_PAGE_H
#define _PPC_PAGE_H
@@ -11,11 +6,14 @@
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
+#ifdef __KERNEL__
+#include <linux/config.h>
+
#define PAGE_OFFSET 0xc0000000
#define KERNELBASE PAGE_OFFSET
#ifndef __ASSEMBLY__
-#ifdef __KERNEL__
+#include <asm/system.h> /* for xmon definition */
#ifdef CONFIG_XMON
#define BUG() do { \
@@ -134,6 +132,6 @@ extern __inline__ int get_order(unsigned long size)
return order;
}
-#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
#endif /* _PPC_PAGE_H */
diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h
index 93d6fc52c..923a3fe60 100644
--- a/include/asm-ppc/param.h
+++ b/include/asm-ppc/param.h
@@ -20,4 +20,8 @@
#define MAXHOSTNAMELEN 64 /* max length of hostname */
+#ifdef __KERNEL__
+# define CLOCKS_PER_SEC 100 /* frequency at which times() counts */
+#endif
+
#endif
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index 5aa72d3a2..9e5385e51 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _ASM_PCI_BRIDGE_H
#define _ASM_PCI_BRIDGE_H
@@ -46,3 +47,4 @@ struct bridge_data {
};
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index a9da1b195..1a661f050 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -1,12 +1,12 @@
#ifndef __PPC_PCI_H
#define __PPC_PCI_H
+#ifdef __KERNEL__
/* Values for the `which' argument to sys_pciconfig_iobase syscall. */
#define IOBASE_BRIDGE_NUMBER 0
#define IOBASE_MEMORY 1
#define IOBASE_IO 2
-#ifdef __KERNEL__
/* Can be used to override the logic in pci_scan_bus for skipping
* already-configured bus numbers - to be used for buggy BIOSes
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h
index 6166a1bfb..7da57a6f2 100644
--- a/include/asm-ppc/pgalloc.h
+++ b/include/asm-ppc/pgalloc.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_PGALLOC_H
#define _PPC_PGALLOC_H
@@ -51,33 +52,6 @@ extern unsigned long get_zero_page_fast(void);
extern void __bad_pte(pmd_t *pmd);
-extern inline void set_pgdir(unsigned long address, pgd_t entry)
-{
- struct task_struct * p;
- pgd_t *pgd;
-#ifdef CONFIG_SMP
- int i;
-#endif
-
- read_lock(&tasklist_lock);
- for_each_task(p) {
- if (!p->mm)
- continue;
- *pgd_offset(p->mm,address) = entry;
- }
- read_unlock(&tasklist_lock);
-#ifndef CONFIG_SMP
- for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd)
- pgd[address >> PGDIR_SHIFT] = entry;
-#else
- /* To pgd_alloc/pgd_free, one holds master kernel lock and so does our callee, so we can
- modify pgd caches of other CPUs as well. -jj */
- for (i = 0; i < NR_CPUS; i++)
- for (pgd = (pgd_t *)cpu_data[i].pgd_cache; pgd; pgd = (pgd_t *)*(unsigned long *)pgd)
- pgd[address >> PGDIR_SHIFT] = entry;
-#endif
-}
-
/* We don't use pmd cache, so this is a dummy routine */
extern __inline__ pmd_t *get_pmd_fast(void)
{
@@ -200,3 +174,4 @@ extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address)
extern int do_check_pgt_cache(int, int);
#endif /* _PPC_PGALLOC_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 27c89e13e..0f4579cd7 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_PGTABLE_H
#define _PPC_PGTABLE_H
@@ -451,9 +452,6 @@ extern void flush_hash_page(unsigned context, unsigned long va);
#define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define swp_entry_to_pte(x) ((pte_t) { (x).val })
-#define module_map vmalloc
-#define module_unmap vfree
-
/* CONFIG_APUS */
/* For virtual address to physical address conversion */
extern void cache_clear(__u32 addr, int length);
@@ -492,3 +490,4 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size,
#endif __ASSEMBLY__
#endif /* _PPC_PGTABLE_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/pnp.h b/include/asm-ppc/pnp.h
index 15335ff35..6f6760b30 100644
--- a/include/asm-ppc/pnp.h
+++ b/include/asm-ppc/pnp.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
/* 11/02/95 */
/*----------------------------------------------------------------------------*/
/* Plug and Play header definitions */
@@ -641,3 +642,4 @@ typedef union _PnP_TAG_PACKET {
#endif /* __ASSEMBLY__ */
#endif /* ndef _PNP_ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/prep_nvram.h b/include/asm-ppc/prep_nvram.h
index 2f0f80b5c..82ec21508 100644
--- a/include/asm-ppc/prep_nvram.h
+++ b/include/asm-ppc/prep_nvram.h
@@ -17,6 +17,7 @@
For enum's: if given in hex then they are bit significant, i.e. only
one bit is on for each enum.
*/
+#ifdef __KERNEL__
#ifndef _PPC_PREP_NVRAM_H
#define _PPC_PREP_NVRAM_H
@@ -144,3 +145,4 @@ void prep_nvram_write_val(int addr,
unsigned char val);
#endif /* _PPC_PREP_NVRAM_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index f99eb4abe..cfd49807e 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASM_PPC_PROCESSOR_H
#define __ASM_PPC_PROCESSOR_H
@@ -727,3 +728,4 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
#endif /* CONFIG_MACH_SPECIFIC */
#endif /* __ASM_PPC_PROCESSOR_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index dc98c596d..0c57690ea 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -4,6 +4,7 @@
*
* Copyright (C) 1996 Paul Mackerras.
*/
+#ifdef __KERNEL__
#ifndef _PPC_PROM_H
#define _PPC_PROM_H
@@ -98,3 +99,4 @@ extern void map_bootx_text(void);
#endif /* _PPC_PROM_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h
index 93a75bd87..b154187e6 100644
--- a/include/asm-ppc/ptrace.h
+++ b/include/asm-ppc/ptrace.h
@@ -17,32 +17,26 @@
* the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c.
*/
-#include <linux/config.h>
-
#ifndef __ASSEMBLY__
-#ifdef CONFIG_PPC64BRIDGE
-#define PPC_REG unsigned long /*long*/
-#else
-#define PPC_REG unsigned long
-#endif
struct pt_regs {
- PPC_REG gpr[32];
- PPC_REG nip;
- PPC_REG msr;
- PPC_REG orig_gpr3; /* Used for restarting system calls */
- PPC_REG ctr;
- PPC_REG link;
- PPC_REG xer;
- PPC_REG ccr;
- PPC_REG mq; /* 601 only (not used at present) */
- /* Used on APUS to hold IPL value. */
- PPC_REG trap; /* Reason for being here */
- PPC_REG dar; /* Fault registers */
- PPC_REG dsisr;
- PPC_REG result; /* Result of a system call */
+ unsigned long gpr[32];
+ unsigned long nip;
+ unsigned long msr;
+ unsigned long orig_gpr3; /* Used for restarting system calls */
+ unsigned long ctr;
+ unsigned long link;
+ unsigned long xer;
+ unsigned long ccr;
+ unsigned long mq; /* 601 only (not used at present) */
+ /* Used on APUS to hold IPL value. */
+ unsigned long trap; /* Reason for being here */
+ unsigned long dar; /* Fault registers */
+ unsigned long dsisr;
+ unsigned long result; /* Result of a system call */
};
#endif
+#ifdef __KERNEL__
#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
/* Size of stack frame allocated when calling signal handler. */
@@ -51,6 +45,8 @@ struct pt_regs {
#define instruction_pointer(regs) ((regs)->nip)
#define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
+#endif /* __KERNEL__ */
+
/*
* Offsets used by 'ptrace' system call interface.
* These can't be changed without breaking binary compatibility
diff --git a/include/asm-ppc/raven.h b/include/asm-ppc/raven.h
index 62f996f66..ee873ff82 100644
--- a/include/asm-ppc/raven.h
+++ b/include/asm-ppc/raven.h
@@ -8,6 +8,7 @@
* for more details.
*/
+#ifdef __KERNEL__
#ifndef _ASMPPC_RAVEN_H
#define _ASMPPC_RAVEN_H
@@ -31,3 +32,4 @@ extern struct hw_interrupt_type raven_pic;
extern int raven_init(void);
#endif _ASMPPC_RAVEN_H
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/residual.h b/include/asm-ppc/residual.h
index c037a4e4a..685c04502 100644
--- a/include/asm-ppc/residual.h
+++ b/include/asm-ppc/residual.h
@@ -10,6 +10,7 @@
/* i.e. only one bit is on for each enum */
/* Reserved fields must be filled with zeros. */
+#ifdef __KERNEL__
#ifndef _RESIDUAL_
#define _RESIDUAL_
@@ -330,3 +331,4 @@ extern PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p,
#endif /* __ASSEMBLY__ */
#endif /* ndef _RESIDUAL_ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/rpxclassic.h b/include/asm-ppc/rpxclassic.h
index b84a20d12..0583b60fb 100644
--- a/include/asm-ppc/rpxclassic.h
+++ b/include/asm-ppc/rpxclassic.h
@@ -5,6 +5,7 @@
*
* Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
*/
+#ifdef __KERNEL__
#ifndef __MACH_RPX_DEFS
#define __MACH_RPX_DEFS
@@ -82,3 +83,4 @@ extern bd_t m8xx_board_info;
#define _MACH_8xx (_MACH_classic)
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/rpxlite.h b/include/asm-ppc/rpxlite.h
index c0cc7e0a6..1d447082b 100644
--- a/include/asm-ppc/rpxlite.h
+++ b/include/asm-ppc/rpxlite.h
@@ -5,6 +5,7 @@
*
* Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
*/
+#ifdef __KERNEL__
#ifndef __MACH_RPX_DEFS
#define __MACH_RPX_DEFS
@@ -65,3 +66,4 @@ extern bd_t m8xx_board_info;
#define _MACH_8xx (_MACH_rpxlite)
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h
index f81590716..5c6b01c99 100644
--- a/include/asm-ppc/scatterlist.h
+++ b/include/asm-ppc/scatterlist.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_SCATTERLIST_H
#define _PPC_SCATTERLIST_H
@@ -12,3 +13,4 @@ struct scatterlist {
#endif /* !(_PPC_SCATTERLIST_H) */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/semaphore-helper.h b/include/asm-ppc/semaphore-helper.h
index 3033272d9..14f2c0e2e 100644
--- a/include/asm-ppc/semaphore-helper.h
+++ b/include/asm-ppc/semaphore-helper.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_SEMAPHORE_HELPER_H
#define _PPC_SEMAPHORE_HELPER_H
@@ -105,3 +106,4 @@ static inline int waking_non_zero_trylock(struct semaphore *sem)
}
#endif /* _PPC_SEMAPHORE_HELPER_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/sembuf.h b/include/asm-ppc/sembuf.h
index 6b6a182a8..d0ab55833 100644
--- a/include/asm-ppc/sembuf.h
+++ b/include/asm-ppc/sembuf.h
@@ -7,7 +7,6 @@
struct semid64_ds {
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
- unsigned int __unused0;
unsigned int __unused1;
__kernel_time_t sem_otime; /* last semop time */
unsigned int __unused2;
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index b6b89dc79..60c1a14ff 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -2,6 +2,7 @@
* include/asm-ppc/serial.h
*/
+#ifdef __KERNEL__
#include <linux/config.h>
#ifdef CONFIG_GEMINI
@@ -127,3 +128,4 @@
MCA_SERIAL_PORT_DFNS
#endif /* CONFIG_GEMINI */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
index 2f9164160..cd458c4f1 100644
--- a/include/asm-ppc/setup.h
+++ b/include/asm-ppc/setup.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_SETUP_H
#define _PPC_SETUP_H
@@ -7,3 +8,4 @@
#include <asm-m68k/setup.h>
#endif /* _PPC_SETUP_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/shmbuf.h b/include/asm-ppc/shmbuf.h
index df84f0b09..ec614e8c6 100644
--- a/include/asm-ppc/shmbuf.h
+++ b/include/asm-ppc/shmbuf.h
@@ -7,19 +7,19 @@
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
- unsigned int __unused0;
- size_t shm_segsz; /* size of segment (bytes) */
- unsigned long __unused1;
+ unsigned int __unused1;
__kernel_time_t shm_atime; /* last attach time */
- unsigned long __unused2;
+ unsigned int __unused2;
__kernel_time_t shm_dtime; /* last detach time */
- unsigned long __unused3;
+ unsigned int __unused3;
__kernel_time_t shm_ctime; /* last change time */
+ unsigned int __unused4;
+ size_t shm_segsz; /* size of segment (bytes) */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned long shm_nattch; /* no. of current attaches */
- unsigned long __unused4;
unsigned long __unused5;
+ unsigned long __unused6;
};
struct shminfo64 {
diff --git a/include/asm-ppc/siginfo.h b/include/asm-ppc/siginfo.h
index 3b0bd261d..74a16e0b2 100644
--- a/include/asm-ppc/siginfo.h
+++ b/include/asm-ppc/siginfo.h
@@ -3,8 +3,6 @@
/* Copied from i386 from alpha. */
-#include <linux/types.h>
-
typedef union sigval {
int sival_int;
void *sival_ptr;
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index f5025a161..4958b3f35 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -1,7 +1,9 @@
#ifndef _ASMPPC_SIGNAL_H
#define _ASMPPC_SIGNAL_H
+#ifdef __KERNEL__
#include <linux/types.h>
+#endif /* __KERNEL__ */
/* Avoid too many header ordering problems. */
struct siginfo;
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index abbd0ca0c..4851e13fd 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -3,6 +3,7 @@
* Taken from asm-sparc/smp.h
*/
+#ifdef __KERNEL__
#ifndef _PPC_SMP_H
#define _PPC_SMP_H
@@ -59,3 +60,4 @@ extern struct klock_info_struct klock_info;
#endif /* !(CONFIG_SMP) */
#endif /* !(_PPC_SMP_H) */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/smplock.h b/include/asm-ppc/smplock.h
index 96565069c..5fdd5733b 100644
--- a/include/asm-ppc/smplock.h
+++ b/include/asm-ppc/smplock.h
@@ -3,6 +3,7 @@
*
* Default SMP lock implementation
*/
+#ifdef __KERNEL__
#include <linux/interrupt.h>
#include <linux/spinlock.h>
@@ -49,3 +50,4 @@ extern __inline__ void unlock_kernel(void)
if (--current->lock_depth < 0)
spin_unlock(&kernel_flag);
}
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/softirq.h b/include/asm-ppc/softirq.h
index 4eaed0be6..20898d818 100644
--- a/include/asm-ppc/softirq.h
+++ b/include/asm-ppc/softirq.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
@@ -10,3 +11,4 @@
#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* __ASM_SOFTIRQ_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 292406736..eae7df4a5 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __ASM_SPINLOCK_H
#define __ASM_SPINLOCK_H
@@ -54,3 +55,4 @@ extern void _write_unlock(rwlock_t *rw);
#define read_unlock(rw) _read_unlock(rw)
#endif /* __ASM_SPINLOCK_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/stat.h b/include/asm-ppc/stat.h
index 204b07e6e..ed382adc8 100644
--- a/include/asm-ppc/stat.h
+++ b/include/asm-ppc/stat.h
@@ -1,7 +1,9 @@
#ifndef _PPC_STAT_H
#define _PPC_STAT_H
+#ifdef __KERNEL__
#include <linux/types.h>
+#endif /* __KERNEL__ */
struct __old_kernel_stat {
unsigned short st_dev;
diff --git a/include/asm-ppc/string.h b/include/asm-ppc/string.h
index d912a6b5f..557e3ad0e 100644
--- a/include/asm-ppc/string.h
+++ b/include/asm-ppc/string.h
@@ -1,6 +1,8 @@
#ifndef _PPC_STRING_H_
#define _PPC_STRING_H_
+#ifdef __KERNEL__
+
#define __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRNCPY
#define __HAVE_ARCH_STRLEN
@@ -26,4 +28,6 @@ extern void * memmove(void *,const void *,__kernel_size_t);
extern int memcmp(const void *,const void *,__kernel_size_t);
extern void * memchr(const void *,int,__kernel_size_t);
+#endif /* __KERNEL__ */
+
#endif
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 523a427a0..571d2c81f 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
*/
+#ifdef __KERNEL__
#ifndef __PPC_SYSTEM_H
#define __PPC_SYSTEM_H
@@ -224,3 +225,4 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
})
#endif /* __PPC_SYSTEM_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h
index 324b62600..52e6d2d52 100644
--- a/include/asm-ppc/termbits.h
+++ b/include/asm-ppc/termbits.h
@@ -1,8 +1,6 @@
#ifndef _PPC_TERMBITS_H
#define _PPC_TERMBITS_H
-#include <linux/posix_types.h>
-
typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index 1eb0ae9f0..8f43219a8 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -6,6 +6,7 @@
* Paul Mackerras' version and mine for PReP and Pmac.
*/
+#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/mc146818rtc.h>
@@ -113,3 +114,4 @@ extern __inline__ unsigned binary_tbl(void) {
({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
unsigned mulhwu_scale_factor(unsigned, unsigned);
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h
index df7a8749d..485ad0053 100644
--- a/include/asm-ppc/timex.h
+++ b/include/asm-ppc/timex.h
@@ -3,6 +3,7 @@
*
* ppc architecture timex specifications
*/
+#ifdef __KERNEL__
#ifndef _ASMppc_TIMEX_H
#define _ASMppc_TIMEX_H
@@ -39,3 +40,4 @@ static inline cycles_t get_cycles(void)
}
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/tqm860.h b/include/asm-ppc/tqm860.h
index a42b7b277..733dcccdb 100644
--- a/include/asm-ppc/tqm860.h
+++ b/include/asm-ppc/tqm860.h
@@ -10,6 +10,7 @@
*
* Copyright (c) 1999 Wolfgang Denk (wd@denx.de)
*/
+#ifdef __KERNEL__
#ifndef __MACH_TQM860_DEFS
#define __MACH_TQM860_DEFS
@@ -63,3 +64,4 @@ typedef struct bd_info {
#endif /* __MACH_TQM860_DEFS */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/tqm8xxL.h b/include/asm-ppc/tqm8xxL.h
index e51e98080..338396aa6 100644
--- a/include/asm-ppc/tqm8xxL.h
+++ b/include/asm-ppc/tqm8xxL.h
@@ -10,6 +10,7 @@
*
* Copyright (c) 1999 Wolfgang Denk (wd@denx.de)
*/
+#ifdef __KERNEL__
#ifndef __MACH_TQM8xxL_DEFS
#define __MACH_TQM8xxL_DEFS
@@ -64,3 +65,4 @@ typedef struct bd_info {
#endif /* __MACH_TQM8xxL_DEFS */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
index 4ebbb9e02..6734fa276 100644
--- a/include/asm-ppc/types.h
+++ b/include/asm-ppc/types.h
@@ -3,8 +3,6 @@
#ifndef __ASSEMBLY__
-typedef unsigned short umode_t;
-
typedef __signed__ char __s8;
typedef unsigned char __u8;
@@ -21,7 +19,7 @@ typedef unsigned long long __u64;
typedef struct {
__u32 u[4];
-} __attribute((aligned(16))) vector128;
+} __attribute((aligned(16))) __vector128;
#ifdef __KERNEL__
/*
@@ -39,11 +37,15 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+typedef __vector128 vector128;
+
#define BITS_PER_LONG 32
/* DMA addresses are 32-bits wide */
typedef u32 dma_addr_t;
+typedef unsigned short umode_t;
+
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index 628373b15..cd87905b0 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_UACCESS_H
#define _PPC_UACCESS_H
@@ -274,3 +275,4 @@ extern __inline__ int strnlen_user(const char *str, long len)
#endif /* __ASSEMBLY__ */
#endif /* _PPC_UACCESS_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/unaligned.h b/include/asm-ppc/unaligned.h
index 90a54eae9..797ffd6e4 100644
--- a/include/asm-ppc/unaligned.h
+++ b/include/asm-ppc/unaligned.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef __PPC_UNALIGNED_H
#define __PPC_UNALIGNED_H
@@ -14,3 +15,4 @@
#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h
index eefe4389c..b21cc8931 100644
--- a/include/asm-ppc/uninorth.h
+++ b/include/asm-ppc/uninorth.h
@@ -3,6 +3,7 @@
* from Apple. This chip is used on "Core99" machines
*
*/
+#ifdef __KERNEL__
/*
@@ -79,5 +80,4 @@
*/
#define UNI_N_HWINIT_STATE_CPU1_FLAG 0x10000000
-
-
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/user.h b/include/asm-ppc/user.h
index e3bd611b3..d662b2151 100644
--- a/include/asm-ppc/user.h
+++ b/include/asm-ppc/user.h
@@ -1,3 +1,4 @@
+#ifdef __KERNEL__
#ifndef _PPC_USER_H
#define _PPC_USER_H
@@ -50,3 +51,4 @@ struct user {
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
#endif /* _PPC_USER_H */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/vga.h b/include/asm-ppc/vga.h
index 69e3d7f9a..c5864734e 100644
--- a/include/asm-ppc/vga.h
+++ b/include/asm-ppc/vga.h
@@ -4,6 +4,7 @@
* (c) 1998 Martin Mares <mj@ucw.cz>
*/
+#ifdef __KERNEL__
#ifndef _LINUX_ASM_VGA_H_
#define _LINUX_ASM_VGA_H_
@@ -42,3 +43,4 @@ extern unsigned long vgacon_remap_base;
#define vga_writeb(x,y) (*(y) = (x))
#endif
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/walnut.h b/include/asm-ppc/walnut.h
index 84499af8a..45a92bbb3 100644
--- a/include/asm-ppc/walnut.h
+++ b/include/asm-ppc/walnut.h
@@ -11,6 +11,7 @@
*
*/
+#ifdef __KERNEL__
#ifndef __WALNUT_H__
#define __WALNUT_H__
@@ -26,3 +27,4 @@ extern "C" {
#endif
#endif /* __WALNUT_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/xor.h b/include/asm-ppc/xor.h
new file mode 100644
index 000000000..c82eb12a5
--- /dev/null
+++ b/include/asm-ppc/xor.h
@@ -0,0 +1 @@
+#include <asm-generic/xor.h>