aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Kbuild1
-rw-r--r--include/asm-alpha/elf.h1
-rw-r--r--include/asm-alpha/floppy.h2
-rw-r--r--include/asm-alpha/io.h6
-rw-r--r--include/asm-alpha/semaphore.h1
-rw-r--r--include/asm-alpha/system.h1
-rw-r--r--include/asm-arm/floppy.h2
-rw-r--r--include/asm-arm/ipc.h1
-rw-r--r--include/asm-arm/semaphore.h1
-rw-r--r--include/asm-arm/types.h6
-rw-r--r--include/asm-arm26/irq_regs.h1
-rw-r--r--include/asm-avr32/io.h7
-rw-r--r--include/asm-avr32/semaphore.h1
-rw-r--r--include/asm-avr32/types.h6
-rw-r--r--include/asm-blackfin/io.h4
-rw-r--r--include/asm-blackfin/ipc.h1
-rw-r--r--include/asm-blackfin/semaphore.h1
-rw-r--r--include/asm-blackfin/types.h6
-rw-r--r--include/asm-cris/ipc.h1
-rw-r--r--include/asm-cris/irq_regs.h1
-rw-r--r--include/asm-cris/semaphore.h1
-rw-r--r--include/asm-cris/types.h6
-rw-r--r--include/asm-frv/ipc.h1
-rw-r--r--include/asm-frv/semaphore.h1
-rw-r--r--include/asm-frv/types.h6
-rw-r--r--include/asm-generic/Kbuild1
-rw-r--r--include/asm-generic/Kbuild.asm1
-rw-r--r--include/asm-generic/ipc.h31
-rw-r--r--include/asm-h8300/io.h6
-rw-r--r--include/asm-h8300/ipc.h1
-rw-r--r--include/asm-h8300/semaphore.h1
-rw-r--r--include/asm-h8300/types.h6
-rw-r--r--include/asm-ia64/elf.h1
-rw-r--r--include/asm-ia64/io.h4
-rw-r--r--include/asm-ia64/numa.h1
-rw-r--r--include/asm-ia64/semaphore.h1
-rw-r--r--include/asm-ia64/system.h2
-rw-r--r--include/asm-m32r/ipc.h1
-rw-r--r--include/asm-m32r/semaphore.h1
-rw-r--r--include/asm-m32r/types.h6
-rw-r--r--include/asm-m68k/floppy.h3
-rw-r--r--include/asm-m68k/io.h6
-rw-r--r--include/asm-m68k/ipc.h1
-rw-r--r--include/asm-m68k/semaphore.h1
-rw-r--r--include/asm-m68k/types.h6
-rw-r--r--include/asm-m68knommu/io.h6
-rw-r--r--include/asm-m68knommu/ipc.h1
-rw-r--r--include/asm-m68knommu/semaphore.h1
-rw-r--r--include/asm-mips/floppy.h2
-rw-r--r--include/asm-mips/io.h2
-rw-r--r--include/asm-mips/ipc.h1
-rw-r--r--include/asm-mips/semaphore.h1
-rw-r--r--include/asm-mips/types.h6
-rw-r--r--include/asm-parisc/floppy.h4
-rw-r--r--include/asm-parisc/io.h5
-rw-r--r--include/asm-parisc/semaphore.h1
-rw-r--r--include/asm-parisc/types.h6
-rw-r--r--include/asm-powerpc/Kbuild2
-rw-r--r--include/asm-powerpc/elf.h47
-rw-r--r--include/asm-powerpc/floppy.h2
-rw-r--r--include/asm-powerpc/io.h17
-rw-r--r--include/asm-powerpc/ipc.h1
-rw-r--r--include/asm-powerpc/semaphore.h1
-rw-r--r--include/asm-powerpc/system.h1
-rw-r--r--include/asm-powerpc/types.h6
-rw-r--r--include/asm-ppc/floppy.h2
-rw-r--r--include/asm-ppc/io.h17
-rw-r--r--include/asm-ppc/irq_regs.h1
-rw-r--r--include/asm-s390/ipc.h1
-rw-r--r--include/asm-s390/semaphore.h1
-rw-r--r--include/asm-s390/types.h6
-rw-r--r--include/asm-sh/elf.h1
-rw-r--r--include/asm-sh/floppy.h6
-rw-r--r--include/asm-sh/io.h25
-rw-r--r--include/asm-sh/ipc.h1
-rw-r--r--include/asm-sh/semaphore.h1
-rw-r--r--include/asm-sh/system.h1
-rw-r--r--include/asm-sh/types.h6
-rw-r--r--include/asm-sh64/dma-mapping.h6
-rw-r--r--include/asm-sh64/io.h48
-rw-r--r--include/asm-sh64/ipc.h1
-rw-r--r--include/asm-sh64/semaphore.h1
-rw-r--r--include/asm-sh64/types.h6
-rw-r--r--include/asm-sparc/floppy.h2
-rw-r--r--include/asm-sparc/io.h7
-rw-r--r--include/asm-sparc/ipc.h1
-rw-r--r--include/asm-sparc/semaphore.h1
-rw-r--r--include/asm-sparc64/Kbuild1
-rw-r--r--include/asm-sparc64/floppy.h4
-rw-r--r--include/asm-sparc64/io.h6
-rw-r--r--include/asm-sparc64/ipc.h1
-rw-r--r--include/asm-sparc64/semaphore.h1
-rw-r--r--include/asm-sparc64/shmparam.h2
-rw-r--r--include/asm-um/ipc.h1
-rw-r--r--include/asm-v850/ipc.h1
-rw-r--r--include/asm-v850/irq_regs.h1
-rw-r--r--include/asm-v850/semaphore.h1
-rw-r--r--include/asm-v850/types.h6
-rw-r--r--include/asm-x86/Kbuild1
-rw-r--r--include/asm-x86/bootparam.h3
-rw-r--r--include/asm-x86/bootsetup.h40
-rw-r--r--include/asm-x86/elf_32.h2
-rw-r--r--include/asm-x86/floppy_32.h4
-rw-r--r--include/asm-x86/floppy_64.h4
-rw-r--r--include/asm-x86/io_32.h11
-rw-r--r--include/asm-x86/io_64.h6
-rw-r--r--include/asm-x86/ipc.h1
-rw-r--r--include/asm-x86/pgtable_32.h2
-rw-r--r--include/asm-x86/semaphore_32.h1
-rw-r--r--include/asm-x86/semaphore_64.h1
-rw-r--r--include/asm-x86/setup_32.h29
-rw-r--r--include/asm-x86/setup_64.h13
-rw-r--r--include/asm-x86/system_32.h1
-rw-r--r--include/asm-x86/types_32.h6
-rw-r--r--include/asm-xtensa/semaphore.h1
-rw-r--r--include/asm-xtensa/types.h6
-rw-r--r--include/keys/rxrpc-type.h2
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/atmel-ssc.h312
-rw-r--r--include/linux/auxvec.h4
-rw-r--r--include/linux/backing-dev.h94
-rw-r--r--include/linux/binfmts.h9
-rw-r--r--include/linux/capability.h48
-rw-r--r--include/linux/compiler-gcc.h4
-rw-r--r--include/linux/compiler-gcc3.h4
-rw-r--r--include/linux/compiler-gcc4.h4
-rw-r--r--include/linux/compiler-intel.h4
-rw-r--r--include/linux/consolemap.h1
-rw-r--r--include/linux/cpuset.h6
-rw-r--r--include/linux/cramfs_fs.h1
-rw-r--r--include/linux/elf.h2
-rw-r--r--include/linux/elfcore-compat.h55
-rw-r--r--include/linux/ext2_fs.h23
-rw-r--r--include/linux/ext2_fs_sb.h51
-rw-r--r--include/linux/ext3_fs.h14
-rw-r--r--include/linux/ext3_fs_sb.h1
-rw-r--r--include/linux/ext4_fs_sb.h1
-rw-r--r--include/linux/fcntl.h15
-rw-r--r--include/linux/file.h9
-rw-r--r--include/linux/fs.h85
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/interrupt.h22
-rw-r--r--include/linux/ipc.h28
-rw-r--r--include/linux/kbd_diacr.h2
-rw-r--r--include/linux/kd.h10
-rw-r--r--include/linux/kernel.h35
-rw-r--r--include/linux/kexec.h33
-rw-r--r--include/linux/key-type.h112
-rw-r--r--include/linux/key.h99
-rw-r--r--include/linux/list.h12
-rw-r--r--include/linux/log2.h25
-rw-r--r--include/linux/magic.h3
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/mm_types.h7
-rw-r--r--include/linux/mmzone.h42
-rw-r--r--include/linux/module.h18
-rw-r--r--include/linux/moduleparam.h18
-rw-r--r--include/linux/mutex.h3
-rw-r--r--include/linux/namei.h4
-rw-r--r--include/linux/nbd.h2
-rw-r--r--include/linux/nls.h8
-rw-r--r--include/linux/nsproxy.h1
-rw-r--r--include/linux/oom.h26
-rw-r--r--include/linux/percpu_counter.h55
-rw-r--r--include/linux/pnp.h6
-rw-r--r--include/linux/profile.h3
-rw-r--r--include/linux/proportions.h119
-rw-r--r--include/linux/quota.h31
-rw-r--r--include/linux/raid/bitmap.h2
-rw-r--r--include/linux/rcupdate.h14
-rw-r--r--include/linux/reiserfs_fs.h7
-rw-r--r--include/linux/sched.h34
-rw-r--r--include/linux/screen_info.h9
-rw-r--r--include/linux/security.h1237
-rw-r--r--include/linux/seq_file.h2
-rw-r--r--include/linux/shm.h2
-rw-r--r--include/linux/signalfd.h32
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/slub_def.h2
-rw-r--r--include/linux/swap.h5
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/tty.h8
-rw-r--r--include/linux/ufs_fs.h179
-rw-r--r--include/linux/ufs_fs_i.h33
-rw-r--r--include/linux/ufs_fs_sb.h37
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/writeback.h13
-rw-r--r--include/scsi/Kbuild4
190 files changed, 1730 insertions, 1937 deletions
diff --git a/include/Kbuild b/include/Kbuild
index 2d03f995865f..b52288774345 100644
--- a/include/Kbuild
+++ b/include/Kbuild
@@ -1,6 +1,5 @@
1header-y += asm-generic/ 1header-y += asm-generic/
2header-y += linux/ 2header-y += linux/
3header-y += scsi/
4header-y += sound/ 3header-y += sound/
5header-y += mtd/ 4header-y += mtd/
6header-y += rdma/ 5header-y += rdma/
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index 6c2d78fba264..4b518e3b952c 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -155,6 +155,7 @@ extern int alpha_l1d_cacheshape;
155extern int alpha_l2_cacheshape; 155extern int alpha_l2_cacheshape;
156extern int alpha_l3_cacheshape; 156extern int alpha_l3_cacheshape;
157 157
158/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
158#define ARCH_DLINFO \ 159#define ARCH_DLINFO \
159 do { \ 160 do { \
160 NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \ 161 NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
index 6a9f02af9529..0be50413b2b5 100644
--- a/include/asm-alpha/floppy.h
+++ b/include/asm-alpha/floppy.h
@@ -91,8 +91,6 @@ static int FDC2 = -1;
91#define N_FDC 2 91#define N_FDC 2
92#define N_DRIVE 8 92#define N_DRIVE 8
93 93
94#define FLOPPY_MOTOR_MASK 0xf0
95
96/* 94/*
97 * Most Alphas have no problems with floppy DMA crossing 64k borders, 95 * Most Alphas have no problems with floppy DMA crossing 64k borders,
98 * except for certain ones, like XL and RUFFIAN. 96 * except for certain ones, like XL and RUFFIAN.
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index ab5b60dcef19..38f18cf18c9d 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -551,12 +551,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count);
551#endif 551#endif
552#define RTC_ALWAYS_BCD 0 552#define RTC_ALWAYS_BCD 0
553 553
554/* Nothing to do */
555
556#define dma_cache_inv(_start,_size) do { } while (0)
557#define dma_cache_wback(_start,_size) do { } while (0)
558#define dma_cache_wback_inv(_start,_size) do { } while (0)
559
560/* 554/*
561 * Some mucking forons use if[n]def writeq to check if platform has it. 555 * Some mucking forons use if[n]def writeq to check if platform has it.
562 * It's a bloody bad idea and we probably want ARCH_HAS_WRITEQ for them 556 * It's a bloody bad idea and we probably want ARCH_HAS_WRITEQ for them
diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h
index 1a6295f2c2d4..f1e9278a9fe2 100644
--- a/include/asm-alpha/semaphore.h
+++ b/include/asm-alpha/semaphore.h
@@ -30,7 +30,6 @@ struct semaphore {
30 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 30 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
31 31
32#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 32#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
33#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
34 33
35static inline void sema_init(struct semaphore *sem, int val) 34static inline void sema_init(struct semaphore *sem, int val)
36{ 35{
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index 620c4d86cbf4..fd9dc889f36c 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -48,6 +48,7 @@
48 48
49#ifndef __ASSEMBLY__ 49#ifndef __ASSEMBLY__
50#include <linux/kernel.h> 50#include <linux/kernel.h>
51#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
51 52
52/* 53/*
53 * This is the logout header that should be common to all platforms 54 * This is the logout header that should be common to all platforms
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
index d595c15166a4..41a5e9d6bb69 100644
--- a/include/asm-arm/floppy.h
+++ b/include/asm-arm/floppy.h
@@ -128,8 +128,6 @@ static inline void fd_scandrives (void)
128#define N_FDC 1 128#define N_FDC 1
129#define N_DRIVE 4 129#define N_DRIVE 4
130 130
131#define FLOPPY_MOTOR_MASK 0xf0
132
133#define CROSS_64KB(a,s) (0) 131#define CROSS_64KB(a,s) (0)
134 132
135/* 133/*
diff --git a/include/asm-arm/ipc.h b/include/asm-arm/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-arm/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
index d5dc624f452a..1c8b441f89e3 100644
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -28,7 +28,6 @@ struct semaphore {
28 struct semaphore name = __SEMAPHORE_INIT(name,count) 28 struct semaphore name = __SEMAPHORE_INIT(name,count)
29 29
30#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 30#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
31#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
32 31
33static inline void sema_init(struct semaphore *sem, int val) 32static inline void sema_init(struct semaphore *sem, int val)
34{ 33{
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 22992ee0627a..3141451a9bd6 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26 26
27#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/include/asm-arm26/irq_regs.h b/include/asm-arm26/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-arm26/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 64bb92bb6773..8be7ea9c9047 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -298,13 +298,6 @@ extern void __iounmap(void __iomem *addr);
298#define ioport_map(port, nr) ioremap(port, nr) 298#define ioport_map(port, nr) ioremap(port, nr)
299#define ioport_unmap(port) iounmap(port) 299#define ioport_unmap(port) iounmap(port)
300 300
301#define dma_cache_wback_inv(_start, _size) \
302 flush_dcache_region(_start, _size)
303#define dma_cache_inv(_start, _size) \
304 invalidate_dcache_region(_start, _size)
305#define dma_cache_wback(_start, _size) \
306 clean_dcache_region(_start, _size)
307
308/* 301/*
309 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 302 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
310 * access 303 * access
diff --git a/include/asm-avr32/semaphore.h b/include/asm-avr32/semaphore.h
index ef99ddccc10c..feaf1d453386 100644
--- a/include/asm-avr32/semaphore.h
+++ b/include/asm-avr32/semaphore.h
@@ -36,7 +36,6 @@ struct semaphore {
36 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 36 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
37 37
38#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 38#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
39#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
40 39
41static inline void sema_init (struct semaphore *sem, int val) 40static inline void sema_init (struct semaphore *sem, int val)
42{ 41{
diff --git a/include/asm-avr32/types.h b/include/asm-avr32/types.h
index 2bff153a32ed..8999a3819403 100644
--- a/include/asm-avr32/types.h
+++ b/include/asm-avr32/types.h
@@ -25,9 +25,9 @@ typedef unsigned short __u16;
25typedef __signed__ int __s32; 25typedef __signed__ int __s32;
26typedef unsigned int __u32; 26typedef unsigned int __u32;
27 27
28#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 28#if defined(__GNUC__)
29typedef __signed__ long long __s64; 29__extension__ typedef __signed__ long long __s64;
30typedef unsigned long long __u64; 30__extension__ typedef unsigned long long __u64;
31#endif 31#endif
32 32
33#endif /* __ASSEMBLY__ */ 33#endif /* __ASSEMBLY__ */
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index 525179bf43d7..d1d2e6be3b59 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -183,10 +183,6 @@ extern void blkfin_inv_cache_all(void);
183#define ioport_map(port, nr) ((void __iomem*)(port)) 183#define ioport_map(port, nr) ((void __iomem*)(port))
184#define ioport_unmap(addr) 184#define ioport_unmap(addr)
185 185
186#define dma_cache_inv(_start,_size) do { blkfin_inv_cache_all();} while (0)
187#define dma_cache_wback(_start,_size) do { } while (0)
188#define dma_cache_wback_inv(_start,_size) do { blkfin_inv_cache_all();} while (0)
189
190/* Pages to physical address... */ 186/* Pages to physical address... */
191#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) 187#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
192#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) 188#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
diff --git a/include/asm-blackfin/ipc.h b/include/asm-blackfin/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-blackfin/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-blackfin/semaphore.h b/include/asm-blackfin/semaphore.h
index 94c04d7ab23e..533f90fb2e4e 100644
--- a/include/asm-blackfin/semaphore.h
+++ b/include/asm-blackfin/semaphore.h
@@ -35,7 +35,6 @@ struct semaphore {
35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
36 36
37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
38#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
39 38
40static inline void sema_init(struct semaphore *sem, int val) 39static inline void sema_init(struct semaphore *sem, int val)
41{ 40{
diff --git a/include/asm-blackfin/types.h b/include/asm-blackfin/types.h
index 36f8dc8c52ba..9785a6d531c6 100644
--- a/include/asm-blackfin/types.h
+++ b/include/asm-blackfin/types.h
@@ -27,9 +27,9 @@ typedef __signed__ int __s32;
27typedef unsigned int __u32; 27typedef unsigned int __u32;
28 28
29/* HK0617 -- Changes to unsigned long temporarily */ 29/* HK0617 -- Changes to unsigned long temporarily */
30#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 30#if defined(__GNUC__)
31typedef __signed__ long long __s64; 31__extension__ typedef __signed__ long long __s64;
32typedef unsigned long long __u64; 32__extension__ typedef unsigned long long __u64;
33#endif 33#endif
34 34
35#endif /* __ASSEMBLY__ */ 35#endif /* __ASSEMBLY__ */
diff --git a/include/asm-cris/ipc.h b/include/asm-cris/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-cris/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-cris/irq_regs.h b/include/asm-cris/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-cris/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h
index 53f548b791c1..31a4ac448195 100644
--- a/include/asm-cris/semaphore.h
+++ b/include/asm-cris/semaphore.h
@@ -35,7 +35,6 @@ struct semaphore {
35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
36 36
37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
38#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
39 38
40static inline void sema_init(struct semaphore *sem, int val) 39static inline void sema_init(struct semaphore *sem, int val)
41{ 40{
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 84557c9bac93..5a21c42bc6c5 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26 26
27#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/include/asm-frv/ipc.h b/include/asm-frv/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-frv/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-frv/semaphore.h b/include/asm-frv/semaphore.h
index 09586528e007..d7aaa1911a1a 100644
--- a/include/asm-frv/semaphore.h
+++ b/include/asm-frv/semaphore.h
@@ -49,7 +49,6 @@ struct semaphore {
49 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 49 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
50 50
51#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 51#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
52#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
53 52
54static inline void sema_init (struct semaphore *sem, int val) 53static inline void sema_init (struct semaphore *sem, int val)
55{ 54{
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 1b6d1923b25b..767e5ed71c4b 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
30typedef __signed__ int __s32; 30typedef __signed__ int __s32;
31typedef unsigned int __u32; 31typedef unsigned int __u32;
32 32
33#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 33#if defined(__GNUC__)
34typedef __signed__ long long __s64; 34__extension__ typedef __signed__ long long __s64;
35typedef unsigned long long __u64; 35__extension__ typedef unsigned long long __u64;
36#endif 36#endif
37 37
38#endif /* __ASSEMBLY__ */ 38#endif /* __ASSEMBLY__ */
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index 5bfeef761649..c18110ee30f1 100644
--- a/include/asm-generic/Kbuild
+++ b/include/asm-generic/Kbuild
@@ -2,7 +2,6 @@ header-y += errno-base.h
2header-y += errno.h 2header-y += errno.h
3header-y += fcntl.h 3header-y += fcntl.h
4header-y += ioctl.h 4header-y += ioctl.h
5header-y += ipc.h
6header-y += mman.h 5header-y += mman.h
7header-y += poll.h 6header-y += poll.h
8header-y += signal.h 7header-y += signal.h
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index a37e95fe58d6..8fd81713cfc0 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -30,6 +30,5 @@ unifdef-y += unistd.h
30unifdef-y += user.h 30unifdef-y += user.h
31 31
32# These probably shouldn't be exported 32# These probably shouldn't be exported
33unifdef-y += shmparam.h
34unifdef-y += elf.h 33unifdef-y += elf.h
35unifdef-y += page.h 34unifdef-y += page.h
diff --git a/include/asm-generic/ipc.h b/include/asm-generic/ipc.h
deleted file mode 100644
index a40407a165ce..000000000000
--- a/include/asm-generic/ipc.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _ASM_GENERIC_IPC_H
2#define _ASM_GENERIC_IPC_H
3/*
4 * These are used to wrap system calls.
5 *
6 * See architecture code for ugly details..
7 */
8struct ipc_kludge {
9 struct msgbuf __user *msgp;
10 long msgtyp;
11};
12
13#define SEMOP 1
14#define SEMGET 2
15#define SEMCTL 3
16#define SEMTIMEDOP 4
17#define MSGSND 11
18#define MSGRCV 12
19#define MSGGET 13
20#define MSGCTL 14
21#define SHMAT 21
22#define SHMDT 22
23#define SHMGET 23
24#define SHMCTL 24
25
26/* Used by the DIPC package, try and avoid reusing it */
27#define DIPC 25
28
29#define IPCCALL(version,op) ((version)<<16 | (op))
30
31#endif /* _ASM_GENERIC_IPC_H */
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index 91b7487cb7ae..7543a57b4ea1 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -264,12 +264,6 @@ static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size
264 264
265extern void iounmap(void *addr); 265extern void iounmap(void *addr);
266 266
267/* Nothing to do */
268
269#define dma_cache_inv(_start,_size) do { } while (0)
270#define dma_cache_wback(_start,_size) do { } while (0)
271#define dma_cache_wback_inv(_start,_size) do { } while (0)
272
273/* H8/300 internal I/O functions */ 267/* H8/300 internal I/O functions */
274static __inline__ unsigned char ctrl_inb(unsigned long addr) 268static __inline__ unsigned char ctrl_inb(unsigned long addr)
275{ 269{
diff --git a/include/asm-h8300/ipc.h b/include/asm-h8300/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-h8300/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-h8300/semaphore.h b/include/asm-h8300/semaphore.h
index 81bae2a99192..f3ffff83ff09 100644
--- a/include/asm-h8300/semaphore.h
+++ b/include/asm-h8300/semaphore.h
@@ -39,7 +39,6 @@ struct semaphore {
39 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 39 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
40 40
41#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 41#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
42#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
43 42
44static inline void sema_init (struct semaphore *sem, int val) 43static inline void sema_init (struct semaphore *sem, int val)
45{ 44{
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index 2a8b1b2be782..56566e2a09fd 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
27typedef __signed__ int __s32; 27typedef __signed__ int __s32;
28typedef unsigned int __u32; 28typedef unsigned int __u32;
29 29
30#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 30#if defined(__GNUC__)
31typedef __signed__ long long __s64; 31__extension__ typedef __signed__ long long __s64;
32typedef unsigned long long __u64; 32__extension__ typedef unsigned long long __u64;
33#endif 33#endif
34 34
35/* 35/*
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
index 25f9835d5459..f10e29b60b00 100644
--- a/include/asm-ia64/elf.h
+++ b/include/asm-ia64/elf.h
@@ -192,6 +192,7 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
192 192
193#define GATE_EHDR ((const struct elfhdr *) GATE_ADDR) 193#define GATE_EHDR ((const struct elfhdr *) GATE_ADDR)
194 194
195/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
195#define ARCH_DLINFO \ 196#define ARCH_DLINFO \
196do { \ 197do { \
197 extern char __kernel_syscall_via_epc[]; \ 198 extern char __kernel_syscall_via_epc[]; \
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index eb17a8692967..4ebed77aa472 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -435,10 +435,6 @@ extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n);
435extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n); 435extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
436extern void memset_io(volatile void __iomem *s, int c, long n); 436extern void memset_io(volatile void __iomem *s, int c, long n);
437 437
438#define dma_cache_inv(_start,_size) do { } while (0)
439#define dma_cache_wback(_start,_size) do { } while (0)
440#define dma_cache_wback_inv(_start,_size) do { } while (0)
441
442# endif /* __KERNEL__ */ 438# endif /* __KERNEL__ */
443 439
444/* 440/*
diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
index 7d5e2ccc37a0..6a8a27cfae3e 100644
--- a/include/asm-ia64/numa.h
+++ b/include/asm-ia64/numa.h
@@ -24,6 +24,7 @@
24 24
25extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned; 25extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
26extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; 26extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
27extern pg_data_t *pgdat_list[MAX_NUMNODES];
27 28
28/* Stuff below this line could be architecture independent */ 29/* Stuff below this line could be architecture independent */
29 30
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h
index f483eeb95dd1..d8393d11288d 100644
--- a/include/asm-ia64/semaphore.h
+++ b/include/asm-ia64/semaphore.h
@@ -28,7 +28,6 @@ struct semaphore {
28 struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) 28 struct semaphore name = __SEMAPHORE_INITIALIZER(name, count)
29 29
30#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) 30#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
31#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
32 31
33static inline void 32static inline void
34sema_init (struct semaphore *sem, int val) 33sema_init (struct semaphore *sem, int val)
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 91bb8e00066c..595112bca3cc 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -32,6 +32,8 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/types.h> 33#include <linux/types.h>
34 34
35#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
36
35struct pci_vector_struct { 37struct pci_vector_struct {
36 __u16 segment; /* PCI Segment number */ 38 __u16 segment; /* PCI Segment number */
37 __u16 bus; /* PCI Bus number */ 39 __u16 bus; /* PCI Bus number */
diff --git a/include/asm-m32r/ipc.h b/include/asm-m32r/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-m32r/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h
index 41e45d7b87ef..b5bf95a6f2b4 100644
--- a/include/asm-m32r/semaphore.h
+++ b/include/asm-m32r/semaphore.h
@@ -35,7 +35,6 @@ struct semaphore {
35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
36 36
37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
38#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
39 38
40static inline void sema_init (struct semaphore *sem, int val) 39static inline void sema_init (struct semaphore *sem, int val)
41{ 40{
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index 27d3eb539c50..b64c16639a7b 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26#endif /* __ASSEMBLY__ */ 26#endif /* __ASSEMBLY__ */
27 27
diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h
index 45dc908932a3..697d50393dd0 100644
--- a/include/asm-m68k/floppy.h
+++ b/include/asm-m68k/floppy.h
@@ -31,9 +31,6 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id);
31#define FLOPPY0_TYPE (MACH_IS_Q40 ? 6 : 4) 31#define FLOPPY0_TYPE (MACH_IS_Q40 ? 6 : 4)
32#define FLOPPY1_TYPE 0 32#define FLOPPY1_TYPE 0
33 33
34#define FLOPPY_MOTOR_MASK 0xf0
35
36
37/* basically PC init + set use_virtual_dma */ 34/* basically PC init + set use_virtual_dma */
38#define FDC1 m68k_floppy_init() 35#define FDC1 m68k_floppy_init()
39 36
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 47bb9cf107b7..baf4f9b8acfc 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -384,12 +384,6 @@ static inline void __iomem *ioremap_fullcache(unsigned long physaddr,
384 return __ioremap(physaddr, size, IOMAP_FULL_CACHING); 384 return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
385} 385}
386 386
387
388/* m68k caches aren't DMA coherent */
389extern void dma_cache_wback_inv(unsigned long start, unsigned long size);
390extern void dma_cache_wback(unsigned long start, unsigned long size);
391extern void dma_cache_inv(unsigned long start, unsigned long size);
392
393static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) 387static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
394{ 388{
395 __builtin_memset((void __force *) addr, val, count); 389 __builtin_memset((void __force *) addr, val, count);
diff --git a/include/asm-m68k/ipc.h b/include/asm-m68k/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-m68k/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h
index fd4c7cc3d3be..64d6b119bb0a 100644
--- a/include/asm-m68k/semaphore.h
+++ b/include/asm-m68k/semaphore.h
@@ -40,7 +40,6 @@ struct semaphore {
40 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 40 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
41 41
42#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 42#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
43#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
44 43
45static inline void sema_init(struct semaphore *sem, int val) 44static inline void sema_init(struct semaphore *sem, int val)
46{ 45{
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index b5a1febc97d4..c35c09d93b66 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
27typedef __signed__ int __s32; 27typedef __signed__ int __s32;
28typedef unsigned int __u32; 28typedef unsigned int __u32;
29 29
30#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 30#if defined(__GNUC__)
31typedef __signed__ long long __s64; 31__extension__ typedef __signed__ long long __s64;
32typedef unsigned long long __u64; 32__extension__ typedef unsigned long long __u64;
33#endif 33#endif
34 34
35#endif /* __ASSEMBLY__ */ 35#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
index 8df4cee2a0cd..653d9b2d7ddf 100644
--- a/include/asm-m68knommu/io.h
+++ b/include/asm-m68knommu/io.h
@@ -165,12 +165,6 @@ static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size
165 165
166extern void iounmap(void *addr); 166extern void iounmap(void *addr);
167 167
168/* Nothing to do */
169
170#define dma_cache_inv(_start,_size) do { } while (0)
171#define dma_cache_wback(_start,_size) do { } while (0)
172#define dma_cache_wback_inv(_start,_size) do { } while (0)
173
174/* Pages to physical address... */ 168/* Pages to physical address... */
175#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) 169#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
176#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) 170#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
diff --git a/include/asm-m68knommu/ipc.h b/include/asm-m68knommu/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-m68knommu/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-m68knommu/semaphore.h b/include/asm-m68knommu/semaphore.h
index 5cc1fdd86f50..5779eb6c0689 100644
--- a/include/asm-m68knommu/semaphore.h
+++ b/include/asm-m68knommu/semaphore.h
@@ -39,7 +39,6 @@ struct semaphore {
39 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 39 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
40 40
41#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 41#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
42#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
43 42
44static inline void sema_init (struct semaphore *sem, int val) 43static inline void sema_init (struct semaphore *sem, int val)
45{ 44{
diff --git a/include/asm-mips/floppy.h b/include/asm-mips/floppy.h
index a62d0990c8ae..992d232adc83 100644
--- a/include/asm-mips/floppy.h
+++ b/include/asm-mips/floppy.h
@@ -34,8 +34,6 @@ static inline void fd_cacheflush(char * addr, long size)
34#define N_FDC 1 /* do you *really* want a second controller? */ 34#define N_FDC 1 /* do you *really* want a second controller? */
35#define N_DRIVE 8 35#define N_DRIVE 8
36 36
37#define FLOPPY_MOTOR_MASK 0xf0
38
39/* 37/*
40 * The DMA channel used by the floppy controller cannot access data at 38 * The DMA channel used by the floppy controller cannot access data at
41 * addresses >= 16MB 39 * addresses >= 16MB
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 2cd8323c8586..e62058b0d28c 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -554,6 +554,8 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
554 * caches. Dirty lines of the caches may be written back or simply 554 * caches. Dirty lines of the caches may be written back or simply
555 * be discarded. This operation is necessary before dma operations 555 * be discarded. This operation is necessary before dma operations
556 * to the memory. 556 * to the memory.
557 *
558 * This API used to be exported; it now is for arch code internal use only.
557 */ 559 */
558#ifdef CONFIG_DMA_NONCOHERENT 560#ifdef CONFIG_DMA_NONCOHERENT
559 561
diff --git a/include/asm-mips/ipc.h b/include/asm-mips/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-mips/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index 080daa77f867..fdf8042b784b 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -49,7 +49,6 @@ struct semaphore {
49 struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) 49 struct semaphore name = __SEMAPHORE_INITIALIZER(name, count)
50 50
51#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) 51#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
52#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
53 52
54static inline void sema_init(struct semaphore *sem, int val) 53static inline void sema_init(struct semaphore *sem, int val)
55{ 54{
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 63a13c5bd832..2dd147f519d1 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -34,9 +34,9 @@ typedef unsigned long __u64;
34 34
35#else 35#else
36 36
37#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 37#if defined(__GNUC__)
38typedef __signed__ long long __s64; 38__extension__ typedef __signed__ long long __s64;
39typedef unsigned long long __u64; 39__extension__ typedef unsigned long long __u64;
40#endif 40#endif
41 41
42#endif 42#endif
diff --git a/include/asm-parisc/floppy.h b/include/asm-parisc/floppy.h
index da2f9c157143..4ca69f558fae 100644
--- a/include/asm-parisc/floppy.h
+++ b/include/asm-parisc/floppy.h
@@ -266,10 +266,6 @@ static int FDC2 = -1;
266#define N_FDC 1 266#define N_FDC 1
267#define N_DRIVE 8 267#define N_DRIVE 8
268 268
269#define FLOPPY_MOTOR_MASK 0xf0
270
271#define AUTO_DMA
272
273#define EXTRA_FLOPPY_PARAMS 269#define EXTRA_FLOPPY_PARAMS
274 270
275#endif /* __ASM_PARISC_FLOPPY_H */ 271#endif /* __ASM_PARISC_FLOPPY_H */
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index 4cc9bcec0564..95f00e11c7b4 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -270,11 +270,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count);
270/* IO Port space is : BBiiii where BB is HBA number. */ 270/* IO Port space is : BBiiii where BB is HBA number. */
271#define IO_SPACE_LIMIT 0x00ffffff 271#define IO_SPACE_LIMIT 0x00ffffff
272 272
273
274#define dma_cache_inv(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0)
275#define dma_cache_wback(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0)
276#define dma_cache_wback_inv(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0)
277
278/* PA machines have an MM I/O space from 0xf0000000-0xffffffff in 32 273/* PA machines have an MM I/O space from 0xf0000000-0xffffffff in 32
279 * bit mode and from 0xfffffffff0000000-0xfffffffffffffff in 64 bit 274 * bit mode and from 0xfffffffff0000000-0xfffffffffffffff in 64 bit
280 * mode (essentially just sign extending. This macro takes in a 32 275 * mode (essentially just sign extending. This macro takes in a 32
diff --git a/include/asm-parisc/semaphore.h b/include/asm-parisc/semaphore.h
index d45827a21f94..b771dcfcfdd1 100644
--- a/include/asm-parisc/semaphore.h
+++ b/include/asm-parisc/semaphore.h
@@ -53,7 +53,6 @@ struct semaphore {
53 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 53 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
54 54
55#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 55#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
56#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
57 56
58extern inline void sema_init (struct semaphore *sem, int val) 57extern inline void sema_init (struct semaphore *sem, int val)
59{ 58{
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index d4aa33033d98..56c84802da59 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26 26
27#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 4869513b872f..5f640e542475 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -13,9 +13,7 @@ header-y += shmbuf.h
13header-y += socket.h 13header-y += socket.h
14header-y += termbits.h 14header-y += termbits.h
15header-y += fcntl.h 15header-y += fcntl.h
16header-y += ipc.h
17header-y += poll.h 16header-y += poll.h
18header-y += shmparam.h
19header-y += sockios.h 17header-y += sockios.h
20header-y += ucontext.h 18header-y += ucontext.h
21header-y += ioctl.h 19header-y += ioctl.h
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index e42820d6d25b..6bd07ef78ac4 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -101,6 +101,7 @@ typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG];
101 101
102typedef unsigned int elf_greg_t32; 102typedef unsigned int elf_greg_t32;
103typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; 103typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
104typedef elf_gregset_t32 compat_elf_gregset_t;
104 105
105/* 106/*
106 * ELF_ARCH, CLASS, and DATA are used to set parameters in the core dumps. 107 * ELF_ARCH, CLASS, and DATA are used to set parameters in the core dumps.
@@ -175,26 +176,27 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
175 176
176#define ELF_ET_DYN_BASE (0x20000000) 177#define ELF_ET_DYN_BASE (0x20000000)
177 178
178/* Common routine for both 32-bit and 64-bit processes */ 179/*
180 * Our registers are always unsigned longs, whether we're a 32 bit
181 * process or 64 bit, on either a 64 bit or 32 bit kernel.
182 *
183 * This macro relies on elf_regs[i] having the right type to truncate to,
184 * either u32 or u64. It defines the body of the elf_core_copy_regs
185 * function, either the native one with elf_gregset_t elf_regs or
186 * the 32-bit one with elf_gregset_t32 elf_regs.
187 */
188#define PPC_ELF_CORE_COPY_REGS(elf_regs, regs) \
189 int i, nregs = min(sizeof(*regs) / sizeof(unsigned long), \
190 (size_t)ELF_NGREG); \
191 for (i = 0; i < nregs; i++) \
192 elf_regs[i] = ((unsigned long *) regs)[i]; \
193 memset(&elf_regs[i], 0, (ELF_NGREG - i) * sizeof(elf_regs[0]))
194
195/* Common routine for both 32-bit and 64-bit native processes */
179static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, 196static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs,
180 struct pt_regs *regs) 197 struct pt_regs *regs)
181{ 198{
182 int i, nregs; 199 PPC_ELF_CORE_COPY_REGS(elf_regs, regs);
183
184 memset((void *)elf_regs, 0, sizeof(elf_gregset_t));
185
186 /* Our registers are always unsigned longs, whether we're a 32 bit
187 * process or 64 bit, on either a 64 bit or 32 bit kernel.
188 * Don't use ELF_GREG_TYPE here. */
189 nregs = sizeof(struct pt_regs) / sizeof(unsigned long);
190 if (nregs > ELF_NGREG)
191 nregs = ELF_NGREG;
192
193 for (i = 0; i < nregs; i++) {
194 /* This will correctly truncate 64 bit registers to 32 bits
195 * for a 32 bit process on a 64 bit kernel. */
196 elf_regs[i] = (elf_greg_t)((ELF_GREG_TYPE *)regs)[i];
197 }
198} 200}
199#define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs); 201#define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs);
200 202
@@ -212,6 +214,14 @@ static inline int dump_task_regs(struct task_struct *tsk,
212extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 214extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
213#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) 215#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
214 216
217typedef elf_vrregset_t elf_fpxregset_t;
218
219#ifdef CONFIG_ALTIVEC
220extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs);
221#define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_altivec(tsk, regs)
222#define ELF_CORE_XFPREG_TYPE NT_PPC_VMX
223#endif
224
215#endif /* __KERNEL__ */ 225#endif /* __KERNEL__ */
216 226
217/* ELF_HWCAP yields a mask that user programs can use to figure out what 227/* ELF_HWCAP yields a mask that user programs can use to figure out what
@@ -281,6 +291,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
281 * AT_IGNOREPPC is used for that. 291 * AT_IGNOREPPC is used for that.
282 * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, 292 * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC,
283 * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. 293 * even if DLINFO_ARCH_ITEMS goes to zero or is undefined.
294 * update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes
284 */ 295 */
285#define ARCH_DLINFO \ 296#define ARCH_DLINFO \
286do { \ 297do { \
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index 34146f0eea63..24bd34c57e9d 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -202,8 +202,6 @@ static int FDC2 = -1;
202#define N_FDC 2 /* Don't change this! */ 202#define N_FDC 2 /* Don't change this! */
203#define N_DRIVE 8 203#define N_DRIVE 8
204 204
205#define FLOPPY_MOTOR_MASK 0xf0
206
207/* 205/*
208 * The PowerPC has no problems with floppy DMA crossing 64k borders. 206 * The PowerPC has no problems with floppy DMA crossing 64k borders.
209 */ 207 */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 0d0589ef8ea6..bf14ab4ef4c9 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -498,23 +498,6 @@ static inline void name at \
498#define writeq writeq 498#define writeq writeq
499#endif 499#endif
500 500
501#ifdef CONFIG_NOT_COHERENT_CACHE
502
503#define dma_cache_inv(_start,_size) \
504 invalidate_dcache_range(_start, (_start + _size))
505#define dma_cache_wback(_start,_size) \
506 clean_dcache_range(_start, (_start + _size))
507#define dma_cache_wback_inv(_start,_size) \
508 flush_dcache_range(_start, (_start + _size))
509
510#else /* CONFIG_NOT_COHERENT_CACHE */
511
512#define dma_cache_inv(_start,_size) do { } while (0)
513#define dma_cache_wback(_start,_size) do { } while (0)
514#define dma_cache_wback_inv(_start,_size) do { } while (0)
515
516#endif /* !CONFIG_NOT_COHERENT_CACHE */
517
518/* 501/*
519 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 502 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
520 * access 503 * access
diff --git a/include/asm-powerpc/ipc.h b/include/asm-powerpc/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-powerpc/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-powerpc/semaphore.h b/include/asm-powerpc/semaphore.h
index 57369d2cadef..48dd32e07749 100644
--- a/include/asm-powerpc/semaphore.h
+++ b/include/asm-powerpc/semaphore.h
@@ -35,7 +35,6 @@ struct semaphore {
35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
36 36
37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) 37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
38#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
39 38
40static inline void sema_init (struct semaphore *sem, int val) 39static inline void sema_init (struct semaphore *sem, int val)
41{ 40{
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d10e99bf5001..87be8c3bc9cb 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -40,6 +40,7 @@
40#define set_mb(var, value) do { var = value; mb(); } while (0) 40#define set_mb(var, value) do { var = value; mb(); } while (0)
41 41
42#ifdef __KERNEL__ 42#ifdef __KERNEL__
43#define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */
43#ifdef CONFIG_SMP 44#ifdef CONFIG_SMP
44#define smp_mb() mb() 45#define smp_mb() mb()
45#define smp_rmb() rmb() 46#define smp_rmb() rmb()
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index a584341c87e3..903fd1932436 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -40,9 +40,9 @@ typedef unsigned int __u32;
40typedef __signed__ long __s64; 40typedef __signed__ long __s64;
41typedef unsigned long __u64; 41typedef unsigned long __u64;
42#else 42#else
43#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 43#if defined(__GNUC__)
44typedef __signed__ long long __s64; 44__extension__ typedef __signed__ long long __s64;
45typedef unsigned long long __u64; 45__extension__ typedef unsigned long long __u64;
46#endif 46#endif
47#endif /* __powerpc64__ */ 47#endif /* __powerpc64__ */
48 48
diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h
index ae316e6d2ca9..7d9b3f430d92 100644
--- a/include/asm-ppc/floppy.h
+++ b/include/asm-ppc/floppy.h
@@ -166,8 +166,6 @@ static int FDC2 = -1;
166#define N_FDC 2 /* Don't change this! */ 166#define N_FDC 2 /* Don't change this! */
167#define N_DRIVE 8 167#define N_DRIVE 8
168 168
169#define FLOPPY_MOTOR_MASK 0xf0
170
171/* 169/*
172 * The PowerPC has no problems with floppy DMA crossing 64k borders. 170 * The PowerPC has no problems with floppy DMA crossing 64k borders.
173 */ 171 */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 8f58231a8bc6..a0d409a5d80f 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -478,23 +478,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
478#include <asm/mpc8260_pci9.h> 478#include <asm/mpc8260_pci9.h>
479#endif 479#endif
480 480
481#ifdef CONFIG_NOT_COHERENT_CACHE
482
483#define dma_cache_inv(_start,_size) \
484 invalidate_dcache_range(_start, (_start + _size))
485#define dma_cache_wback(_start,_size) \
486 clean_dcache_range(_start, (_start + _size))
487#define dma_cache_wback_inv(_start,_size) \
488 flush_dcache_range(_start, (_start + _size))
489
490#else
491
492#define dma_cache_inv(_start,_size) do { } while (0)
493#define dma_cache_wback(_start,_size) do { } while (0)
494#define dma_cache_wback_inv(_start,_size) do { } while (0)
495
496#endif
497
498/* 481/*
499 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 482 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
500 * access 483 * access
diff --git a/include/asm-ppc/irq_regs.h b/include/asm-ppc/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-ppc/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-s390/ipc.h b/include/asm-s390/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-s390/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h
index dbce058aefa9..0e7001ad8392 100644
--- a/include/asm-s390/semaphore.h
+++ b/include/asm-s390/semaphore.h
@@ -33,7 +33,6 @@ struct semaphore {
33 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 33 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
34 34
35#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 35#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
36#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
37 36
38static inline void sema_init (struct semaphore *sem, int val) 37static inline void sema_init (struct semaphore *sem, int val)
39{ 38{
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index fc5d7cf19324..2c5879ae90ca 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -28,9 +28,9 @@ typedef __signed__ int __s32;
28typedef unsigned int __u32; 28typedef unsigned int __u32;
29 29
30#ifndef __s390x__ 30#ifndef __s390x__
31#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 31#if defined(__GNUC__)
32typedef __signed__ long long __s64; 32__extension__ typedef __signed__ long long __s64;
33typedef unsigned long long __u64; 33__extension__ typedef unsigned long long __u64;
34#endif 34#endif
35#else /* __s390x__ */ 35#else /* __s390x__ */
36typedef __signed__ long __s64; 36typedef __signed__ long __s64;
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h
index 43ca244564b1..12cc4b392bf0 100644
--- a/include/asm-sh/elf.h
+++ b/include/asm-sh/elf.h
@@ -133,6 +133,7 @@ extern void __kernel_vsyscall;
133#define VDSO_BASE ((unsigned long)current->mm->context.vdso) 133#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
134#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) 134#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x))
135 135
136/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
136#define ARCH_DLINFO \ 137#define ARCH_DLINFO \
137do { \ 138do { \
138 if (vdso_enabled) \ 139 if (vdso_enabled) \
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
index 3b59b3af777b..59fbfdc90dfb 100644
--- a/include/asm-sh/floppy.h
+++ b/include/asm-sh/floppy.h
@@ -213,7 +213,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
213 } 213 }
214#endif 214#endif
215 215
216 dma_cache_wback_inv(addr, size); 216 __flush_purge_region(addr, size);
217 217
218 /* actual, physical DMA */ 218 /* actual, physical DMA */
219 doing_pdma = 0; 219 doing_pdma = 0;
@@ -263,10 +263,6 @@ static int FDC2 = -1;
263#define N_FDC 2 263#define N_FDC 2
264#define N_DRIVE 8 264#define N_DRIVE 8
265 265
266#define FLOPPY_MOTOR_MASK 0xf0
267
268#define AUTO_DMA
269
270#define EXTRA_FLOPPY_PARAMS 266#define EXTRA_FLOPPY_PARAMS
271 267
272#endif /* __ASM_SH_FLOPPY_H */ 268#endif /* __ASM_SH_FLOPPY_H */
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 1a336cdc75fe..6ed34d8eac5f 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -327,31 +327,6 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
327 __iounmap((addr)) 327 __iounmap((addr))
328 328
329/* 329/*
330 * The caches on some architectures aren't dma-coherent and have need to
331 * handle this in software. There are three types of operations that
332 * can be applied to dma buffers.
333 *
334 * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by
335 * writing the content of the caches back to memory, if necessary.
336 * The function also invalidates the affected part of the caches as
337 * necessary before DMA transfers from outside to memory.
338 * - dma_cache_inv(start, size) invalidates the affected parts of the
339 * caches. Dirty lines of the caches may be written back or simply
340 * be discarded. This operation is necessary before dma operations
341 * to the memory.
342 * - dma_cache_wback(start, size) writes back any dirty lines but does
343 * not invalidate the cache. This can be used before DMA reads from
344 * memory,
345 */
346
347#define dma_cache_wback_inv(_start,_size) \
348 __flush_purge_region(_start,_size)
349#define dma_cache_inv(_start,_size) \
350 __flush_invalidate_region(_start,_size)
351#define dma_cache_wback(_start,_size) \
352 __flush_wback_region(_start,_size)
353
354/*
355 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 330 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
356 * access 331 * access
357 */ 332 */
diff --git a/include/asm-sh/ipc.h b/include/asm-sh/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-sh/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-sh/semaphore.h b/include/asm-sh/semaphore.h
index 489f7847c5d9..9e5a37c4dce2 100644
--- a/include/asm-sh/semaphore.h
+++ b/include/asm-sh/semaphore.h
@@ -37,7 +37,6 @@ struct semaphore {
37 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 37 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
38 38
39#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 39#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
40#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
41 40
42static inline void sema_init (struct semaphore *sem, int val) 41static inline void sema_init (struct semaphore *sem, int val)
43{ 42{
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 9d849e6df268..4faa2fb88616 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -15,6 +15,7 @@
15struct task_struct *__switch_to(struct task_struct *prev, 15struct task_struct *__switch_to(struct task_struct *prev,
16 struct task_struct *next); 16 struct task_struct *next);
17 17
18#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
18/* 19/*
19 * switch_to() should switch tasks to task nr n, first 20 * switch_to() should switch tasks to task nr n, first
20 */ 21 */
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index fd00dbb82f84..7ba69d9707ef 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26 26
27#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index de4309960207..e661857f98dc 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -42,7 +42,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
42static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 42static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
43 enum dma_data_direction dir) 43 enum dma_data_direction dir)
44{ 44{
45 dma_cache_wback_inv((unsigned long)vaddr, size); 45 unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK;
46 unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK;
47
48 for (; s <= e; s += L1_CACHE_BYTES)
49 asm volatile ("ocbp %0, 0" : : "r" (s));
46} 50}
47 51
48static inline dma_addr_t dma_map_single(struct device *dev, 52static inline dma_addr_t dma_map_single(struct device *dev,
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index 3de3ad99f457..7bd7314d38c2 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -182,54 +182,6 @@ unsigned long onchip_remap(unsigned long addr, unsigned long size, const char* n
182extern void onchip_unmap(unsigned long vaddr); 182extern void onchip_unmap(unsigned long vaddr);
183 183
184/* 184/*
185 * The caches on some architectures aren't dma-coherent and have need to
186 * handle this in software. There are three types of operations that
187 * can be applied to dma buffers.
188 *
189 * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by
190 * writing the content of the caches back to memory, if necessary.
191 * The function also invalidates the affected part of the caches as
192 * necessary before DMA transfers from outside to memory.
193 * - dma_cache_inv(start, size) invalidates the affected parts of the
194 * caches. Dirty lines of the caches may be written back or simply
195 * be discarded. This operation is necessary before dma operations
196 * to the memory.
197 * - dma_cache_wback(start, size) writes back any dirty lines but does
198 * not invalidate the cache. This can be used before DMA reads from
199 * memory,
200 */
201
202static __inline__ void dma_cache_wback_inv (unsigned long start, unsigned long size)
203{
204 unsigned long s = start & L1_CACHE_ALIGN_MASK;
205 unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK;
206
207 for (; s <= e; s += L1_CACHE_BYTES)
208 asm volatile ("ocbp %0, 0" : : "r" (s));
209}
210
211static __inline__ void dma_cache_inv (unsigned long start, unsigned long size)
212{
213 // Note that caller has to be careful with overzealous
214 // invalidation should there be partial cache lines at the extremities
215 // of the specified range
216 unsigned long s = start & L1_CACHE_ALIGN_MASK;
217 unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK;
218
219 for (; s <= e; s += L1_CACHE_BYTES)
220 asm volatile ("ocbi %0, 0" : : "r" (s));
221}
222
223static __inline__ void dma_cache_wback (unsigned long start, unsigned long size)
224{
225 unsigned long s = start & L1_CACHE_ALIGN_MASK;
226 unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK;
227
228 for (; s <= e; s += L1_CACHE_BYTES)
229 asm volatile ("ocbwb %0, 0" : : "r" (s));
230}
231
232/*
233 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 185 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
234 * access 186 * access
235 */ 187 */
diff --git a/include/asm-sh64/ipc.h b/include/asm-sh64/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-sh64/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-sh64/semaphore.h b/include/asm-sh64/semaphore.h
index 469526459149..f027cc14b55b 100644
--- a/include/asm-sh64/semaphore.h
+++ b/include/asm-sh64/semaphore.h
@@ -44,7 +44,6 @@ struct semaphore {
44 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 44 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
45 45
46#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 46#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
47#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
48 47
49static inline void sema_init (struct semaphore *sem, int val) 48static inline void sema_init (struct semaphore *sem, int val)
50{ 49{
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h
index 8d41db2153b5..2c7ad73b3883 100644
--- a/include/asm-sh64/types.h
+++ b/include/asm-sh64/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
30typedef __signed__ int __s32; 30typedef __signed__ int __s32;
31typedef unsigned int __u32; 31typedef unsigned int __u32;
32 32
33#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 33#if defined(__GNUC__)
34typedef __signed__ long long __s64; 34__extension__ typedef __signed__ long long __s64;
35typedef unsigned long long __u64; 35__extension__ typedef unsigned long long __u64;
36#endif 36#endif
37 37
38#endif /* __ASSEMBLY__ */ 38#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index acd06d8ff70a..5da1eef0f706 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -77,8 +77,6 @@ static struct sun_floppy_ops sun_fdops;
77#define fd_dma_mem_free(addr,size) (vfree((void *)(addr))) 77#define fd_dma_mem_free(addr,size) (vfree((void *)(addr)))
78#endif 78#endif
79 79
80#define FLOPPY_MOTOR_MASK 0x10
81
82/* XXX This isn't really correct. XXX */ 80/* XXX This isn't really correct. XXX */
83#define get_dma_residue(x) (0) 81#define get_dma_residue(x) (0)
84 82
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h
index c23e74a0eaa8..243bf8e9a058 100644
--- a/include/asm-sparc/io.h
+++ b/include/asm-sparc/io.h
@@ -310,13 +310,6 @@ extern void sbus_iounmap(volatile void __iomem *vaddr, unsigned long size);
310#define RTC_PORT(x) (rtc_port + (x)) 310#define RTC_PORT(x) (rtc_port + (x))
311#define RTC_ALWAYS_BCD 0 311#define RTC_ALWAYS_BCD 0
312 312
313/* Nothing to do */
314/* P3: Only IDE DMA may need these. XXX Verify that it still does... */
315
316#define dma_cache_inv(_start,_size) do { } while (0)
317#define dma_cache_wback(_start,_size) do { } while (0)
318#define dma_cache_wback_inv(_start,_size) do { } while (0)
319
320#endif 313#endif
321 314
322#define __ARCH_HAS_NO_PAGE_ZERO_MAPPED 1 315#define __ARCH_HAS_NO_PAGE_ZERO_MAPPED 1
diff --git a/include/asm-sparc/ipc.h b/include/asm-sparc/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-sparc/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h
index f74ba31e265b..8018f9f4d497 100644
--- a/include/asm-sparc/semaphore.h
+++ b/include/asm-sparc/semaphore.h
@@ -26,7 +26,6 @@ struct semaphore {
26 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 26 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
27 27
28#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 28#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
29#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
30 29
31static inline void sema_init (struct semaphore *sem, int val) 30static inline void sema_init (struct semaphore *sem, int val)
32{ 31{
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index 854fd3a65acf..a90dc82129d1 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -10,7 +10,6 @@ header-y += bbc.h
10header-y += bpp.h 10header-y += bpp.h
11header-y += display7seg.h 11header-y += display7seg.h
12header-y += envctrl.h 12header-y += envctrl.h
13header-y += ipc.h
14header-y += openprom.h 13header-y += openprom.h
15header-y += openpromio.h 14header-y += openpromio.h
16header-y += pconf.h 15header-y += pconf.h
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 1783239c7b40..c47f58d6c15c 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -84,8 +84,6 @@ static struct sun_floppy_ops sun_fdops;
84#define fd_free_irq() sun_fdops.fd_free_irq() 84#define fd_free_irq() sun_fdops.fd_free_irq()
85#define fd_eject(drive) sun_fdops.fd_eject(drive) 85#define fd_eject(drive) sun_fdops.fd_eject(drive)
86 86
87static int FLOPPY_MOTOR_MASK = 0x10;
88
89/* Super paranoid... */ 87/* Super paranoid... */
90#undef HAVE_DISABLE_HLT 88#undef HAVE_DISABLE_HLT
91 89
@@ -622,7 +620,6 @@ isa_done:
622 sun_fdops.fd_eject = sun_pci_fd_eject; 620 sun_fdops.fd_eject = sun_pci_fd_eject;
623 621
624 fdc_status = (unsigned long) &sun_fdc->status_82077; 622 fdc_status = (unsigned long) &sun_fdc->status_82077;
625 FLOPPY_MOTOR_MASK = 0xf0;
626 623
627 allowed_drive_mask = 0; 624 allowed_drive_mask = 0;
628 sun_floppy_types[0] = 0; 625 sun_floppy_types[0] = 0;
@@ -729,7 +726,6 @@ static unsigned long __init sun_floppy_init(void)
729 sun_fdops.fd_eject = sun_pci_fd_eject; 726 sun_fdops.fd_eject = sun_pci_fd_eject;
730 727
731 fdc_status = (unsigned long) &sun_fdc->status_82077; 728 fdc_status = (unsigned long) &sun_fdc->status_82077;
732 FLOPPY_MOTOR_MASK = 0xf0;
733 729
734 /* 730 /*
735 * XXX: Find out on which machines this is really needed. 731 * XXX: Find out on which machines this is really needed.
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index 9565a892801e..cd7ef3097ac2 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -474,12 +474,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
474#define sbus_iounmap(__addr, __size) \ 474#define sbus_iounmap(__addr, __size) \
475 release_region((unsigned long)(__addr), (__size)) 475 release_region((unsigned long)(__addr), (__size))
476 476
477/* Nothing to do */
478
479#define dma_cache_inv(_start,_size) do { } while (0)
480#define dma_cache_wback(_start,_size) do { } while (0)
481#define dma_cache_wback_inv(_start,_size) do { } while (0)
482
483/* 477/*
484 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 478 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
485 * access 479 * access
diff --git a/include/asm-sparc64/ipc.h b/include/asm-sparc64/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-sparc64/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h
index 093dcc6788db..7f7c0c4e024f 100644
--- a/include/asm-sparc64/semaphore.h
+++ b/include/asm-sparc64/semaphore.h
@@ -26,7 +26,6 @@ struct semaphore {
26 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 26 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
27 27
28#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) 28#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
29#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0)
30 29
31static inline void sema_init (struct semaphore *sem, int val) 30static inline void sema_init (struct semaphore *sem, int val)
32{ 31{
diff --git a/include/asm-sparc64/shmparam.h b/include/asm-sparc64/shmparam.h
index 911d0427de6d..8c66fded8a32 100644
--- a/include/asm-sparc64/shmparam.h
+++ b/include/asm-sparc64/shmparam.h
@@ -1,7 +1,6 @@
1/* $Id: shmparam.h,v 1.5 2001/09/24 21:17:57 kanoj Exp $ */ 1/* $Id: shmparam.h,v 1.5 2001/09/24 21:17:57 kanoj Exp $ */
2#ifndef _ASMSPARC64_SHMPARAM_H 2#ifndef _ASMSPARC64_SHMPARAM_H
3#define _ASMSPARC64_SHMPARAM_H 3#define _ASMSPARC64_SHMPARAM_H
4#ifdef __KERNEL__
5 4
6#include <asm/spitfire.h> 5#include <asm/spitfire.h>
7 6
@@ -9,5 +8,4 @@
9/* attach addr a multiple of this */ 8/* attach addr a multiple of this */
10#define SHMLBA ((PAGE_SIZE > L1DCACHE_SIZE) ? PAGE_SIZE : L1DCACHE_SIZE) 9#define SHMLBA ((PAGE_SIZE > L1DCACHE_SIZE) ? PAGE_SIZE : L1DCACHE_SIZE)
11 10
12#endif /* __KERNEL__ */
13#endif /* _ASMSPARC64_SHMPARAM_H */ 11#endif /* _ASMSPARC64_SHMPARAM_H */
diff --git a/include/asm-um/ipc.h b/include/asm-um/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-um/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-v850/ipc.h b/include/asm-v850/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-v850/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-v850/irq_regs.h b/include/asm-v850/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-v850/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-v850/semaphore.h b/include/asm-v850/semaphore.h
index 735baaf3a16e..10ed0ccf37df 100644
--- a/include/asm-v850/semaphore.h
+++ b/include/asm-v850/semaphore.h
@@ -22,7 +22,6 @@ struct semaphore {
22 struct semaphore name = __SEMAPHORE_INITIALIZER (name,count) 22 struct semaphore name = __SEMAPHORE_INITIALIZER (name,count)
23 23
24#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) 24#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1)
25#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0)
26 25
27static inline void sema_init (struct semaphore *sem, int val) 26static inline void sema_init (struct semaphore *sem, int val)
28{ 27{
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index dcef57196875..284bda882112 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
27typedef __signed__ int __s32; 27typedef __signed__ int __s32;
28typedef unsigned int __u32; 28typedef unsigned int __u32;
29 29
30#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 30#if defined(__GNUC__)
31typedef __signed__ long long __s64; 31__extension__ typedef __signed__ long long __s64;
32typedef unsigned long long __u64; 32__extension__ typedef unsigned long long __u64;
33#endif 33#endif
34 34
35#endif /* !__ASSEMBLY__ */ 35#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild
index c5e43cb39874..80744dbcfafd 100644
--- a/include/asm-x86/Kbuild
+++ b/include/asm-x86/Kbuild
@@ -1,7 +1,6 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += boot.h 3header-y += boot.h
4header-y += bootsetup.h
5header-y += debugreg_32.h 4header-y += debugreg_32.h
6header-y += debugreg_64.h 5header-y += debugreg_64.h
7header-y += debugreg.h 6header-y += debugreg.h
diff --git a/include/asm-x86/bootparam.h b/include/asm-x86/bootparam.h
index b91b01783e4b..ef67b59dbdb9 100644
--- a/include/asm-x86/bootparam.h
+++ b/include/asm-x86/bootparam.h
@@ -14,6 +14,9 @@ struct setup_header {
14 u16 root_flags; 14 u16 root_flags;
15 u32 syssize; 15 u32 syssize;
16 u16 ram_size; 16 u16 ram_size;
17#define RAMDISK_IMAGE_START_MASK 0x07FF
18#define RAMDISK_PROMPT_FLAG 0x8000
19#define RAMDISK_LOAD_FLAG 0x4000
17 u16 vid_mode; 20 u16 vid_mode;
18 u16 root_dev; 21 u16 root_dev;
19 u16 boot_flag; 22 u16 boot_flag;
diff --git a/include/asm-x86/bootsetup.h b/include/asm-x86/bootsetup.h
deleted file mode 100644
index 7b1c3ad155fd..000000000000
--- a/include/asm-x86/bootsetup.h
+++ /dev/null
@@ -1,40 +0,0 @@
1
2#ifndef _X86_64_BOOTSETUP_H
3#define _X86_64_BOOTSETUP_H 1
4
5#define BOOT_PARAM_SIZE 4096
6extern char x86_boot_params[BOOT_PARAM_SIZE];
7
8/*
9 * This is set up by the setup-routine at boot-time
10 */
11#define PARAM ((unsigned char *)x86_boot_params)
12#define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
13#define EXT_MEM_K (*(unsigned short *) (PARAM+2))
14#define ALT_MEM_K (*(unsigned int *) (PARAM+0x1e0))
15#define E820_MAP_NR (*(char*) (PARAM+E820NR))
16#define E820_MAP ((struct e820entry *) (PARAM+E820MAP))
17#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
18#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
19#define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0))
20#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
21#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8))
22#define SAVED_VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA))
23#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
24#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
25#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
26#define KERNEL_START (*(unsigned int *) (PARAM+0x214))
27#define INITRD_START (*(unsigned int *) (PARAM+0x218))
28#define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c))
29#define EDID_INFO (*(struct edid_info *) (PARAM+0x140))
30#define EDD_NR (*(unsigned char *) (PARAM+EDDNR))
31#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
32#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
33#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
34#define COMMAND_LINE boot_command_line
35
36#define RAMDISK_IMAGE_START_MASK 0x07FF
37#define RAMDISK_PROMPT_FLAG 0x8000
38#define RAMDISK_LOAD_FLAG 0x4000
39
40#endif
diff --git a/include/asm-x86/elf_32.h b/include/asm-x86/elf_32.h
index b32df3a332da..b3f694eaaf37 100644
--- a/include/asm-x86/elf_32.h
+++ b/include/asm-x86/elf_32.h
@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct
129#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) 129#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
130#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) 130#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
131#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) 131#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
132#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
132 133
133#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) 134#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
134#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) 135#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso)
@@ -152,6 +153,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
152 153
153extern unsigned int vdso_enabled; 154extern unsigned int vdso_enabled;
154 155
156/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
155#define ARCH_DLINFO \ 157#define ARCH_DLINFO \
156do if (vdso_enabled) { \ 158do if (vdso_enabled) { \
157 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ 159 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
diff --git a/include/asm-x86/floppy_32.h b/include/asm-x86/floppy_32.h
index 44ef2f55a8e9..99583b39d216 100644
--- a/include/asm-x86/floppy_32.h
+++ b/include/asm-x86/floppy_32.h
@@ -275,10 +275,6 @@ static int FDC2 = -1;
275#define N_FDC 2 275#define N_FDC 2
276#define N_DRIVE 8 276#define N_DRIVE 8
277 277
278#define FLOPPY_MOTOR_MASK 0xf0
279
280#define AUTO_DMA
281
282#define EXTRA_FLOPPY_PARAMS 278#define EXTRA_FLOPPY_PARAMS
283 279
284#endif /* __ASM_I386_FLOPPY_H */ 280#endif /* __ASM_I386_FLOPPY_H */
diff --git a/include/asm-x86/floppy_64.h b/include/asm-x86/floppy_64.h
index 6ea13c3806f3..d993380dcb47 100644
--- a/include/asm-x86/floppy_64.h
+++ b/include/asm-x86/floppy_64.h
@@ -274,10 +274,6 @@ static int FDC2 = -1;
274#define N_FDC 2 274#define N_FDC 2
275#define N_DRIVE 8 275#define N_DRIVE 8
276 276
277#define FLOPPY_MOTOR_MASK 0xf0
278
279#define AUTO_DMA
280
281#define EXTRA_FLOPPY_PARAMS 277#define EXTRA_FLOPPY_PARAMS
282 278
283#endif /* __ASM_X86_64_FLOPPY_H */ 279#endif /* __ASM_X86_64_FLOPPY_H */
diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h
index e8e0bd641120..4ea7b1ad3c1d 100644
--- a/include/asm-x86/io_32.h
+++ b/include/asm-x86/io_32.h
@@ -237,18 +237,9 @@ static inline void flush_write_buffers(void)
237 __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory"); 237 __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
238} 238}
239 239
240#define dma_cache_inv(_start,_size) flush_write_buffers()
241#define dma_cache_wback(_start,_size) flush_write_buffers()
242#define dma_cache_wback_inv(_start,_size) flush_write_buffers()
243
244#else 240#else
245 241
246/* Nothing to do */ 242#define flush_write_buffers() do { } while (0)
247
248#define dma_cache_inv(_start,_size) do { } while (0)
249#define dma_cache_wback(_start,_size) do { } while (0)
250#define dma_cache_wback_inv(_start,_size) do { } while (0)
251#define flush_write_buffers()
252 243
253#endif 244#endif
254 245
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h
index 7475095c5061..a037b0794332 100644
--- a/include/asm-x86/io_64.h
+++ b/include/asm-x86/io_64.h
@@ -249,12 +249,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c);
249 */ 249 */
250#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) 250#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
251 251
252/* Nothing to do */
253
254#define dma_cache_inv(_start,_size) do { } while (0)
255#define dma_cache_wback(_start,_size) do { } while (0)
256#define dma_cache_wback_inv(_start,_size) do { } while (0)
257
258#define flush_write_buffers() 252#define flush_write_buffers()
259 253
260extern int iommu_bio_merge; 254extern int iommu_bio_merge;
diff --git a/include/asm-x86/ipc.h b/include/asm-x86/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-x86/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h
index c7fefa6b12fd..acd4b339c49b 100644
--- a/include/asm-x86/pgtable_32.h
+++ b/include/asm-x86/pgtable_32.h
@@ -40,7 +40,7 @@ extern spinlock_t pgd_lock;
40extern struct page *pgd_list; 40extern struct page *pgd_list;
41void check_pgt_cache(void); 41void check_pgt_cache(void);
42 42
43void pmd_ctor(void *, struct kmem_cache *, unsigned long); 43void pmd_ctor(struct kmem_cache *, void *);
44void pgtable_cache_init(void); 44void pgtable_cache_init(void);
45void paging_init(void); 45void paging_init(void);
46 46
diff --git a/include/asm-x86/semaphore_32.h b/include/asm-x86/semaphore_32.h
index 4e34a468c383..835c1d751a9f 100644
--- a/include/asm-x86/semaphore_32.h
+++ b/include/asm-x86/semaphore_32.h
@@ -59,7 +59,6 @@ struct semaphore {
59 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 59 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
60 60
61#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 61#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
62#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
63 62
64static inline void sema_init (struct semaphore *sem, int val) 63static inline void sema_init (struct semaphore *sem, int val)
65{ 64{
diff --git a/include/asm-x86/semaphore_64.h b/include/asm-x86/semaphore_64.h
index 1194888536b9..79694306bf7d 100644
--- a/include/asm-x86/semaphore_64.h
+++ b/include/asm-x86/semaphore_64.h
@@ -60,7 +60,6 @@ struct semaphore {
60 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 60 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
61 61
62#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 62#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
63#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
64 63
65static inline void sema_init (struct semaphore *sem, int val) 64static inline void sema_init (struct semaphore *sem, int val)
66{ 65{
diff --git a/include/asm-x86/setup_32.h b/include/asm-x86/setup_32.h
index 7862fe858a9e..7a57ca8a1793 100644
--- a/include/asm-x86/setup_32.h
+++ b/include/asm-x86/setup_32.h
@@ -34,35 +34,6 @@
34 */ 34 */
35extern struct boot_params boot_params; 35extern struct boot_params boot_params;
36 36
37#define PARAM ((char *)&boot_params)
38#define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
39#define EXT_MEM_K (*(unsigned short *) (PARAM+2))
40#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0))
41#define E820_MAP_NR (*(char*) (PARAM+E820NR))
42#define E820_MAP ((struct e820entry *) (PARAM+E820MAP))
43#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
44#define IST_INFO (*(struct ist_info *) (PARAM+0x60))
45#define SYS_DESC_TABLE (*(struct sys_desc_table *)(PARAM+0xa0))
46#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4)))
47#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8)))
48#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc)))
49#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0)))
50#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4)))
51#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
52#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8))
53#define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA))
54#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
55#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
56#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
57#define KERNEL_START (*(unsigned long *) (PARAM+0x214))
58#define INITRD_START (*(unsigned long *) (PARAM+0x218))
59#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
60#define EDID_INFO (*(struct edid_info *) (PARAM+0x140))
61#define EDD_NR (*(unsigned char *) (PARAM+EDDNR))
62#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
63#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
64#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
65
66/* 37/*
67 * Do NOT EVER look at the BIOS memory size location. 38 * Do NOT EVER look at the BIOS memory size location.
68 * It does not work on many machines. 39 * It does not work on many machines.
diff --git a/include/asm-x86/setup_64.h b/include/asm-x86/setup_64.h
index eaeff73d6c10..a04aadcccf67 100644
--- a/include/asm-x86/setup_64.h
+++ b/include/asm-x86/setup_64.h
@@ -3,4 +3,17 @@
3 3
4#define COMMAND_LINE_SIZE 2048 4#define COMMAND_LINE_SIZE 2048
5 5
6#ifdef __KERNEL__
7
8#ifndef __ASSEMBLY__
9#include <asm/bootparam.h>
10
11/*
12 * This is set up by the setup-routine at boot-time
13 */
14extern struct boot_params boot_params;
15
16#endif /* not __ASSEMBLY__ */
17#endif /* __KERNEL__ */
18
6#endif 19#endif
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h
index e7e5d426fef5..d84e593b7dfc 100644
--- a/include/asm-x86/system_32.h
+++ b/include/asm-x86/system_32.h
@@ -7,6 +7,7 @@
7#include <asm/cmpxchg.h> 7#include <asm/cmpxchg.h>
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
10 11
11struct task_struct; /* one of the stranger aspects of C forward declarations.. */ 12struct task_struct; /* one of the stranger aspects of C forward declarations.. */
12extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); 13extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
diff --git a/include/asm-x86/types_32.h b/include/asm-x86/types_32.h
index ad0a55bd782f..faca1922c4c3 100644
--- a/include/asm-x86/types_32.h
+++ b/include/asm-x86/types_32.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
19typedef __signed__ int __s32; 19typedef __signed__ int __s32;
20typedef unsigned int __u32; 20typedef unsigned int __u32;
21 21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 22#if defined(__GNUC__)
23typedef __signed__ long long __s64; 23__extension__ typedef __signed__ long long __s64;
24typedef unsigned long long __u64; 24__extension__ typedef unsigned long long __u64;
25#endif 25#endif
26 26
27#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h
index f10c3487cd4c..3e04167cd9dc 100644
--- a/include/asm-xtensa/semaphore.h
+++ b/include/asm-xtensa/semaphore.h
@@ -33,7 +33,6 @@ struct semaphore {
33 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) 33 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
34 34
35#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 35#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
36#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
37 36
38static inline void sema_init (struct semaphore *sem, int val) 37static inline void sema_init (struct semaphore *sem, int val)
39{ 38{
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index f1e84526f999..b27d841a8eb7 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -38,9 +38,9 @@ typedef unsigned short __u16;
38typedef __signed__ int __s32; 38typedef __signed__ int __s32;
39typedef unsigned int __u32; 39typedef unsigned int __u32;
40 40
41#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 41#if defined(__GNUC__)
42typedef __signed__ long long __s64; 42__extension__ typedef __signed__ long long __s64;
43typedef unsigned long long __u64; 43__extension__ typedef unsigned long long __u64;
44#endif 44#endif
45 45
46/* 46/*
diff --git a/include/keys/rxrpc-type.h b/include/keys/rxrpc-type.h
index e2ee73aef0ee..4ea429b18750 100644
--- a/include/keys/rxrpc-type.h
+++ b/include/keys/rxrpc-type.h
@@ -19,4 +19,6 @@
19 */ 19 */
20extern struct key_type key_type_rxrpc; 20extern struct key_type key_type_rxrpc;
21 21
22extern struct key *rxrpc_get_null_key(const char *);
23
22#endif /* _KEYS_USER_TYPE_H */ 24#endif /* _KEYS_USER_TYPE_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 025af706d114..7ac8303c8471 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -46,7 +46,6 @@ header-y += chio.h
46header-y += coda_psdev.h 46header-y += coda_psdev.h
47header-y += coff.h 47header-y += coff.h
48header-y += comstats.h 48header-y += comstats.h
49header-y += consolemap.h
50header-y += const.h 49header-y += const.h
51header-y += cycx_cfm.h 50header-y += cycx_cfm.h
52header-y += dlm_device.h 51header-y += dlm_device.h
@@ -283,6 +282,7 @@ unifdef-y += nfs_idmap.h
283unifdef-y += n_r3964.h 282unifdef-y += n_r3964.h
284unifdef-y += nubus.h 283unifdef-y += nubus.h
285unifdef-y += nvram.h 284unifdef-y += nvram.h
285unifdef-y += oom.h
286unifdef-y += parport.h 286unifdef-y += parport.h
287unifdef-y += patchkey.h 287unifdef-y += patchkey.h
288unifdef-y += pci.h 288unifdef-y += pci.h
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
new file mode 100644
index 000000000000..06023393fba9
--- /dev/null
+++ b/include/linux/atmel-ssc.h
@@ -0,0 +1,312 @@
1#ifndef __INCLUDE_ATMEL_SSC_H
2#define __INCLUDE_ATMEL_SSC_H
3
4#include <linux/platform_device.h>
5#include <linux/list.h>
6
7struct ssc_device {
8 struct list_head list;
9 void __iomem *regs;
10 struct platform_device *pdev;
11 struct clk *clk;
12 int user;
13 int irq;
14};
15
16struct ssc_device * __must_check ssc_request(unsigned int ssc_num);
17void ssc_free(struct ssc_device *ssc);
18
19/* SSC register offsets */
20
21/* SSC Control Register */
22#define SSC_CR 0x00000000
23#define SSC_CR_RXDIS_SIZE 1
24#define SSC_CR_RXDIS_OFFSET 1
25#define SSC_CR_RXEN_SIZE 1
26#define SSC_CR_RXEN_OFFSET 0
27#define SSC_CR_SWRST_SIZE 1
28#define SSC_CR_SWRST_OFFSET 15
29#define SSC_CR_TXDIS_SIZE 1
30#define SSC_CR_TXDIS_OFFSET 9
31#define SSC_CR_TXEN_SIZE 1
32#define SSC_CR_TXEN_OFFSET 8
33
34/* SSC Clock Mode Register */
35#define SSC_CMR 0x00000004
36#define SSC_CMR_DIV_SIZE 12
37#define SSC_CMR_DIV_OFFSET 0
38
39/* SSC Receive Clock Mode Register */
40#define SSC_RCMR 0x00000010
41#define SSC_RCMR_CKG_SIZE 2
42#define SSC_RCMR_CKG_OFFSET 6
43#define SSC_RCMR_CKI_SIZE 1
44#define SSC_RCMR_CKI_OFFSET 5
45#define SSC_RCMR_CKO_SIZE 3
46#define SSC_RCMR_CKO_OFFSET 2
47#define SSC_RCMR_CKS_SIZE 2
48#define SSC_RCMR_CKS_OFFSET 0
49#define SSC_RCMR_PERIOD_SIZE 8
50#define SSC_RCMR_PERIOD_OFFSET 24
51#define SSC_RCMR_START_SIZE 4
52#define SSC_RCMR_START_OFFSET 8
53#define SSC_RCMR_STOP_SIZE 1
54#define SSC_RCMR_STOP_OFFSET 12
55#define SSC_RCMR_STTDLY_SIZE 8
56#define SSC_RCMR_STTDLY_OFFSET 16
57
58/* SSC Receive Frame Mode Register */
59#define SSC_RFMR 0x00000014
60#define SSC_RFMR_DATLEN_SIZE 5
61#define SSC_RFMR_DATLEN_OFFSET 0
62#define SSC_RFMR_DATNB_SIZE 4
63#define SSC_RFMR_DATNB_OFFSET 8
64#define SSC_RFMR_FSEDGE_SIZE 1
65#define SSC_RFMR_FSEDGE_OFFSET 24
66#define SSC_RFMR_FSLEN_SIZE 4
67#define SSC_RFMR_FSLEN_OFFSET 16
68#define SSC_RFMR_FSOS_SIZE 4
69#define SSC_RFMR_FSOS_OFFSET 20
70#define SSC_RFMR_LOOP_SIZE 1
71#define SSC_RFMR_LOOP_OFFSET 5
72#define SSC_RFMR_MSBF_SIZE 1
73#define SSC_RFMR_MSBF_OFFSET 7
74
75/* SSC Transmit Clock Mode Register */
76#define SSC_TCMR 0x00000018
77#define SSC_TCMR_CKG_SIZE 2
78#define SSC_TCMR_CKG_OFFSET 6
79#define SSC_TCMR_CKI_SIZE 1
80#define SSC_TCMR_CKI_OFFSET 5
81#define SSC_TCMR_CKO_SIZE 3
82#define SSC_TCMR_CKO_OFFSET 2
83#define SSC_TCMR_CKS_SIZE 2
84#define SSC_TCMR_CKS_OFFSET 0
85#define SSC_TCMR_PERIOD_SIZE 8
86#define SSC_TCMR_PERIOD_OFFSET 24
87#define SSC_TCMR_START_SIZE 4
88#define SSC_TCMR_START_OFFSET 8
89#define SSC_TCMR_STTDLY_SIZE 8
90#define SSC_TCMR_STTDLY_OFFSET 16
91
92/* SSC Transmit Frame Mode Register */
93#define SSC_TFMR 0x0000001c
94#define SSC_TFMR_DATDEF_SIZE 1
95#define SSC_TFMR_DATDEF_OFFSET 5
96#define SSC_TFMR_DATLEN_SIZE 5
97#define SSC_TFMR_DATLEN_OFFSET 0
98#define SSC_TFMR_DATNB_SIZE 4
99#define SSC_TFMR_DATNB_OFFSET 8
100#define SSC_TFMR_FSDEN_SIZE 1
101#define SSC_TFMR_FSDEN_OFFSET 23
102#define SSC_TFMR_FSEDGE_SIZE 1
103#define SSC_TFMR_FSEDGE_OFFSET 24
104#define SSC_TFMR_FSLEN_SIZE 4
105#define SSC_TFMR_FSLEN_OFFSET 16
106#define SSC_TFMR_FSOS_SIZE 3
107#define SSC_TFMR_FSOS_OFFSET 20
108#define SSC_TFMR_MSBF_SIZE 1
109#define SSC_TFMR_MSBF_OFFSET 7
110
111/* SSC Receive Hold Register */
112#define SSC_RHR 0x00000020
113#define SSC_RHR_RDAT_SIZE 32
114#define SSC_RHR_RDAT_OFFSET 0
115
116/* SSC Transmit Hold Register */
117#define SSC_THR 0x00000024
118#define SSC_THR_TDAT_SIZE 32
119#define SSC_THR_TDAT_OFFSET 0
120
121/* SSC Receive Sync. Holding Register */
122#define SSC_RSHR 0x00000030
123#define SSC_RSHR_RSDAT_SIZE 16
124#define SSC_RSHR_RSDAT_OFFSET 0
125
126/* SSC Transmit Sync. Holding Register */
127#define SSC_TSHR 0x00000034
128#define SSC_TSHR_TSDAT_SIZE 16
129#define SSC_TSHR_RSDAT_OFFSET 0
130
131/* SSC Receive Compare 0 Register */
132#define SSC_RC0R 0x00000038
133#define SSC_RC0R_CP0_SIZE 16
134#define SSC_RC0R_CP0_OFFSET 0
135
136/* SSC Receive Compare 1 Register */
137#define SSC_RC1R 0x0000003c
138#define SSC_RC1R_CP1_SIZE 16
139#define SSC_RC1R_CP1_OFFSET 0
140
141/* SSC Status Register */
142#define SSC_SR 0x00000040
143#define SSC_SR_CP0_SIZE 1
144#define SSC_SR_CP0_OFFSET 8
145#define SSC_SR_CP1_SIZE 1
146#define SSC_SR_CP1_OFFSET 9
147#define SSC_SR_ENDRX_SIZE 1
148#define SSC_SR_ENDRX_OFFSET 6
149#define SSC_SR_ENDTX_SIZE 1
150#define SSC_SR_ENDTX_OFFSET 2
151#define SSC_SR_OVRUN_SIZE 1
152#define SSC_SR_OVRUN_OFFSET 5
153#define SSC_SR_RXBUFF_SIZE 1
154#define SSC_SR_RXBUFF_OFFSET 7
155#define SSC_SR_RXEN_SIZE 1
156#define SSC_SR_RXEN_OFFSET 17
157#define SSC_SR_RXRDY_SIZE 1
158#define SSC_SR_RXRDY_OFFSET 4
159#define SSC_SR_RXSYN_SIZE 1
160#define SSC_SR_RXSYN_OFFSET 11
161#define SSC_SR_TXBUFE_SIZE 1
162#define SSC_SR_TXBUFE_OFFSET 3
163#define SSC_SR_TXEMPTY_SIZE 1
164#define SSC_SR_TXEMPTY_OFFSET 1
165#define SSC_SR_TXEN_SIZE 1
166#define SSC_SR_TXEN_OFFSET 16
167#define SSC_SR_TXRDY_SIZE 1
168#define SSC_SR_TXRDY_OFFSET 0
169#define SSC_SR_TXSYN_SIZE 1
170#define SSC_SR_TXSYN_OFFSET 10
171
172/* SSC Interrupt Enable Register */
173#define SSC_IER 0x00000044
174#define SSC_IER_CP0_SIZE 1
175#define SSC_IER_CP0_OFFSET 8
176#define SSC_IER_CP1_SIZE 1
177#define SSC_IER_CP1_OFFSET 9
178#define SSC_IER_ENDRX_SIZE 1
179#define SSC_IER_ENDRX_OFFSET 6
180#define SSC_IER_ENDTX_SIZE 1
181#define SSC_IER_ENDTX_OFFSET 2
182#define SSC_IER_OVRUN_SIZE 1
183#define SSC_IER_OVRUN_OFFSET 5
184#define SSC_IER_RXBUFF_SIZE 1
185#define SSC_IER_RXBUFF_OFFSET 7
186#define SSC_IER_RXRDY_SIZE 1
187#define SSC_IER_RXRDY_OFFSET 4
188#define SSC_IER_RXSYN_SIZE 1
189#define SSC_IER_RXSYN_OFFSET 11
190#define SSC_IER_TXBUFE_SIZE 1
191#define SSC_IER_TXBUFE_OFFSET 3
192#define SSC_IER_TXEMPTY_SIZE 1
193#define SSC_IER_TXEMPTY_OFFSET 1
194#define SSC_IER_TXRDY_SIZE 1
195#define SSC_IER_TXRDY_OFFSET 0
196#define SSC_IER_TXSYN_SIZE 1
197#define SSC_IER_TXSYN_OFFSET 10
198
199/* SSC Interrupt Disable Register */
200#define SSC_IDR 0x00000048
201#define SSC_IDR_CP0_SIZE 1
202#define SSC_IDR_CP0_OFFSET 8
203#define SSC_IDR_CP1_SIZE 1
204#define SSC_IDR_CP1_OFFSET 9
205#define SSC_IDR_ENDRX_SIZE 1
206#define SSC_IDR_ENDRX_OFFSET 6
207#define SSC_IDR_ENDTX_SIZE 1
208#define SSC_IDR_ENDTX_OFFSET 2
209#define SSC_IDR_OVRUN_SIZE 1
210#define SSC_IDR_OVRUN_OFFSET 5
211#define SSC_IDR_RXBUFF_SIZE 1
212#define SSC_IDR_RXBUFF_OFFSET 7
213#define SSC_IDR_RXRDY_SIZE 1
214#define SSC_IDR_RXRDY_OFFSET 4
215#define SSC_IDR_RXSYN_SIZE 1
216#define SSC_IDR_RXSYN_OFFSET 11
217#define SSC_IDR_TXBUFE_SIZE 1
218#define SSC_IDR_TXBUFE_OFFSET 3
219#define SSC_IDR_TXEMPTY_SIZE 1
220#define SSC_IDR_TXEMPTY_OFFSET 1
221#define SSC_IDR_TXRDY_SIZE 1
222#define SSC_IDR_TXRDY_OFFSET 0
223#define SSC_IDR_TXSYN_SIZE 1
224#define SSC_IDR_TXSYN_OFFSET 10
225
226/* SSC Interrupt Mask Register */
227#define SSC_IMR 0x0000004c
228#define SSC_IMR_CP0_SIZE 1
229#define SSC_IMR_CP0_OFFSET 8
230#define SSC_IMR_CP1_SIZE 1
231#define SSC_IMR_CP1_OFFSET 9
232#define SSC_IMR_ENDRX_SIZE 1
233#define SSC_IMR_ENDRX_OFFSET 6
234#define SSC_IMR_ENDTX_SIZE 1
235#define SSC_IMR_ENDTX_OFFSET 2
236#define SSC_IMR_OVRUN_SIZE 1
237#define SSC_IMR_OVRUN_OFFSET 5
238#define SSC_IMR_RXBUFF_SIZE 1
239#define SSC_IMR_RXBUFF_OFFSET 7
240#define SSC_IMR_RXRDY_SIZE 1
241#define SSC_IMR_RXRDY_OFFSET 4
242#define SSC_IMR_RXSYN_SIZE 1
243#define SSC_IMR_RXSYN_OFFSET 11
244#define SSC_IMR_TXBUFE_SIZE 1
245#define SSC_IMR_TXBUFE_OFFSET 3
246#define SSC_IMR_TXEMPTY_SIZE 1
247#define SSC_IMR_TXEMPTY_OFFSET 1
248#define SSC_IMR_TXRDY_SIZE 1
249#define SSC_IMR_TXRDY_OFFSET 0
250#define SSC_IMR_TXSYN_SIZE 1
251#define SSC_IMR_TXSYN_OFFSET 10
252
253/* SSC PDC Receive Pointer Register */
254#define SSC_PDC_RPR 0x00000100
255
256/* SSC PDC Receive Counter Register */
257#define SSC_PDC_RCR 0x00000104
258
259/* SSC PDC Transmit Pointer Register */
260#define SSC_PDC_TPR 0x00000108
261
262/* SSC PDC Receive Next Pointer Register */
263#define SSC_PDC_RNPR 0x00000110
264
265/* SSC PDC Receive Next Counter Register */
266#define SSC_PDC_RNCR 0x00000114
267
268/* SSC PDC Transmit Counter Register */
269#define SSC_PDC_TCR 0x0000010c
270
271/* SSC PDC Transmit Next Pointer Register */
272#define SSC_PDC_TNPR 0x00000118
273
274/* SSC PDC Transmit Next Counter Register */
275#define SSC_PDC_TNCR 0x0000011c
276
277/* SSC PDC Transfer Control Register */
278#define SSC_PDC_PTCR 0x00000120
279#define SSC_PDC_PTCR_RXTDIS_SIZE 1
280#define SSC_PDC_PTCR_RXTDIS_OFFSET 1
281#define SSC_PDC_PTCR_RXTEN_SIZE 1
282#define SSC_PDC_PTCR_RXTEN_OFFSET 0
283#define SSC_PDC_PTCR_TXTDIS_SIZE 1
284#define SSC_PDC_PTCR_TXTDIS_OFFSET 9
285#define SSC_PDC_PTCR_TXTEN_SIZE 1
286#define SSC_PDC_PTCR_TXTEN_OFFSET 8
287
288/* SSC PDC Transfer Status Register */
289#define SSC_PDC_PTSR 0x00000124
290#define SSC_PDC_PTSR_RXTEN_SIZE 1
291#define SSC_PDC_PTSR_RXTEN_OFFSET 0
292#define SSC_PDC_PTSR_TXTEN_SIZE 1
293#define SSC_PDC_PTSR_TXTEN_OFFSET 8
294
295/* Bit manipulation macros */
296#define SSC_BIT(name) \
297 (1 << SSC_##name##_OFFSET)
298#define SSC_BF(name, value) \
299 (((value) & ((1 << SSC_##name##_SIZE) - 1)) \
300 << SSC_##name##_OFFSET)
301#define SSC_BFEXT(name, value) \
302 (((value) >> SSC_##name##_OFFSET) \
303 & ((1 << SSC_##name##_SIZE) - 1))
304#define SSC_BFINS(name, value, old) \
305 (((old) & ~(((1 << SSC_##name##_SIZE) - 1) \
306 << SSC_##name##_OFFSET)) | SSC_BF(name, value))
307
308/* Register access macros */
309#define ssc_readl(base, reg) __raw_readl(base + SSC_##reg)
310#define ssc_writel(base, reg, value) __raw_writel((value), base + SSC_##reg)
311
312#endif /* __INCLUDE_ATMEL_SSC_H */
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index d2bc0d66e65d..ad895455ab72 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -26,6 +26,8 @@
26 26
27#define AT_SECURE 23 /* secure mode boolean */ 27#define AT_SECURE 23 /* secure mode boolean */
28 28
29#define AT_VECTOR_SIZE 44 /* Size of auxiliary table. */ 29#ifdef __KERNEL__
30#define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */
31#endif
30 32
31#endif /* _LINUX_AUXVEC_H */ 33#endif /* _LINUX_AUXVEC_H */
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 7011d6255593..48a62baace58 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -8,6 +8,9 @@
8#ifndef _LINUX_BACKING_DEV_H 8#ifndef _LINUX_BACKING_DEV_H
9#define _LINUX_BACKING_DEV_H 9#define _LINUX_BACKING_DEV_H
10 10
11#include <linux/percpu_counter.h>
12#include <linux/log2.h>
13#include <linux/proportions.h>
11#include <asm/atomic.h> 14#include <asm/atomic.h>
12 15
13struct page; 16struct page;
@@ -24,6 +27,14 @@ enum bdi_state {
24 27
25typedef int (congested_fn)(void *, int); 28typedef int (congested_fn)(void *, int);
26 29
30enum bdi_stat_item {
31 BDI_RECLAIMABLE,
32 BDI_WRITEBACK,
33 NR_BDI_STAT_ITEMS
34};
35
36#define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids)))
37
27struct backing_dev_info { 38struct backing_dev_info {
28 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ 39 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
29 unsigned long state; /* Always use atomic bitops on this */ 40 unsigned long state; /* Always use atomic bitops on this */
@@ -32,8 +43,90 @@ struct backing_dev_info {
32 void *congested_data; /* Pointer to aux data for congested func */ 43 void *congested_data; /* Pointer to aux data for congested func */
33 void (*unplug_io_fn)(struct backing_dev_info *, struct page *); 44 void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
34 void *unplug_io_data; 45 void *unplug_io_data;
46
47 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
48
49 struct prop_local_percpu completions;
50 int dirty_exceeded;
35}; 51};
36 52
53int bdi_init(struct backing_dev_info *bdi);
54void bdi_destroy(struct backing_dev_info *bdi);
55
56static inline void __add_bdi_stat(struct backing_dev_info *bdi,
57 enum bdi_stat_item item, s64 amount)
58{
59 __percpu_counter_add(&bdi->bdi_stat[item], amount, BDI_STAT_BATCH);
60}
61
62static inline void __inc_bdi_stat(struct backing_dev_info *bdi,
63 enum bdi_stat_item item)
64{
65 __add_bdi_stat(bdi, item, 1);
66}
67
68static inline void inc_bdi_stat(struct backing_dev_info *bdi,
69 enum bdi_stat_item item)
70{
71 unsigned long flags;
72
73 local_irq_save(flags);
74 __inc_bdi_stat(bdi, item);
75 local_irq_restore(flags);
76}
77
78static inline void __dec_bdi_stat(struct backing_dev_info *bdi,
79 enum bdi_stat_item item)
80{
81 __add_bdi_stat(bdi, item, -1);
82}
83
84static inline void dec_bdi_stat(struct backing_dev_info *bdi,
85 enum bdi_stat_item item)
86{
87 unsigned long flags;
88
89 local_irq_save(flags);
90 __dec_bdi_stat(bdi, item);
91 local_irq_restore(flags);
92}
93
94static inline s64 bdi_stat(struct backing_dev_info *bdi,
95 enum bdi_stat_item item)
96{
97 return percpu_counter_read_positive(&bdi->bdi_stat[item]);
98}
99
100static inline s64 __bdi_stat_sum(struct backing_dev_info *bdi,
101 enum bdi_stat_item item)
102{
103 return percpu_counter_sum_positive(&bdi->bdi_stat[item]);
104}
105
106static inline s64 bdi_stat_sum(struct backing_dev_info *bdi,
107 enum bdi_stat_item item)
108{
109 s64 sum;
110 unsigned long flags;
111
112 local_irq_save(flags);
113 sum = __bdi_stat_sum(bdi, item);
114 local_irq_restore(flags);
115
116 return sum;
117}
118
119/*
120 * maximal error of a stat counter.
121 */
122static inline unsigned long bdi_stat_error(struct backing_dev_info *bdi)
123{
124#ifdef CONFIG_SMP
125 return nr_cpu_ids * BDI_STAT_BATCH;
126#else
127 return 1;
128#endif
129}
37 130
38/* 131/*
39 * Flags in backing_dev_info::capability 132 * Flags in backing_dev_info::capability
@@ -93,7 +186,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
93void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 186void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
94void set_bdi_congested(struct backing_dev_info *bdi, int rw); 187void set_bdi_congested(struct backing_dev_info *bdi, int rw);
95long congestion_wait(int rw, long timeout); 188long congestion_wait(int rw, long timeout);
96void congestion_end(int rw);
97 189
98#define bdi_cap_writeback_dirty(bdi) \ 190#define bdi_cap_writeback_dirty(bdi) \
99 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) 191 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 91c8c07fe8b7..b7fc55ec8d48 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -37,7 +37,8 @@ struct linux_binprm{
37 int sh_bang; 37 int sh_bang;
38 struct file * file; 38 struct file * file;
39 int e_uid, e_gid; 39 int e_uid, e_gid;
40 kernel_cap_t cap_inheritable, cap_permitted, cap_effective; 40 kernel_cap_t cap_inheritable, cap_permitted;
41 bool cap_effective;
41 void *security; 42 void *security;
42 int argc, envc; 43 int argc, envc;
43 char * filename; /* Name of binary as seen by procps */ 44 char * filename; /* Name of binary as seen by procps */
@@ -63,17 +64,17 @@ struct linux_binprm{
63 * linux accepts. 64 * linux accepts.
64 */ 65 */
65struct linux_binfmt { 66struct linux_binfmt {
66 struct linux_binfmt * next; 67 struct list_head lh;
67 struct module *module; 68 struct module *module;
68 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); 69 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
69 int (*load_shlib)(struct file *); 70 int (*load_shlib)(struct file *);
70 int (*core_dump)(long signr, struct pt_regs * regs, struct file * file); 71 int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit);
71 unsigned long min_coredump; /* minimal dump size */ 72 unsigned long min_coredump; /* minimal dump size */
72 int hasvdso; 73 int hasvdso;
73}; 74};
74 75
75extern int register_binfmt(struct linux_binfmt *); 76extern int register_binfmt(struct linux_binfmt *);
76extern int unregister_binfmt(struct linux_binfmt *); 77extern void unregister_binfmt(struct linux_binfmt *);
77 78
78extern int prepare_binprm(struct linux_binprm *); 79extern int prepare_binprm(struct linux_binprm *);
79extern int __must_check remove_arg_zero(struct linux_binprm *); 80extern int __must_check remove_arg_zero(struct linux_binprm *);
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 2dfa58555934..8961e7fb755c 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -1,14 +1,14 @@
1/* 1/*
2 * This is <linux/capability.h> 2 * This is <linux/capability.h>
3 * 3 *
4 * Andrew G. Morgan <morgan@transmeta.com> 4 * Andrew G. Morgan <morgan@kernel.org>
5 * Alexander Kjeldaas <astor@guardian.no> 5 * Alexander Kjeldaas <astor@guardian.no>
6 * with help from Aleph1, Roland Buresund and Andrew Main. 6 * with help from Aleph1, Roland Buresund and Andrew Main.
7 * 7 *
8 * See here for the libcap library ("POSIX draft" compliance): 8 * See here for the libcap library ("POSIX draft" compliance):
9 * 9 *
10 * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/ 10 * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
11 */ 11 */
12 12
13#ifndef _LINUX_CAPABILITY_H 13#ifndef _LINUX_CAPABILITY_H
14#define _LINUX_CAPABILITY_H 14#define _LINUX_CAPABILITY_H
@@ -28,23 +28,41 @@ struct task_struct;
28 following structure to such a composite is better handled in a user 28 following structure to such a composite is better handled in a user
29 library since the draft standard requires the use of malloc/free 29 library since the draft standard requires the use of malloc/free
30 etc.. */ 30 etc.. */
31 31
32#define _LINUX_CAPABILITY_VERSION 0x19980330 32#define _LINUX_CAPABILITY_VERSION 0x19980330
33 33
34typedef struct __user_cap_header_struct { 34typedef struct __user_cap_header_struct {
35 __u32 version; 35 __u32 version;
36 int pid; 36 int pid;
37} __user *cap_user_header_t; 37} __user *cap_user_header_t;
38 38
39typedef struct __user_cap_data_struct { 39typedef struct __user_cap_data_struct {
40 __u32 effective; 40 __u32 effective;
41 __u32 permitted; 41 __u32 permitted;
42 __u32 inheritable; 42 __u32 inheritable;
43} __user *cap_user_data_t; 43} __user *cap_user_data_t;
44
45#ifdef __KERNEL__
46 44
47#include <asm/current.h> 45#define XATTR_CAPS_SUFFIX "capability"
46#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
47
48#define XATTR_CAPS_SZ (3*sizeof(__le32))
49#define VFS_CAP_REVISION_MASK 0xFF000000
50#define VFS_CAP_REVISION_1 0x01000000
51
52#define VFS_CAP_REVISION VFS_CAP_REVISION_1
53
54#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
55#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
56
57struct vfs_cap_data {
58 __u32 magic_etc; /* Little endian */
59 struct {
60 __u32 permitted; /* Little endian */
61 __u32 inheritable; /* Little endian */
62 } data[1];
63};
64
65#ifdef __KERNEL__
48 66
49/* #define STRICT_CAP_T_TYPECHECKS */ 67/* #define STRICT_CAP_T_TYPECHECKS */
50 68
@@ -59,7 +77,7 @@ typedef struct kernel_cap_struct {
59typedef __u32 kernel_cap_t; 77typedef __u32 kernel_cap_t;
60 78
61#endif 79#endif
62 80
63#define _USER_CAP_HEADER_SIZE (2*sizeof(__u32)) 81#define _USER_CAP_HEADER_SIZE (2*sizeof(__u32))
64#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) 82#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
65 83
@@ -67,7 +85,7 @@ typedef __u32 kernel_cap_t;
67 85
68 86
69/** 87/**
70 ** POSIX-draft defined capabilities. 88 ** POSIX-draft defined capabilities.
71 **/ 89 **/
72 90
73/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this 91/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
@@ -87,7 +105,7 @@ typedef __u32 kernel_cap_t;
87 defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */ 105 defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
88 106
89#define CAP_DAC_READ_SEARCH 2 107#define CAP_DAC_READ_SEARCH 2
90 108
91/* Overrides all restrictions about allowed operations on files, where 109/* Overrides all restrictions about allowed operations on files, where
92 file owner ID must be equal to the user ID, except where CAP_FSETID 110 file owner ID must be equal to the user ID, except where CAP_FSETID
93 is applicable. It doesn't override MAC and DAC restrictions. */ 111 is applicable. It doesn't override MAC and DAC restrictions. */
@@ -257,7 +275,7 @@ typedef __u32 kernel_cap_t;
257/* Override reserved space on ext2 filesystem */ 275/* Override reserved space on ext2 filesystem */
258/* Modify data journaling mode on ext3 filesystem (uses journaling 276/* Modify data journaling mode on ext3 filesystem (uses journaling
259 resources) */ 277 resources) */
260/* NOTE: ext2 honors fsuid when checking for resource overrides, so 278/* NOTE: ext2 honors fsuid when checking for resource overrides, so
261 you can override using fsuid too */ 279 you can override using fsuid too */
262/* Override size restrictions on IPC message queues */ 280/* Override size restrictions on IPC message queues */
263/* Allow more than 64hz interrupts from the real-time clock */ 281/* Allow more than 64hz interrupts from the real-time clock */
@@ -289,8 +307,10 @@ typedef __u32 kernel_cap_t;
289 307
290#define CAP_AUDIT_CONTROL 30 308#define CAP_AUDIT_CONTROL 30
291 309
310#define CAP_SETFCAP 31
311
292#ifdef __KERNEL__ 312#ifdef __KERNEL__
293/* 313/*
294 * Bounding set 314 * Bounding set
295 */ 315 */
296extern kernel_cap_t cap_bset; 316extern kernel_cap_t cap_bset;
@@ -298,7 +318,7 @@ extern kernel_cap_t cap_bset;
298/* 318/*
299 * Internal kernel functions only 319 * Internal kernel functions only
300 */ 320 */
301 321
302#ifdef STRICT_CAP_T_TYPECHECKS 322#ifdef STRICT_CAP_T_TYPECHECKS
303 323
304#define to_cap_t(x) { x } 324#define to_cap_t(x) { x }
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 03ec2311fb29..acd583384bd9 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -1,4 +1,6 @@
1/* Never include this file directly. Include <linux/compiler.h> instead. */ 1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
3#endif
2 4
3/* 5/*
4 * Common definitions for all gcc versions go here. 6 * Common definitions for all gcc versions go here.
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
index a9e2863c2dbf..2d8c0f48f55e 100644
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -1,4 +1,6 @@
1/* Never include this file directly. Include <linux/compiler.h> instead. */ 1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
3#endif
2 4
3/* These definitions are for GCC v3.x. */ 5/* These definitions are for GCC v3.x. */
4#include <linux/compiler-gcc.h> 6#include <linux/compiler-gcc.h>
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 14f7494280f0..ee7ca5de970c 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -1,4 +1,6 @@
1/* Never include this file directly. Include <linux/compiler.h> instead. */ 1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
3#endif
2 4
3/* These definitions are for GCC v4.x. */ 5/* These definitions are for GCC v4.x. */
4#include <linux/compiler-gcc.h> 6#include <linux/compiler-gcc.h>
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index b769961e6f23..d8e636e5607d 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -1,4 +1,6 @@
1/* Never include this file directly. Include <linux/compiler.h> instead. */ 1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
3#endif
2 4
3#ifdef __ECC 5#ifdef __ECC
4 6
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h
index 06b2768c603f..e2bf7e5db39a 100644
--- a/include/linux/consolemap.h
+++ b/include/linux/consolemap.h
@@ -16,4 +16,5 @@ extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode);
16extern unsigned short *set_translate(int m, struct vc_data *vc); 16extern unsigned short *set_translate(int m, struct vc_data *vc);
17extern int conv_uni_to_pc(struct vc_data *conp, long ucs); 17extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
18extern u32 conv_8bit_to_uni(unsigned char c); 18extern u32 conv_8bit_to_uni(unsigned char c);
19extern int conv_uni_to_8bit(u32 uni);
19void console_map_init(void); 20void console_map_init(void);
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 9e633ea103ce..ea44d2e768a0 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -45,7 +45,8 @@ static int inline cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
45 __cpuset_zone_allowed_hardwall(z, gfp_mask); 45 __cpuset_zone_allowed_hardwall(z, gfp_mask);
46} 46}
47 47
48extern int cpuset_excl_nodes_overlap(const struct task_struct *p); 48extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
49 const struct task_struct *tsk2);
49 50
50#define cpuset_memory_pressure_bump() \ 51#define cpuset_memory_pressure_bump() \
51 do { \ 52 do { \
@@ -113,7 +114,8 @@ static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
113 return 1; 114 return 1;
114} 115}
115 116
116static inline int cpuset_excl_nodes_overlap(const struct task_struct *p) 117static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
118 const struct task_struct *tsk2)
117{ 119{
118 return 1; 120 return 1;
119} 121}
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index 1dba681e428d..3be4e5a27d82 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ 6#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
7#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
7#define CRAMFS_SIGNATURE "Compressed ROMFS" 8#define CRAMFS_SIGNATURE "Compressed ROMFS"
8 9
9/* 10/*
diff --git a/include/linux/elf.h b/include/linux/elf.h
index d2da84acf45d..576e83bd6d88 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -2,7 +2,6 @@
2#define _LINUX_ELF_H 2#define _LINUX_ELF_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/auxvec.h>
6#include <linux/elf-em.h> 5#include <linux/elf-em.h>
7#include <asm/elf.h> 6#include <asm/elf.h>
8 7
@@ -355,6 +354,7 @@ typedef struct elf64_shdr {
355#define NT_TASKSTRUCT 4 354#define NT_TASKSTRUCT 4
356#define NT_AUXV 6 355#define NT_AUXV 6
357#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ 356#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
357#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
358 358
359 359
360/* Note header in a PT_NOTE section */ 360/* Note header in a PT_NOTE section */
diff --git a/include/linux/elfcore-compat.h b/include/linux/elfcore-compat.h
new file mode 100644
index 000000000000..532d13adabc4
--- /dev/null
+++ b/include/linux/elfcore-compat.h
@@ -0,0 +1,55 @@
1#ifndef _LINUX_ELFCORE_COMPAT_H
2#define _LINUX_ELFCORE_COMPAT_H
3
4#include <linux/elf.h>
5#include <linux/elfcore.h>
6#include <linux/compat.h>
7
8/*
9 * Make sure these layouts match the linux/elfcore.h native definitions.
10 */
11
12struct compat_elf_siginfo
13{
14 compat_int_t si_signo;
15 compat_int_t si_code;
16 compat_int_t si_errno;
17};
18
19struct compat_elf_prstatus
20{
21 struct compat_elf_siginfo pr_info;
22 short pr_cursig;
23 compat_ulong_t pr_sigpend;
24 compat_ulong_t pr_sighold;
25 compat_pid_t pr_pid;
26 compat_pid_t pr_ppid;
27 compat_pid_t pr_pgrp;
28 compat_pid_t pr_sid;
29 struct compat_timeval pr_utime;
30 struct compat_timeval pr_stime;
31 struct compat_timeval pr_cutime;
32 struct compat_timeval pr_cstime;
33 compat_elf_gregset_t pr_reg;
34#ifdef CONFIG_BINFMT_ELF_FDPIC
35 compat_ulong_t pr_exec_fdpic_loadmap;
36 compat_ulong_t pr_interp_fdpic_loadmap;
37#endif
38 compat_int_t pr_fpvalid;
39};
40
41struct compat_elf_prpsinfo
42{
43 char pr_state;
44 char pr_sname;
45 char pr_zomb;
46 char pr_nice;
47 compat_ulong_t pr_flag;
48 compat_uid_t pr_uid;
49 compat_gid_t pr_gid;
50 compat_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
51 char pr_fname[16];
52 char pr_psargs[ELF_PRARGSZ];
53};
54
55#endif /* _LINUX_ELFCORE_COMPAT_H */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 153d755376a4..c77c3bbfe4bb 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -29,11 +29,12 @@
29#undef EXT2FS_DEBUG 29#undef EXT2FS_DEBUG
30 30
31/* 31/*
32 * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files 32 * Define EXT2_RESERVATION to reserve data blocks for expanding files
33 */ 33 */
34#define EXT2_PREALLOCATE 34#define EXT2_DEFAULT_RESERVE_BLOCKS 8
35#define EXT2_DEFAULT_PREALLOC_BLOCKS 8 35/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
36 36#define EXT2_MAX_RESERVE_BLOCKS 1027
37#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0
37/* 38/*
38 * The second extended file system version 39 * The second extended file system version
39 */ 40 */
@@ -200,6 +201,8 @@ struct ext2_group_desc
200#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS 201#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
201#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION 202#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
202#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION 203#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
204#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long)
205#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long)
203 206
204/* 207/*
205 * ioctl commands in 32 bit emulation 208 * ioctl commands in 32 bit emulation
@@ -317,8 +320,9 @@ struct ext2_inode {
317#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ 320#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
318#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ 321#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
319#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ 322#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
320#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ 323#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
321#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ 324#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
325#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
322 326
323 327
324#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt 328#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
@@ -558,4 +562,11 @@ enum {
558#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ 562#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
559 ~EXT2_DIR_ROUND) 563 ~EXT2_DIR_ROUND)
560 564
565static inline ext2_fsblk_t
566ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
567{
568 return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) +
569 le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block);
570}
571
561#endif /* _LINUX_EXT2_FS_H */ 572#endif /* _LINUX_EXT2_FS_H */
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index d149f2959e67..f273415ab6f1 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -18,6 +18,52 @@
18 18
19#include <linux/blockgroup_lock.h> 19#include <linux/blockgroup_lock.h>
20#include <linux/percpu_counter.h> 20#include <linux/percpu_counter.h>
21#include <linux/rbtree.h>
22
23/* XXX Here for now... not interested in restructing headers JUST now */
24
25/* data type for block offset of block group */
26typedef int ext2_grpblk_t;
27
28/* data type for filesystem-wide blocks number */
29typedef unsigned long ext2_fsblk_t;
30
31#define E2FSBLK "%lu"
32
33struct ext2_reserve_window {
34 ext2_fsblk_t _rsv_start; /* First byte reserved */
35 ext2_fsblk_t _rsv_end; /* Last byte reserved or 0 */
36};
37
38struct ext2_reserve_window_node {
39 struct rb_node rsv_node;
40 __u32 rsv_goal_size;
41 __u32 rsv_alloc_hit;
42 struct ext2_reserve_window rsv_window;
43};
44
45struct ext2_block_alloc_info {
46 /* information about reservation window */
47 struct ext2_reserve_window_node rsv_window_node;
48 /*
49 * was i_next_alloc_block in ext2_inode_info
50 * is the logical (file-relative) number of the
51 * most-recently-allocated block in this file.
52 * We use this for detecting linearly ascending allocation requests.
53 */
54 __u32 last_alloc_logical_block;
55 /*
56 * Was i_next_alloc_goal in ext2_inode_info
57 * is the *physical* companion to i_next_alloc_block.
58 * it the the physical block number of the block which was most-recentl
59 * allocated to this file. This give us the goal (target) for the next
60 * allocation when we detect linearly ascending requests.
61 */
62 ext2_fsblk_t last_alloc_physical_block;
63};
64
65#define rsv_start rsv_window._rsv_start
66#define rsv_end rsv_window._rsv_end
21 67
22/* 68/*
23 * second extended-fs super-block data in memory 69 * second extended-fs super-block data in memory
@@ -39,6 +85,7 @@ struct ext2_sb_info {
39 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ 85 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
40 struct buffer_head ** s_group_desc; 86 struct buffer_head ** s_group_desc;
41 unsigned long s_mount_opt; 87 unsigned long s_mount_opt;
88 unsigned long s_sb_block;
42 uid_t s_resuid; 89 uid_t s_resuid;
43 gid_t s_resgid; 90 gid_t s_resgid;
44 unsigned short s_mount_state; 91 unsigned short s_mount_state;
@@ -55,6 +102,10 @@ struct ext2_sb_info {
55 struct percpu_counter s_freeinodes_counter; 102 struct percpu_counter s_freeinodes_counter;
56 struct percpu_counter s_dirs_counter; 103 struct percpu_counter s_dirs_counter;
57 struct blockgroup_lock s_blockgroup_lock; 104 struct blockgroup_lock s_blockgroup_lock;
105 /* root of the per fs reservation window tree */
106 spinlock_t s_rsv_window_lock;
107 struct rb_root s_rsv_window_root;
108 struct ext2_reserve_window_node s_rsv_window_head;
58}; 109};
59 110
60#endif /* _LINUX_EXT2_FS_SB */ 111#endif /* _LINUX_EXT2_FS_SB */
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index ece49a804fe1..589b0b355d84 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -35,10 +35,6 @@
35/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ 35/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
36#define EXT3_MAX_RESERVE_BLOCKS 1027 36#define EXT3_MAX_RESERVE_BLOCKS 1027
37#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0 37#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0
38/*
39 * Always enable hashed directories
40 */
41#define CONFIG_EXT3_INDEX
42 38
43/* 39/*
44 * Debug code 40 * Debug code
@@ -665,17 +661,11 @@ struct ext3_dir_entry_2 {
665 * (c) Daniel Phillips, 2001 661 * (c) Daniel Phillips, 2001
666 */ 662 */
667 663
668#ifdef CONFIG_EXT3_INDEX 664#define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \
669 #define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \ 665 EXT3_FEATURE_COMPAT_DIR_INDEX) && \
670 EXT3_FEATURE_COMPAT_DIR_INDEX) && \
671 (EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) 666 (EXT3_I(dir)->i_flags & EXT3_INDEX_FL))
672#define EXT3_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT3_LINK_MAX) 667#define EXT3_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT3_LINK_MAX)
673#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1) 668#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
674#else
675 #define is_dx(dir) 0
676#define EXT3_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT3_LINK_MAX)
677#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2)
678#endif
679 669
680/* Legal values for the dx_root hash_version field: */ 670/* Legal values for the dx_root hash_version field: */
681 671
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index d3c08353edf6..b65f0288b842 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -44,6 +44,7 @@ struct ext3_sb_info {
44 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ 44 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */
45 struct buffer_head ** s_group_desc; 45 struct buffer_head ** s_group_desc;
46 unsigned long s_mount_opt; 46 unsigned long s_mount_opt;
47 ext3_fsblk_t s_sb_block;
47 uid_t s_resuid; 48 uid_t s_resuid;
48 gid_t s_resgid; 49 gid_t s_resgid;
49 unsigned short s_mount_state; 50 unsigned short s_mount_state;
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 1b2ffee12be9..0a8e47d47c91 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -45,6 +45,7 @@ struct ext4_sb_info {
45 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ 45 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
46 struct buffer_head ** s_group_desc; 46 struct buffer_head ** s_group_desc;
47 unsigned long s_mount_opt; 47 unsigned long s_mount_opt;
48 ext4_fsblk_t s_sb_block;
48 uid_t s_resuid; 49 uid_t s_resuid;
49 gid_t s_resgid; 50 gid_t s_resgid;
50 unsigned short s_mount_state; 51 unsigned short s_mount_state;
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 40b93265d4ba..86037400a6e3 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -3,12 +3,17 @@
3 3
4#include <asm/fcntl.h> 4#include <asm/fcntl.h>
5 5
6/* Cancel a blocking posix lock; internal use only until we expose an 6#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
7 * asynchronous lock api to userspace: */ 7#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
8#define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5)
9 8
10#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) 9/*
11#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) 10 * Cancel a blocking posix lock; internal use only until we expose an
11 * asynchronous lock api to userspace:
12 */
13#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
14
15/* Create a file descriptor with FD_CLOEXEC set. */
16#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
12 17
13/* 18/*
14 * Request nofications on a directory. 19 * Request nofications on a directory.
diff --git a/include/linux/file.h b/include/linux/file.h
index 0114fbc78061..56023c74e9fd 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -62,6 +62,15 @@ extern struct kmem_cache *filp_cachep;
62extern void FASTCALL(__fput(struct file *)); 62extern void FASTCALL(__fput(struct file *));
63extern void FASTCALL(fput(struct file *)); 63extern void FASTCALL(fput(struct file *));
64 64
65struct file_operations;
66struct vfsmount;
67struct dentry;
68extern int init_file(struct file *, struct vfsmount *mnt,
69 struct dentry *dentry, mode_t mode,
70 const struct file_operations *fop);
71extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry,
72 mode_t mode, const struct file_operations *fop);
73
65static inline void fput_light(struct file *file, int fput_needed) 74static inline void fput_light(struct file *file, int fput_needed)
66{ 75{
67 if (unlikely(fput_needed)) 76 if (unlikely(fput_needed))
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f70d52c46617..e3fc5dbb2246 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -283,7 +283,6 @@ extern int dir_notify_enable;
283#include <linux/init.h> 283#include <linux/init.h>
284#include <linux/pid.h> 284#include <linux/pid.h>
285#include <linux/mutex.h> 285#include <linux/mutex.h>
286#include <linux/sysctl.h>
287#include <linux/capability.h> 286#include <linux/capability.h>
288 287
289#include <asm/atomic.h> 288#include <asm/atomic.h>
@@ -301,9 +300,9 @@ struct kstatfs;
301struct vm_area_struct; 300struct vm_area_struct;
302struct vfsmount; 301struct vfsmount;
303 302
304extern void __init inode_init(unsigned long); 303extern void __init inode_init(void);
305extern void __init inode_init_early(void); 304extern void __init inode_init_early(void);
306extern void __init mnt_init(unsigned long); 305extern void __init mnt_init(void);
307extern void __init files_init(unsigned long); 306extern void __init files_init(unsigned long);
308 307
309struct buffer_head; 308struct buffer_head;
@@ -330,6 +329,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
330#define ATTR_KILL_SUID 2048 329#define ATTR_KILL_SUID 2048
331#define ATTR_KILL_SGID 4096 330#define ATTR_KILL_SGID 4096
332#define ATTR_FILE 8192 331#define ATTR_FILE 8192
332#define ATTR_KILL_PRIV 16384
333 333
334/* 334/*
335 * This is the Inode Attributes structure, used for notify_change(). It 335 * This is the Inode Attributes structure, used for notify_change(). It
@@ -793,7 +793,7 @@ struct file {
793 unsigned int f_uid, f_gid; 793 unsigned int f_uid, f_gid;
794 struct file_ra_state f_ra; 794 struct file_ra_state f_ra;
795 795
796 unsigned long f_version; 796 u64 f_version;
797#ifdef CONFIG_SECURITY 797#ifdef CONFIG_SECURITY
798 void *f_security; 798 void *f_security;
799#endif 799#endif
@@ -1003,6 +1003,7 @@ struct super_block {
1003 struct list_head s_inodes; /* all inodes */ 1003 struct list_head s_inodes; /* all inodes */
1004 struct list_head s_dirty; /* dirty inodes */ 1004 struct list_head s_dirty; /* dirty inodes */
1005 struct list_head s_io; /* parked for writeback */ 1005 struct list_head s_io; /* parked for writeback */
1006 struct list_head s_more_io; /* parked for more writeback */
1006 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ 1007 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
1007 struct list_head s_files; 1008 struct list_head s_files;
1008 1009
@@ -1261,16 +1262,68 @@ struct super_operations {
1261#endif 1262#endif
1262}; 1263};
1263 1264
1264/* Inode state bits. Protected by inode_lock. */ 1265/*
1265#define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ 1266 * Inode state bits. Protected by inode_lock.
1266#define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ 1267 *
1267#define I_DIRTY_PAGES 4 /* Data-related inode changes pending */ 1268 * Three bits determine the dirty state of the inode, I_DIRTY_SYNC,
1268#define __I_LOCK 3 1269 * I_DIRTY_DATASYNC and I_DIRTY_PAGES.
1270 *
1271 * Four bits define the lifetime of an inode. Initially, inodes are I_NEW,
1272 * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at
1273 * various stages of removing an inode.
1274 *
1275 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC.
1276 *
1277 * I_DIRTY_SYNC Inode itself is dirty.
1278 * I_DIRTY_DATASYNC Data-related inode changes pending
1279 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean.
1280 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both
1281 * are cleared by unlock_new_inode(), called from iget().
1282 * I_WILL_FREE Must be set when calling write_inode_now() if i_count
1283 * is zero. I_FREEING must be set when I_WILL_FREE is
1284 * cleared.
1285 * I_FREEING Set when inode is about to be freed but still has dirty
1286 * pages or buffers attached or the inode itself is still
1287 * dirty.
1288 * I_CLEAR Set by clear_inode(). In this state the inode is clean
1289 * and can be destroyed.
1290 *
1291 * Inodes that are I_WILL_FREE, I_FREEING or I_CLEAR are
1292 * prohibited for many purposes. iget() must wait for
1293 * the inode to be completely released, then create it
1294 * anew. Other functions will just ignore such inodes,
1295 * if appropriate. I_LOCK is used for waiting.
1296 *
1297 * I_LOCK Serves as both a mutex and completion notification.
1298 * New inodes set I_LOCK. If two processes both create
1299 * the same inode, one of them will release its inode and
1300 * wait for I_LOCK to be released before returning.
1301 * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can
1302 * also cause waiting on I_LOCK, without I_LOCK actually
1303 * being set. find_inode() uses this to prevent returning
1304 * nearly-dead inodes.
1305 * I_SYNC Similar to I_LOCK, but limited in scope to writeback
1306 * of inode dirty data. Having a seperate lock for this
1307 * purpose reduces latency and prevents some filesystem-
1308 * specific deadlocks.
1309 *
1310 * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced
1311 * by (I_DIRTY_SYNC|I_DIRTY_PAGES).
1312 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1313 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on
1314 * I_CLEAR? If not, why?
1315 */
1316#define I_DIRTY_SYNC 1
1317#define I_DIRTY_DATASYNC 2
1318#define I_DIRTY_PAGES 4
1319#define I_NEW 8
1320#define I_WILL_FREE 16
1321#define I_FREEING 32
1322#define I_CLEAR 64
1323#define __I_LOCK 7
1269#define I_LOCK (1 << __I_LOCK) 1324#define I_LOCK (1 << __I_LOCK)
1270#define I_FREEING 16 1325#define __I_SYNC 8
1271#define I_CLEAR 32 1326#define I_SYNC (1 << __I_SYNC)
1272#define I_NEW 64
1273#define I_WILL_FREE 128
1274 1327
1275#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1328#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1276 1329
@@ -1729,6 +1782,7 @@ extern int bdev_read_only(struct block_device *);
1729extern int set_blocksize(struct block_device *, int); 1782extern int set_blocksize(struct block_device *, int);
1730extern int sb_set_blocksize(struct super_block *, int); 1783extern int sb_set_blocksize(struct super_block *, int);
1731extern int sb_min_blocksize(struct super_block *, int); 1784extern int sb_min_blocksize(struct super_block *, int);
1785extern int sb_has_dirty_inodes(struct super_block *);
1732 1786
1733extern int generic_file_mmap(struct file *, struct vm_area_struct *); 1787extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1734extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 1788extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
@@ -1887,8 +1941,6 @@ extern int simple_empty(struct dentry *);
1887extern int simple_readpage(struct file *file, struct page *page); 1941extern int simple_readpage(struct file *file, struct page *page);
1888extern int simple_prepare_write(struct file *file, struct page *page, 1942extern int simple_prepare_write(struct file *file, struct page *page,
1889 unsigned offset, unsigned to); 1943 unsigned offset, unsigned to);
1890extern int simple_commit_write(struct file *file, struct page *page,
1891 unsigned offset, unsigned to);
1892extern int simple_write_begin(struct file *file, struct address_space *mapping, 1944extern int simple_write_begin(struct file *file, struct address_space *mapping,
1893 loff_t pos, unsigned len, unsigned flags, 1945 loff_t pos, unsigned len, unsigned flags,
1894 struct page **pagep, void **fsdata); 1946 struct page **pagep, void **fsdata);
@@ -2032,7 +2084,8 @@ static inline void free_secdata(void *secdata)
2032{ } 2084{ }
2033#endif /* CONFIG_SECURITY */ 2085#endif /* CONFIG_SECURITY */
2034 2086
2035int proc_nr_files(ctl_table *table, int write, struct file *filp, 2087struct ctl_table;
2088int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
2036 void __user *buffer, size_t *lenp, loff_t *ppos); 2089 void __user *buffer, size_t *lenp, loff_t *ppos);
2037 2090
2038 2091
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 4aba6b0ad41c..ae77daed6c2f 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -24,6 +24,8 @@
24#ifndef _LINUX_IF_FDDI_H 24#ifndef _LINUX_IF_FDDI_H
25#define _LINUX_IF_FDDI_H 25#define _LINUX_IF_FDDI_H
26 26
27#include <linux/types.h>
28
27/* 29/*
28 * Define max and min legal sizes. The frame sizes do not include 30 * Define max and min legal sizes. The frame sizes do not include
29 * 4 byte FCS/CRC (frame check sequence). 31 * 4 byte FCS/CRC (frame check sequence).
diff --git a/include/linux/init.h b/include/linux/init.h
index 9b7a2ba8237e..5141381a7527 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -161,7 +161,7 @@ struct obs_kernel_param {
161 * obs_kernel_param "array" too far apart in .init.setup. 161 * obs_kernel_param "array" too far apart in .init.setup.
162 */ 162 */
163#define __setup_param(str, unique_id, fn, early) \ 163#define __setup_param(str, unique_id, fn, early) \
164 static char __setup_str_##unique_id[] __initdata = str; \ 164 static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \
165 static struct obs_kernel_param __setup_##unique_id \ 165 static struct obs_kernel_param __setup_##unique_id \
166 __attribute_used__ \ 166 __attribute_used__ \
167 __attribute__((__section__(".init.setup"))) \ 167 __attribute__((__section__(".init.setup"))) \
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 513bc3e489f0..d4b2f1c76e12 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -76,7 +76,6 @@ extern struct nsproxy init_nsproxy;
76#define INIT_NSPROXY(nsproxy) { \ 76#define INIT_NSPROXY(nsproxy) { \
77 .pid_ns = &init_pid_ns, \ 77 .pid_ns = &init_pid_ns, \
78 .count = ATOMIC_INIT(1), \ 78 .count = ATOMIC_INIT(1), \
79 .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \
80 .uts_ns = &init_uts_ns, \ 79 .uts_ns = &init_uts_ns, \
81 .mnt_ns = NULL, \ 80 .mnt_ns = NULL, \
82 INIT_NET_NS(net_ns) \ 81 INIT_NET_NS(net_ns) \
@@ -171,6 +170,7 @@ extern struct group_info init_groups;
171 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ 170 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
172 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 171 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
173 }, \ 172 }, \
173 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
174 INIT_TRACE_IRQFLAGS \ 174 INIT_TRACE_IRQFLAGS \
175 INIT_LOCKDEP \ 175 INIT_LOCKDEP \
176} 176}
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 8e5f289052a2..2306920fa388 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -55,28 +55,6 @@
55#define IRQF_NOBALANCING 0x00000800 55#define IRQF_NOBALANCING 0x00000800
56#define IRQF_IRQPOLL 0x00001000 56#define IRQF_IRQPOLL 0x00001000
57 57
58/*
59 * Migration helpers. Scheduled for removal in 9/2007
60 * Do not use for new code !
61 */
62static inline
63unsigned long __deprecated deprecated_irq_flag(unsigned long flag)
64{
65 return flag;
66}
67
68#define SA_INTERRUPT deprecated_irq_flag(IRQF_DISABLED)
69#define SA_SAMPLE_RANDOM deprecated_irq_flag(IRQF_SAMPLE_RANDOM)
70#define SA_SHIRQ deprecated_irq_flag(IRQF_SHARED)
71#define SA_PROBEIRQ deprecated_irq_flag(IRQF_PROBE_SHARED)
72#define SA_PERCPU deprecated_irq_flag(IRQF_PERCPU)
73
74#define SA_TRIGGER_LOW deprecated_irq_flag(IRQF_TRIGGER_LOW)
75#define SA_TRIGGER_HIGH deprecated_irq_flag(IRQF_TRIGGER_HIGH)
76#define SA_TRIGGER_FALLING deprecated_irq_flag(IRQF_TRIGGER_FALLING)
77#define SA_TRIGGER_RISING deprecated_irq_flag(IRQF_TRIGGER_RISING)
78#define SA_TRIGGER_MASK deprecated_irq_flag(IRQF_TRIGGER_MASK)
79
80typedef irqreturn_t (*irq_handler_t)(int, void *); 58typedef irqreturn_t (*irq_handler_t)(int, void *);
81 59
82struct irqaction { 60struct irqaction {
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 3fd3ddd5f0d9..ee111834091c 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -49,6 +49,34 @@ struct ipc_perm
49#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger 49#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
50 message sizes, etc. */ 50 message sizes, etc. */
51 51
52/*
53 * These are used to wrap system calls.
54 *
55 * See architecture code for ugly details..
56 */
57struct ipc_kludge {
58 struct msgbuf __user *msgp;
59 long msgtyp;
60};
61
62#define SEMOP 1
63#define SEMGET 2
64#define SEMCTL 3
65#define SEMTIMEDOP 4
66#define MSGSND 11
67#define MSGRCV 12
68#define MSGGET 13
69#define MSGCTL 14
70#define SHMAT 21
71#define SHMDT 22
72#define SHMGET 23
73#define SHMCTL 24
74
75/* Used by the DIPC package, try and avoid reusing it */
76#define DIPC 25
77
78#define IPCCALL(version,op) ((version)<<16 | (op))
79
52#ifdef __KERNEL__ 80#ifdef __KERNEL__
53 81
54#include <linux/kref.h> 82#include <linux/kref.h>
diff --git a/include/linux/kbd_diacr.h b/include/linux/kbd_diacr.h
index 1c1a3ff0535b..7274ec68c246 100644
--- a/include/linux/kbd_diacr.h
+++ b/include/linux/kbd_diacr.h
@@ -2,7 +2,7 @@
2#define _DIACR_H 2#define _DIACR_H
3#include <linux/kd.h> 3#include <linux/kd.h>
4 4
5extern struct kbdiacr accent_table[]; 5extern struct kbdiacruc accent_table[];
6extern unsigned int accent_table_size; 6extern unsigned int accent_table_size;
7 7
8#endif /* _DIACR_H */ 8#endif /* _DIACR_H */
diff --git a/include/linux/kd.h b/include/linux/kd.h
index 28be4fbe9044..c91fc0c9c495 100644
--- a/include/linux/kd.h
+++ b/include/linux/kd.h
@@ -125,6 +125,16 @@ struct kbdiacrs {
125#define KDGKBDIACR 0x4B4A /* read kernel accent table */ 125#define KDGKBDIACR 0x4B4A /* read kernel accent table */
126#define KDSKBDIACR 0x4B4B /* write kernel accent table */ 126#define KDSKBDIACR 0x4B4B /* write kernel accent table */
127 127
128struct kbdiacruc {
129 __u32 diacr, base, result;
130};
131struct kbdiacrsuc {
132 unsigned int kb_cnt; /* number of entries in following array */
133 struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
134};
135#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
136#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
137
128struct kbkeycode { 138struct kbkeycode {
129 unsigned int scancode, keycode; 139 unsigned int scancode, keycode;
130}; 140};
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5fdbc814c2eb..94bc99656963 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -76,6 +76,13 @@ extern const char linux_proc_banner[];
76#define KERN_INFO "<6>" /* informational */ 76#define KERN_INFO "<6>" /* informational */
77#define KERN_DEBUG "<7>" /* debug-level messages */ 77#define KERN_DEBUG "<7>" /* debug-level messages */
78 78
79/*
80 * Annotation for a "continued" line of log printout (only done after a
81 * line that had no enclosing \n). Only to be used by core/arch code
82 * during early bootup (a continued line is not SMP-safe otherwise).
83 */
84#define KERN_CONT ""
85
79extern int console_printk[]; 86extern int console_printk[];
80 87
81#define console_loglevel (console_printk[0]) 88#define console_loglevel (console_printk[0])
@@ -172,6 +179,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
172 __attribute__ ((format (printf, 1, 0))); 179 __attribute__ ((format (printf, 1, 0)));
173asmlinkage int printk(const char * fmt, ...) 180asmlinkage int printk(const char * fmt, ...)
174 __attribute__ ((format (printf, 1, 2))) __cold; 181 __attribute__ ((format (printf, 1, 2))) __cold;
182extern int log_buf_get_len(void);
183extern int log_buf_read(int idx);
184extern int log_buf_copy(char *dest, int idx, int len);
175#else 185#else
176static inline int vprintk(const char *s, va_list args) 186static inline int vprintk(const char *s, va_list args)
177 __attribute__ ((format (printf, 1, 0))); 187 __attribute__ ((format (printf, 1, 0)));
@@ -179,6 +189,9 @@ static inline int vprintk(const char *s, va_list args) { return 0; }
179static inline int printk(const char *s, ...) 189static inline int printk(const char *s, ...)
180 __attribute__ ((format (printf, 1, 2))); 190 __attribute__ ((format (printf, 1, 2)));
181static inline int __cold printk(const char *s, ...) { return 0; } 191static inline int __cold printk(const char *s, ...) { return 0; }
192static inline int log_buf_get_len(void) { return 0; }
193static inline int log_buf_read(int idx) { return 0; }
194static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
182#endif 195#endif
183 196
184unsigned long int_sqrt(unsigned long); 197unsigned long int_sqrt(unsigned long);
@@ -245,10 +258,25 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
245 const void *buf, size_t len); 258 const void *buf, size_t len);
246#define hex_asc(x) "0123456789abcdef"[x] 259#define hex_asc(x) "0123456789abcdef"[x]
247 260
261#define pr_emerg(fmt, arg...) \
262 printk(KERN_EMERG fmt, ##arg)
263#define pr_alert(fmt, arg...) \
264 printk(KERN_ALERT fmt, ##arg)
265#define pr_crit(fmt, arg...) \
266 printk(KERN_CRIT fmt, ##arg)
267#define pr_err(fmt, arg...) \
268 printk(KERN_ERR fmt, ##arg)
269#define pr_warning(fmt, arg...) \
270 printk(KERN_WARNING fmt, ##arg)
271#define pr_notice(fmt, arg...) \
272 printk(KERN_NOTICE fmt, ##arg)
273#define pr_info(fmt, arg...) \
274 printk(KERN_INFO fmt, ##arg)
275
248#ifdef DEBUG 276#ifdef DEBUG
249/* If you are writing a driver, please use dev_dbg instead */ 277/* If you are writing a driver, please use dev_dbg instead */
250#define pr_debug(fmt,arg...) \ 278#define pr_debug(fmt, arg...) \
251 printk(KERN_DEBUG fmt,##arg) 279 printk(KERN_DEBUG fmt, ##arg)
252#else 280#else
253static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) 281static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
254{ 282{
@@ -256,9 +284,6 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char *
256} 284}
257#endif 285#endif
258 286
259#define pr_info(fmt,arg...) \
260 printk(KERN_INFO fmt,##arg)
261
262/* 287/*
263 * Display an IP address in readable format. 288 * Display an IP address in readable format.
264 */ 289 */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 8c2c7fcd58ce..ad4b82ce84af 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -121,6 +121,30 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
121extern void crash_kexec(struct pt_regs *); 121extern void crash_kexec(struct pt_regs *);
122int kexec_should_crash(struct task_struct *); 122int kexec_should_crash(struct task_struct *);
123void crash_save_cpu(struct pt_regs *regs, int cpu); 123void crash_save_cpu(struct pt_regs *regs, int cpu);
124void crash_save_vmcoreinfo(void);
125void arch_crash_save_vmcoreinfo(void);
126void vmcoreinfo_append_str(const char *fmt, ...)
127 __attribute__ ((format (printf, 1, 2)));
128unsigned long paddr_vmcoreinfo_note(void);
129
130#define VMCOREINFO_SYMBOL(name) \
131 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
132#define VMCOREINFO_SIZE(name) \
133 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
134 (unsigned long)sizeof(struct name))
135#define VMCOREINFO_TYPEDEF_SIZE(name) \
136 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
137 (unsigned long)sizeof(name))
138#define VMCOREINFO_OFFSET(name, field) \
139 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
140 (unsigned long)&(((struct name *)0)->field))
141#define VMCOREINFO_LENGTH(name, value) \
142 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
143#define VMCOREINFO_NUMBER(name) \
144 vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name)
145#define VMCOREINFO_CONFIG(name) \
146 vmcoreinfo_append_str("CONFIG_%s=y\n", #name)
147
124extern struct kimage *kexec_image; 148extern struct kimage *kexec_image;
125extern struct kimage *kexec_crash_image; 149extern struct kimage *kexec_crash_image;
126 150
@@ -148,11 +172,20 @@ extern struct kimage *kexec_crash_image;
148 172
149#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ 173#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
150 174
175#define VMCOREINFO_BYTES (4096)
176#define VMCOREINFO_NOTE_NAME "VMCOREINFO"
177#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4)
178#define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \
179 + VMCOREINFO_NOTE_NAME_BYTES)
180
151/* Location of a reserved region to hold the crash kernel. 181/* Location of a reserved region to hold the crash kernel.
152 */ 182 */
153extern struct resource crashk_res; 183extern struct resource crashk_res;
154typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; 184typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
155extern note_buf_t *crash_notes; 185extern note_buf_t *crash_notes;
186extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
187extern size_t vmcoreinfo_size;
188extern size_t vmcoreinfo_max_size;
156 189
157 190
158#else /* !CONFIG_KEXEC */ 191#else /* !CONFIG_KEXEC */
diff --git a/include/linux/key-type.h b/include/linux/key-type.h
new file mode 100644
index 000000000000..65833d4d5998
--- /dev/null
+++ b/include/linux/key-type.h
@@ -0,0 +1,112 @@
1/* Definitions for key type implementations
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _LINUX_KEY_TYPE_H
13#define _LINUX_KEY_TYPE_H
14
15#include <linux/key.h>
16
17#ifdef CONFIG_KEYS
18
19/*
20 * key under-construction record
21 * - passed to the request_key actor if supplied
22 */
23struct key_construction {
24 struct key *key; /* key being constructed */
25 struct key *authkey;/* authorisation for key being constructed */
26};
27
28typedef int (*request_key_actor_t)(struct key_construction *key,
29 const char *op, void *aux);
30
31/*
32 * kernel managed key type definition
33 */
34struct key_type {
35 /* name of the type */
36 const char *name;
37
38 /* default payload length for quota precalculation (optional)
39 * - this can be used instead of calling key_payload_reserve(), that
40 * function only needs to be called if the real datalen is different
41 */
42 size_t def_datalen;
43
44 /* instantiate a key of this type
45 * - this method should call key_payload_reserve() to determine if the
46 * user's quota will hold the payload
47 */
48 int (*instantiate)(struct key *key, const void *data, size_t datalen);
49
50 /* update a key of this type (optional)
51 * - this method should call key_payload_reserve() to recalculate the
52 * quota consumption
53 * - the key must be locked against read when modifying
54 */
55 int (*update)(struct key *key, const void *data, size_t datalen);
56
57 /* match a key against a description */
58 int (*match)(const struct key *key, const void *desc);
59
60 /* clear some of the data from a key on revokation (optional)
61 * - the key's semaphore will be write-locked by the caller
62 */
63 void (*revoke)(struct key *key);
64
65 /* clear the data from a key (optional) */
66 void (*destroy)(struct key *key);
67
68 /* describe a key */
69 void (*describe)(const struct key *key, struct seq_file *p);
70
71 /* read a key's data (optional)
72 * - permission checks will be done by the caller
73 * - the key's semaphore will be readlocked by the caller
74 * - should return the amount of data that could be read, no matter how
75 * much is copied into the buffer
76 * - shouldn't do the copy if the buffer is NULL
77 */
78 long (*read)(const struct key *key, char __user *buffer, size_t buflen);
79
80 /* handle request_key() for this type instead of invoking
81 * /sbin/request-key (optional)
82 * - key is the key to instantiate
83 * - authkey is the authority to assume when instantiating this key
84 * - op is the operation to be done, usually "create"
85 * - the call must not return until the instantiation process has run
86 * its course
87 */
88 request_key_actor_t request_key;
89
90 /* internal fields */
91 struct list_head link; /* link in types list */
92};
93
94extern struct key_type key_type_keyring;
95
96extern int register_key_type(struct key_type *ktype);
97extern void unregister_key_type(struct key_type *ktype);
98
99extern int key_payload_reserve(struct key *key, size_t datalen);
100extern int key_instantiate_and_link(struct key *key,
101 const void *data,
102 size_t datalen,
103 struct key *keyring,
104 struct key *instkey);
105extern int key_negate_and_link(struct key *key,
106 unsigned timeout,
107 struct key *keyring,
108 struct key *instkey);
109extern void complete_request_key(struct key_construction *cons, int error);
110
111#endif /* CONFIG_KEYS */
112#endif /* _LINUX_KEY_TYPE_H */
diff --git a/include/linux/key.h b/include/linux/key.h
index a9220e75782e..fcdbd5ed227b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -1,6 +1,6 @@
1/* key.h: authentication token and access key management 1/* Authentication token and access key management
2 * 2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2004, 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 4 * Written by David Howells (dhowells@redhat.com)
5 * 5 *
6 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
@@ -175,78 +175,6 @@ struct key {
175 } payload; 175 } payload;
176}; 176};
177 177
178/*****************************************************************************/
179/*
180 * kernel managed key type definition
181 */
182typedef int (*request_key_actor_t)(struct key *key, struct key *authkey,
183 const char *op, void *aux);
184
185struct key_type {
186 /* name of the type */
187 const char *name;
188
189 /* default payload length for quota precalculation (optional)
190 * - this can be used instead of calling key_payload_reserve(), that
191 * function only needs to be called if the real datalen is different
192 */
193 size_t def_datalen;
194
195 /* instantiate a key of this type
196 * - this method should call key_payload_reserve() to determine if the
197 * user's quota will hold the payload
198 */
199 int (*instantiate)(struct key *key, const void *data, size_t datalen);
200
201 /* update a key of this type (optional)
202 * - this method should call key_payload_reserve() to recalculate the
203 * quota consumption
204 * - the key must be locked against read when modifying
205 */
206 int (*update)(struct key *key, const void *data, size_t datalen);
207
208 /* match a key against a description */
209 int (*match)(const struct key *key, const void *desc);
210
211 /* clear some of the data from a key on revokation (optional)
212 * - the key's semaphore will be write-locked by the caller
213 */
214 void (*revoke)(struct key *key);
215
216 /* clear the data from a key (optional) */
217 void (*destroy)(struct key *key);
218
219 /* describe a key */
220 void (*describe)(const struct key *key, struct seq_file *p);
221
222 /* read a key's data (optional)
223 * - permission checks will be done by the caller
224 * - the key's semaphore will be readlocked by the caller
225 * - should return the amount of data that could be read, no matter how
226 * much is copied into the buffer
227 * - shouldn't do the copy if the buffer is NULL
228 */
229 long (*read)(const struct key *key, char __user *buffer, size_t buflen);
230
231 /* handle request_key() for this type instead of invoking
232 * /sbin/request-key (optional)
233 * - key is the key to instantiate
234 * - authkey is the authority to assume when instantiating this key
235 * - op is the operation to be done, usually "create"
236 * - the call must not return until the instantiation process has run
237 * its course
238 */
239 request_key_actor_t request_key;
240
241 /* internal fields */
242 struct list_head link; /* link in types list */
243};
244
245extern struct key_type key_type_keyring;
246
247extern int register_key_type(struct key_type *ktype);
248extern void unregister_key_type(struct key_type *ktype);
249
250extern struct key *key_alloc(struct key_type *type, 178extern struct key *key_alloc(struct key_type *type,
251 const char *desc, 179 const char *desc,
252 uid_t uid, gid_t gid, 180 uid_t uid, gid_t gid,
@@ -259,16 +187,6 @@ extern struct key *key_alloc(struct key_type *type,
259#define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ 187#define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */
260#define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ 188#define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */
261 189
262extern int key_payload_reserve(struct key *key, size_t datalen);
263extern int key_instantiate_and_link(struct key *key,
264 const void *data,
265 size_t datalen,
266 struct key *keyring,
267 struct key *instkey);
268extern int key_negate_and_link(struct key *key,
269 unsigned timeout,
270 struct key *keyring,
271 struct key *instkey);
272extern void key_revoke(struct key *key); 190extern void key_revoke(struct key *key);
273extern void key_put(struct key *key); 191extern void key_put(struct key *key);
274 192
@@ -293,6 +211,17 @@ extern struct key *request_key_with_auxdata(struct key_type *type,
293 const char *callout_info, 211 const char *callout_info,
294 void *aux); 212 void *aux);
295 213
214extern struct key *request_key_async(struct key_type *type,
215 const char *description,
216 const char *callout_info);
217
218extern struct key *request_key_async_with_auxdata(struct key_type *type,
219 const char *description,
220 const char *callout_info,
221 void *aux);
222
223extern int wait_for_key_construction(struct key *key, bool intr);
224
296extern int key_validate(struct key *key); 225extern int key_validate(struct key *key);
297 226
298extern key_ref_t key_create_or_update(key_ref_t keyring, 227extern key_ref_t key_create_or_update(key_ref_t keyring,
@@ -328,8 +257,6 @@ extern int keyring_add_key(struct key *keyring,
328 257
329extern struct key *key_lookup(key_serial_t id); 258extern struct key *key_lookup(key_serial_t id);
330 259
331extern void keyring_replace_payload(struct key *key, void *replacement);
332
333#define key_serial(key) ((key) ? (key)->serial : 0) 260#define key_serial(key) ((key) ? (key)->serial : 0)
334 261
335/* 262/*
diff --git a/include/linux/list.h b/include/linux/list.h
index ad9dcb9e3375..b0cf0135fe3e 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -478,6 +478,18 @@ static inline void list_splice_init_rcu(struct list_head *list,
478 pos = n, n = pos->next) 478 pos = n, n = pos->next)
479 479
480/** 480/**
481 * list_for_each_prev_safe - iterate over a list backwards safe against removal
482 of list entry
483 * @pos: the &struct list_head to use as a loop cursor.
484 * @n: another &struct list_head to use as temporary storage
485 * @head: the head for your list.
486 */
487#define list_for_each_prev_safe(pos, n, head) \
488 for (pos = (head)->prev, n = pos->prev; \
489 prefetch(pos->prev), pos != (head); \
490 pos = n, n = pos->prev)
491
492/**
481 * list_for_each_entry - iterate over list of given type 493 * list_for_each_entry - iterate over list of given type
482 * @pos: the type * to use as a loop cursor. 494 * @pos: the type * to use as a loop cursor.
483 * @head: the head for your list. 495 * @head: the head for your list.
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 1b8a2c1cb0e3..c8cf5e8ef171 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -63,6 +63,15 @@ unsigned long __roundup_pow_of_two(unsigned long n)
63 return 1UL << fls_long(n - 1); 63 return 1UL << fls_long(n - 1);
64} 64}
65 65
66/*
67 * round down to nearest power of two
68 */
69static inline __attribute__((const))
70unsigned long __rounddown_pow_of_two(unsigned long n)
71{
72 return 1UL << (fls_long(n) - 1);
73}
74
66/** 75/**
67 * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value 76 * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
68 * @n - parameter 77 * @n - parameter
@@ -165,4 +174,20 @@ unsigned long __roundup_pow_of_two(unsigned long n)
165 __roundup_pow_of_two(n) \ 174 __roundup_pow_of_two(n) \
166 ) 175 )
167 176
177/**
178 * rounddown_pow_of_two - round the given value down to nearest power of two
179 * @n - parameter
180 *
181 * round the given value down to the nearest power of two
182 * - the result is undefined when n == 0
183 * - this can be used to initialise global variables from constant data
184 */
185#define rounddown_pow_of_two(n) \
186( \
187 __builtin_constant_p(n) ? ( \
188 (n == 1) ? 0 : \
189 (1UL << ilog2(n))) : \
190 __rounddown_pow_of_two(n) \
191 )
192
168#endif /* _LINUX_LOG2_H */ 193#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 36cc20dfd142..722d4755060f 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -38,4 +38,7 @@
38#define SMB_SUPER_MAGIC 0x517B 38#define SMB_SUPER_MAGIC 0x517B
39#define USBDEVICE_SUPER_MAGIC 0x9fa2 39#define USBDEVICE_SUPER_MAGIC 0x9fa2
40 40
41#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
42#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
43
41#endif /* __LINUX_MAGIC_H__ */ 44#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7e87e1b1662e..520238cbae5d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -10,9 +10,7 @@
10#include <linux/mmzone.h> 10#include <linux/mmzone.h>
11#include <linux/rbtree.h> 11#include <linux/rbtree.h>
12#include <linux/prio_tree.h> 12#include <linux/prio_tree.h>
13#include <linux/mutex.h>
14#include <linux/debug_locks.h> 13#include <linux/debug_locks.h>
15#include <linux/backing-dev.h>
16#include <linux/mm_types.h> 14#include <linux/mm_types.h>
17 15
18struct mempolicy; 16struct mempolicy;
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 877667918452..f4c03e0b355e 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_MM_TYPES_H 1#ifndef _LINUX_MM_TYPES_H
2#define _LINUX_MM_TYPES_H 2#define _LINUX_MM_TYPES_H
3 3
4#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ 4#include <linux/auxvec.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/threads.h> 6#include <linux/threads.h>
7#include <linux/list.h> 7#include <linux/list.h>
@@ -13,6 +13,11 @@
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/mmu.h> 14#include <asm/mmu.h>
15 15
16#ifndef AT_VECTOR_SIZE_ARCH
17#define AT_VECTOR_SIZE_ARCH 0
18#endif
19#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1))
20
16struct address_space; 21struct address_space;
17 22
18#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 23#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f4bfe824834f..4c4522a51a3b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/wait.h> 9#include <linux/wait.h>
10#include <linux/bitops.h>
10#include <linux/cache.h> 11#include <linux/cache.h>
11#include <linux/threads.h> 12#include <linux/threads.h>
12#include <linux/numa.h> 13#include <linux/numa.h>
@@ -262,10 +263,7 @@ struct zone {
262 unsigned long nr_scan_active; 263 unsigned long nr_scan_active;
263 unsigned long nr_scan_inactive; 264 unsigned long nr_scan_inactive;
264 unsigned long pages_scanned; /* since last reclaim */ 265 unsigned long pages_scanned; /* since last reclaim */
265 int all_unreclaimable; /* All pages pinned */ 266 unsigned long flags; /* zone flags, see below */
266
267 /* A count of how many reclaimers are scanning this zone */
268 atomic_t reclaim_in_progress;
269 267
270 /* Zone statistics */ 268 /* Zone statistics */
271 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; 269 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
@@ -343,6 +341,42 @@ struct zone {
343 const char *name; 341 const char *name;
344} ____cacheline_internodealigned_in_smp; 342} ____cacheline_internodealigned_in_smp;
345 343
344typedef enum {
345 ZONE_ALL_UNRECLAIMABLE, /* all pages pinned */
346 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */
347 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */
348} zone_flags_t;
349
350static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
351{
352 set_bit(flag, &zone->flags);
353}
354
355static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag)
356{
357 return test_and_set_bit(flag, &zone->flags);
358}
359
360static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
361{
362 clear_bit(flag, &zone->flags);
363}
364
365static inline int zone_is_all_unreclaimable(const struct zone *zone)
366{
367 return test_bit(ZONE_ALL_UNRECLAIMABLE, &zone->flags);
368}
369
370static inline int zone_is_reclaim_locked(const struct zone *zone)
371{
372 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
373}
374
375static inline int zone_is_oom_locked(const struct zone *zone)
376{
377 return test_bit(ZONE_OOM_LOCKED, &zone->flags);
378}
379
346/* 380/*
347 * The "priority" of VM scanning is how much of the queues we will scan in one 381 * The "priority" of VM scanning is how much of the queues we will scan in one
348 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the 382 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
diff --git a/include/linux/module.h b/include/linux/module.h
index b6a646cea1cb..642f325e4917 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -312,9 +312,6 @@ struct module
312 /* Arch-specific module values */ 312 /* Arch-specific module values */
313 struct mod_arch_specific arch; 313 struct mod_arch_specific arch;
314 314
315 /* Am I unsafe to unload? */
316 int unsafe;
317
318 unsigned int taints; /* same bits as kernel:tainted */ 315 unsigned int taints; /* same bits as kernel:tainted */
319 316
320#ifdef CONFIG_GENERIC_BUG 317#ifdef CONFIG_GENERIC_BUG
@@ -346,6 +343,9 @@ struct module
346 343
347 /* Section attributes */ 344 /* Section attributes */
348 struct module_sect_attrs *sect_attrs; 345 struct module_sect_attrs *sect_attrs;
346
347 /* Notes attributes */
348 struct module_notes_attrs *notes_attrs;
349#endif 349#endif
350 350
351 /* Per-cpu data. */ 351 /* Per-cpu data. */
@@ -441,16 +441,6 @@ static inline void __module_get(struct module *module)
441 __mod ? __mod->name : "kernel"; \ 441 __mod ? __mod->name : "kernel"; \
442}) 442})
443 443
444#define __unsafe(mod) \
445do { \
446 if (mod && !(mod)->unsafe) { \
447 printk(KERN_WARNING \
448 "Module %s cannot be unloaded due to unsafe usage in" \
449 " %s:%u\n", (mod)->name, __FILE__, __LINE__); \
450 (mod)->unsafe = 1; \
451 } \
452} while(0)
453
454/* For kallsyms to ask for address resolution. NULL means not found. */ 444/* For kallsyms to ask for address resolution. NULL means not found. */
455const char *module_address_lookup(unsigned long addr, 445const char *module_address_lookup(unsigned long addr,
456 unsigned long *symbolsize, 446 unsigned long *symbolsize,
@@ -518,8 +508,6 @@ static inline void module_put(struct module *module)
518 508
519#define module_name(mod) "kernel" 509#define module_name(mod) "kernel"
520 510
521#define __unsafe(mod)
522
523/* For kallsyms to ask for address resolution. NULL means not found. */ 511/* For kallsyms to ask for address resolution. NULL means not found. */
524static inline const char *module_address_lookup(unsigned long addr, 512static inline const char *module_address_lookup(unsigned long addr,
525 unsigned long *symbolsize, 513 unsigned long *symbolsize,
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index c83588c8d08b..13410b20600f 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -38,7 +38,11 @@ struct kernel_param {
38 unsigned int perm; 38 unsigned int perm;
39 param_set_fn set; 39 param_set_fn set;
40 param_get_fn get; 40 param_get_fn get;
41 void *arg; 41 union {
42 void *arg;
43 const struct kparam_string *str;
44 const struct kparam_array *arr;
45 };
42}; 46};
43 47
44/* Special one for strings we want to copy into */ 48/* Special one for strings we want to copy into */
@@ -66,11 +70,11 @@ struct kparam_array
66 /* Default value instead of permissions? */ \ 70 /* Default value instead of permissions? */ \
67 static int __param_perm_check_##name __attribute__((unused)) = \ 71 static int __param_perm_check_##name __attribute__((unused)) = \
68 BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ 72 BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
69 static char __param_str_##name[] = prefix #name; \ 73 static const char __param_str_##name[] = prefix #name; \
70 static struct kernel_param const __param_##name \ 74 static struct kernel_param const __param_##name \
71 __attribute_used__ \ 75 __attribute_used__ \
72 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ 76 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
73 = { __param_str_##name, perm, set, get, arg } 77 = { __param_str_##name, perm, set, get, { arg } }
74 78
75#define module_param_call(name, set, get, arg, perm) \ 79#define module_param_call(name, set, get, arg, perm) \
76 __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) 80 __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm)
@@ -88,10 +92,10 @@ struct kparam_array
88 92
89/* Actually copy string: maxlen param is usually sizeof(string). */ 93/* Actually copy string: maxlen param is usually sizeof(string). */
90#define module_param_string(name, string, len, perm) \ 94#define module_param_string(name, string, len, perm) \
91 static struct kparam_string __param_string_##name \ 95 static const struct kparam_string __param_string_##name \
92 = { len, string }; \ 96 = { len, string }; \
93 module_param_call(name, param_set_copystring, param_get_string, \ 97 module_param_call(name, param_set_copystring, param_get_string, \
94 &__param_string_##name, perm); \ 98 .str = &__param_string_##name, perm); \
95 __MODULE_PARM_TYPE(name, "string") 99 __MODULE_PARM_TYPE(name, "string")
96 100
97/* Called on module insert or kernel boot */ 101/* Called on module insert or kernel boot */
@@ -149,11 +153,11 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp);
149 153
150/* Comma-separated array: *nump is set to number they actually specified. */ 154/* Comma-separated array: *nump is set to number they actually specified. */
151#define module_param_array_named(name, array, type, nump, perm) \ 155#define module_param_array_named(name, array, type, nump, perm) \
152 static struct kparam_array __param_arr_##name \ 156 static const struct kparam_array __param_arr_##name \
153 = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ 157 = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\
154 sizeof(array[0]), array }; \ 158 sizeof(array[0]), array }; \
155 module_param_call(name, param_array_set, param_array_get, \ 159 module_param_call(name, param_array_set, param_array_get, \
156 &__param_arr_##name, perm); \ 160 .arr = &__param_arr_##name, perm); \
157 __MODULE_PARM_TYPE(name, "array of " #type) 161 __MODULE_PARM_TYPE(name, "array of " #type)
158 162
159#define module_param_array(name, type, nump, perm) \ 163#define module_param_array(name, type, nump, perm) \
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 6a735c72f23f..601479772b98 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -29,7 +29,8 @@
29 * - task may not exit with mutex held 29 * - task may not exit with mutex held
30 * - memory areas where held locks reside must not be freed 30 * - memory areas where held locks reside must not be freed
31 * - held mutexes must not be reinitialized 31 * - held mutexes must not be reinitialized
32 * - mutexes may not be used in irq contexts 32 * - mutexes may not be used in hardware or software interrupt
33 * contexts such as tasklets and timers
33 * 34 *
34 * These semantics are fully enforced when DEBUG_MUTEXES is 35 * These semantics are fully enforced when DEBUG_MUTEXES is
35 * enabled. Furthermore, besides enforcing the above rules, the mutex 36 * enabled. Furthermore, besides enforcing the above rules, the mutex
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 6c38efbd810f..4cb4f8d2f78d 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -81,8 +81,8 @@ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry
81extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); 81extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
82extern void release_open_intent(struct nameidata *); 82extern void release_open_intent(struct nameidata *);
83 83
84extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 84extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
85extern struct dentry *lookup_one_len_kern(const char *, struct dentry *, int); 85extern struct dentry *lookup_one_noperm(const char *, struct dentry *);
86 86
87extern int follow_down(struct vfsmount **, struct dentry **); 87extern int follow_down(struct vfsmount **, struct dentry **);
88extern int follow_up(struct vfsmount **, struct dentry **); 88extern int follow_up(struct vfsmount **, struct dentry **);
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 0f3e69302540..cc2b47240a8f 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -26,6 +26,7 @@
26#define NBD_PRINT_DEBUG _IO( 0xab, 6 ) 26#define NBD_PRINT_DEBUG _IO( 0xab, 6 )
27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) 27#define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
28#define NBD_DISCONNECT _IO( 0xab, 8 ) 28#define NBD_DISCONNECT _IO( 0xab, 8 )
29#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
29 30
30enum { 31enum {
31 NBD_CMD_READ = 0, 32 NBD_CMD_READ = 0,
@@ -65,6 +66,7 @@ struct nbd_device {
65 int blksize; 66 int blksize;
66 u64 bytesize; 67 u64 bytesize;
67 pid_t pid; /* pid of nbd-client, if attached */ 68 pid_t pid; /* pid of nbd-client, if attached */
69 int xmit_timeout;
68}; 70};
69 71
70#endif 72#endif
diff --git a/include/linux/nls.h b/include/linux/nls.h
index 816c04ad7381..6a882208301a 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -7,13 +7,13 @@
7typedef __u16 wchar_t; 7typedef __u16 wchar_t;
8 8
9struct nls_table { 9struct nls_table {
10 char *charset; 10 const char *charset;
11 char *alias; 11 const char *alias;
12 int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen); 12 int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen);
13 int (*char2uni) (const unsigned char *rawstring, int boundlen, 13 int (*char2uni) (const unsigned char *rawstring, int boundlen,
14 wchar_t *uni); 14 wchar_t *uni);
15 unsigned char *charset2lower; 15 const unsigned char *charset2lower;
16 unsigned char *charset2upper; 16 const unsigned char *charset2upper;
17 struct module *owner; 17 struct module *owner;
18 struct nls_table *next; 18 struct nls_table *next;
19}; 19};
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index bec4485e3d76..033a648709b6 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -23,7 +23,6 @@ struct pid_namespace;
23 */ 23 */
24struct nsproxy { 24struct nsproxy {
25 atomic_t count; 25 atomic_t count;
26 spinlock_t nslock;
27 struct uts_namespace *uts_ns; 26 struct uts_namespace *uts_ns;
28 struct ipc_namespace *ipc_ns; 27 struct ipc_namespace *ipc_ns;
29 struct mnt_namespace *mnt_ns; 28 struct mnt_namespace *mnt_ns;
diff --git a/include/linux/oom.h b/include/linux/oom.h
index ad76463629a0..3852436b652a 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -7,4 +7,28 @@
7#define OOM_ADJUST_MIN (-16) 7#define OOM_ADJUST_MIN (-16)
8#define OOM_ADJUST_MAX 15 8#define OOM_ADJUST_MAX 15
9 9
10#endif 10#ifdef __KERNEL__
11
12#include <linux/types.h>
13
14struct zonelist;
15struct notifier_block;
16
17/*
18 * Types of limitations to the nodes from which allocations may occur
19 */
20enum oom_constraint {
21 CONSTRAINT_NONE,
22 CONSTRAINT_CPUSET,
23 CONSTRAINT_MEMORY_POLICY,
24};
25
26extern int try_set_zone_oom(struct zonelist *zonelist);
27extern void clear_zonelist_oom(struct zonelist *zonelist);
28
29extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
30extern int register_oom_notifier(struct notifier_block *nb);
31extern int unregister_oom_notifier(struct notifier_block *nb);
32
33#endif /* __KERNEL__*/
34#endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 3d9f70972cdf..9007ccdfc112 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -30,10 +30,28 @@ struct percpu_counter {
30#define FBC_BATCH (NR_CPUS*4) 30#define FBC_BATCH (NR_CPUS*4)
31#endif 31#endif
32 32
33void percpu_counter_init(struct percpu_counter *fbc, s64 amount); 33int percpu_counter_init(struct percpu_counter *fbc, s64 amount);
34int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount);
34void percpu_counter_destroy(struct percpu_counter *fbc); 35void percpu_counter_destroy(struct percpu_counter *fbc);
35void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); 36void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
36s64 percpu_counter_sum(struct percpu_counter *fbc); 37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
38s64 __percpu_counter_sum(struct percpu_counter *fbc);
39
40static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
41{
42 __percpu_counter_add(fbc, amount, FBC_BATCH);
43}
44
45static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
46{
47 s64 ret = __percpu_counter_sum(fbc);
48 return ret < 0 ? 0 : ret;
49}
50
51static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
52{
53 return __percpu_counter_sum(fbc);
54}
37 55
38static inline s64 percpu_counter_read(struct percpu_counter *fbc) 56static inline s64 percpu_counter_read(struct percpu_counter *fbc)
39{ 57{
@@ -61,17 +79,28 @@ struct percpu_counter {
61 s64 count; 79 s64 count;
62}; 80};
63 81
64static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) 82static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount)
65{ 83{
66 fbc->count = amount; 84 fbc->count = amount;
85 return 0;
67} 86}
68 87
88#define percpu_counter_init_irq percpu_counter_init
89
69static inline void percpu_counter_destroy(struct percpu_counter *fbc) 90static inline void percpu_counter_destroy(struct percpu_counter *fbc)
70{ 91{
71} 92}
72 93
94static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
95{
96 fbc->count = amount;
97}
98
99#define __percpu_counter_add(fbc, amount, batch) \
100 percpu_counter_add(fbc, amount)
101
73static inline void 102static inline void
74percpu_counter_mod(struct percpu_counter *fbc, s32 amount) 103percpu_counter_add(struct percpu_counter *fbc, s64 amount)
75{ 104{
76 preempt_disable(); 105 preempt_disable();
77 fbc->count += amount; 106 fbc->count += amount;
@@ -88,21 +117,31 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
88 return fbc->count; 117 return fbc->count;
89} 118}
90 119
91static inline s64 percpu_counter_sum(struct percpu_counter *fbc) 120static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
92{ 121{
93 return percpu_counter_read_positive(fbc); 122 return percpu_counter_read_positive(fbc);
94} 123}
95 124
125static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
126{
127 return percpu_counter_read(fbc);
128}
129
96#endif /* CONFIG_SMP */ 130#endif /* CONFIG_SMP */
97 131
98static inline void percpu_counter_inc(struct percpu_counter *fbc) 132static inline void percpu_counter_inc(struct percpu_counter *fbc)
99{ 133{
100 percpu_counter_mod(fbc, 1); 134 percpu_counter_add(fbc, 1);
101} 135}
102 136
103static inline void percpu_counter_dec(struct percpu_counter *fbc) 137static inline void percpu_counter_dec(struct percpu_counter *fbc)
104{ 138{
105 percpu_counter_mod(fbc, -1); 139 percpu_counter_add(fbc, -1);
140}
141
142static inline void percpu_counter_sub(struct percpu_counter *fbc, s64 amount)
143{
144 percpu_counter_add(fbc, -amount);
106} 145}
107 146
108#endif /* _LINUX_PERCPU_COUNTER_H */ 147#endif /* _LINUX_PERCPU_COUNTER_H */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 16b46aace349..664d68cb1fbd 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -243,11 +243,11 @@ struct pnp_fixup {
243#define PNP_CONFIGURABLE 0x0008 243#define PNP_CONFIGURABLE 0x0008
244#define PNP_REMOVABLE 0x0010 244#define PNP_REMOVABLE 0x0010
245 245
246#define pnp_can_read(dev) (((dev)->protocol) && ((dev)->protocol->get) && \ 246#define pnp_can_read(dev) (((dev)->protocol->get) && \
247 ((dev)->capabilities & PNP_READ)) 247 ((dev)->capabilities & PNP_READ))
248#define pnp_can_write(dev) (((dev)->protocol) && ((dev)->protocol->set) && \ 248#define pnp_can_write(dev) (((dev)->protocol->set) && \
249 ((dev)->capabilities & PNP_WRITE)) 249 ((dev)->capabilities & PNP_WRITE))
250#define pnp_can_disable(dev) (((dev)->protocol) && ((dev)->protocol->disable) && \ 250#define pnp_can_disable(dev) (((dev)->protocol->disable) && \
251 ((dev)->capabilities & PNP_DISABLE)) 251 ((dev)->capabilities & PNP_DISABLE))
252#define pnp_can_configure(dev) ((!(dev)->active) && \ 252#define pnp_can_configure(dev) ((!(dev)->active) && \
253 ((dev)->capabilities & PNP_CONFIGURABLE)) 253 ((dev)->capabilities & PNP_CONFIGURABLE))
diff --git a/include/linux/profile.h b/include/linux/profile.h
index eec48f5f9348..ff576d1db67d 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -78,9 +78,6 @@ int profile_event_unregister(enum profile_type, struct notifier_block * n);
78int register_timer_hook(int (*hook)(struct pt_regs *)); 78int register_timer_hook(int (*hook)(struct pt_regs *));
79void unregister_timer_hook(int (*hook)(struct pt_regs *)); 79void unregister_timer_hook(int (*hook)(struct pt_regs *));
80 80
81/* Timer based profiling hook */
82extern int (*timer_hook)(struct pt_regs *);
83
84struct pt_regs; 81struct pt_regs;
85 82
86#else 83#else
diff --git a/include/linux/proportions.h b/include/linux/proportions.h
new file mode 100644
index 000000000000..2c3b3cad92be
--- /dev/null
+++ b/include/linux/proportions.h
@@ -0,0 +1,119 @@
1/*
2 * FLoating proportions
3 *
4 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
5 *
6 * This file contains the public data structure and API definitions.
7 */
8
9#ifndef _LINUX_PROPORTIONS_H
10#define _LINUX_PROPORTIONS_H
11
12#include <linux/percpu_counter.h>
13#include <linux/spinlock.h>
14#include <linux/mutex.h>
15
16struct prop_global {
17 /*
18 * The period over which we differentiate
19 *
20 * period = 2^shift
21 */
22 int shift;
23 /*
24 * The total event counter aka 'time'.
25 *
26 * Treated as an unsigned long; the lower 'shift - 1' bits are the
27 * counter bits, the remaining upper bits the period counter.
28 */
29 struct percpu_counter events;
30};
31
32/*
33 * global proportion descriptor
34 *
35 * this is needed to consitently flip prop_global structures.
36 */
37struct prop_descriptor {
38 int index;
39 struct prop_global pg[2];
40 struct mutex mutex; /* serialize the prop_global switch */
41};
42
43int prop_descriptor_init(struct prop_descriptor *pd, int shift);
44void prop_change_shift(struct prop_descriptor *pd, int new_shift);
45
46/*
47 * ----- PERCPU ------
48 */
49
50struct prop_local_percpu {
51 /*
52 * the local events counter
53 */
54 struct percpu_counter events;
55
56 /*
57 * snapshot of the last seen global state
58 */
59 int shift;
60 unsigned long period;
61 spinlock_t lock; /* protect the snapshot state */
62};
63
64int prop_local_init_percpu(struct prop_local_percpu *pl);
65void prop_local_destroy_percpu(struct prop_local_percpu *pl);
66void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl);
67void prop_fraction_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl,
68 long *numerator, long *denominator);
69
70static inline
71void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
72{
73 unsigned long flags;
74
75 local_irq_save(flags);
76 __prop_inc_percpu(pd, pl);
77 local_irq_restore(flags);
78}
79
80/*
81 * ----- SINGLE ------
82 */
83
84struct prop_local_single {
85 /*
86 * the local events counter
87 */
88 unsigned long events;
89
90 /*
91 * snapshot of the last seen global state
92 * and a lock protecting this state
93 */
94 int shift;
95 unsigned long period;
96 spinlock_t lock; /* protect the snapshot state */
97};
98
99#define INIT_PROP_LOCAL_SINGLE(name) \
100{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
101}
102
103int prop_local_init_single(struct prop_local_single *pl);
104void prop_local_destroy_single(struct prop_local_single *pl);
105void __prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl);
106void prop_fraction_single(struct prop_descriptor *pd, struct prop_local_single *pl,
107 long *numerator, long *denominator);
108
109static inline
110void prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl)
111{
112 unsigned long flags;
113
114 local_irq_save(flags);
115 __prop_inc_single(pd, pl);
116 local_irq_restore(flags);
117}
118
119#endif /* _LINUX_PROPORTIONS_H */
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 62439828395e..6e0393a5b2ea 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -128,6 +128,37 @@ struct if_dqinfo {
128 __u32 dqi_valid; 128 __u32 dqi_valid;
129}; 129};
130 130
131/*
132 * Definitions for quota netlink interface
133 */
134#define QUOTA_NL_NOWARN 0
135#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */
136#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */
137#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */
138#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */
139#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */
140#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */
141
142enum {
143 QUOTA_NL_C_UNSPEC,
144 QUOTA_NL_C_WARNING,
145 __QUOTA_NL_C_MAX,
146};
147#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
148
149enum {
150 QUOTA_NL_A_UNSPEC,
151 QUOTA_NL_A_QTYPE,
152 QUOTA_NL_A_EXCESS_ID,
153 QUOTA_NL_A_WARNING,
154 QUOTA_NL_A_DEV_MAJOR,
155 QUOTA_NL_A_DEV_MINOR,
156 QUOTA_NL_A_CAUSED_ID,
157 __QUOTA_NL_A_MAX,
158};
159#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
160
161
131#ifdef __KERNEL__ 162#ifdef __KERNEL__
132#include <linux/spinlock.h> 163#include <linux/spinlock.h>
133#include <linux/rwsem.h> 164#include <linux/rwsem.h>
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 75e17a05540e..306a1d1a5af0 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -138,7 +138,6 @@ typedef __u16 bitmap_counter_t;
138 138
139/* use these for bitmap->flags and bitmap->sb->state bit-fields */ 139/* use these for bitmap->flags and bitmap->sb->state bit-fields */
140enum bitmap_state { 140enum bitmap_state {
141 BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
142 BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ 141 BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */
143 BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */ 142 BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */
144 BITMAP_HOSTENDIAN = 0x8000, 143 BITMAP_HOSTENDIAN = 0x8000,
@@ -258,7 +257,6 @@ struct bitmap {
258int bitmap_create(mddev_t *mddev); 257int bitmap_create(mddev_t *mddev);
259void bitmap_flush(mddev_t *mddev); 258void bitmap_flush(mddev_t *mddev);
260void bitmap_destroy(mddev_t *mddev); 259void bitmap_destroy(mddev_t *mddev);
261int bitmap_active(struct bitmap *bitmap);
262 260
263char *file_path(struct file *file, char *buf, int count); 261char *file_path(struct file *file, char *buf, int count);
264void bitmap_print_sb(struct bitmap *bitmap); 262void bitmap_print_sb(struct bitmap *bitmap);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 76c1a530edc5..cc24a01df940 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -231,6 +231,18 @@ extern struct lockdep_map rcu_lock_map;
231 local_bh_enable(); \ 231 local_bh_enable(); \
232 } while(0) 232 } while(0)
233 233
234/*
235 * Prevent the compiler from merging or refetching accesses. The compiler
236 * is also forbidden from reordering successive instances of ACCESS_ONCE(),
237 * but only when the compiler is aware of some particular ordering. One way
238 * to make the compiler aware of ordering is to put the two invocations of
239 * ACCESS_ONCE() in different C statements.
240 *
241 * This macro does absolutely -nothing- to prevent the CPU from reordering,
242 * merging, or refetching absolutely anything at any time.
243 */
244#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
245
234/** 246/**
235 * rcu_dereference - fetch an RCU-protected pointer in an 247 * rcu_dereference - fetch an RCU-protected pointer in an
236 * RCU read-side critical section. This pointer may later 248 * RCU read-side critical section. This pointer may later
@@ -242,7 +254,7 @@ extern struct lockdep_map rcu_lock_map;
242 */ 254 */
243 255
244#define rcu_dereference(p) ({ \ 256#define rcu_dereference(p) ({ \
245 typeof(p) _________p1 = p; \ 257 typeof(p) _________p1 = ACCESS_ONCE(p); \
246 smp_read_barrier_depends(); \ 258 smp_read_barrier_depends(); \
247 (_________p1); \ 259 (_________p1); \
248 }) 260 })
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 180a9d832dde..8dcf237d3386 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1703,8 +1703,6 @@ static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_ha
1703 return th->t_blocks_allocated - th->t_blocks_logged; 1703 return th->t_blocks_allocated - th->t_blocks_logged;
1704} 1704}
1705 1705
1706int reiserfs_async_progress_wait(struct super_block *s);
1707
1708struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct 1706struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
1709 super_block 1707 super_block
1710 *, 1708 *,
@@ -1859,8 +1857,6 @@ void padd_item(char *item, int total_length, int length);
1859#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */ 1857#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */
1860#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1861 1859
1862int restart_transaction(struct reiserfs_transaction_handle *th,
1863 struct inode *inode, struct treepath *path);
1864void reiserfs_read_locked_inode(struct inode *inode, 1860void reiserfs_read_locked_inode(struct inode *inode,
1865 struct reiserfs_iget_args *args); 1861 struct reiserfs_iget_args *args);
1866int reiserfs_find_actor(struct inode *inode, void *p); 1862int reiserfs_find_actor(struct inode *inode, void *p);
@@ -2137,9 +2133,6 @@ void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
2137 struct inode *inode); 2133 struct inode *inode);
2138void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th); 2134void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
2139#endif 2135#endif
2140void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks);
2141void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks);
2142int reiserfs_can_fit_pages(struct super_block *sb);
2143 2136
2144/* hashes.c */ 2137/* hashes.c */
2145__u32 keyed_hash(const signed char *msg, int len); 2138__u32 keyed_hash(const signed char *msg, int len);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 592e3a55f818..3de5aa210feb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -74,6 +74,7 @@ struct sched_param {
74#include <linux/pid.h> 74#include <linux/pid.h>
75#include <linux/percpu.h> 75#include <linux/percpu.h>
76#include <linux/topology.h> 76#include <linux/topology.h>
77#include <linux/proportions.h>
77#include <linux/seccomp.h> 78#include <linux/seccomp.h>
78#include <linux/rcupdate.h> 79#include <linux/rcupdate.h>
79#include <linux/futex.h> 80#include <linux/futex.h>
@@ -260,6 +261,7 @@ extern void softlockup_tick(void);
260extern void spawn_softlockup_task(void); 261extern void spawn_softlockup_task(void);
261extern void touch_softlockup_watchdog(void); 262extern void touch_softlockup_watchdog(void);
262extern void touch_all_softlockup_watchdogs(void); 263extern void touch_all_softlockup_watchdogs(void);
264extern int softlockup_thresh;
263#else 265#else
264static inline void softlockup_tick(void) 266static inline void softlockup_tick(void)
265{ 267{
@@ -357,8 +359,9 @@ extern int get_dumpable(struct mm_struct *mm);
357#define MMF_DUMP_ANON_SHARED 3 359#define MMF_DUMP_ANON_SHARED 3
358#define MMF_DUMP_MAPPED_PRIVATE 4 360#define MMF_DUMP_MAPPED_PRIVATE 4
359#define MMF_DUMP_MAPPED_SHARED 5 361#define MMF_DUMP_MAPPED_SHARED 5
362#define MMF_DUMP_ELF_HEADERS 6
360#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS 363#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
361#define MMF_DUMP_FILTER_BITS 4 364#define MMF_DUMP_FILTER_BITS 5
362#define MMF_DUMP_FILTER_MASK \ 365#define MMF_DUMP_FILTER_MASK \
363 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) 366 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
364#define MMF_DUMP_FILTER_DEFAULT \ 367#define MMF_DUMP_FILTER_DEFAULT \
@@ -515,8 +518,10 @@ struct user_struct {
515 atomic_t inotify_watches; /* How many inotify watches does this user have? */ 518 atomic_t inotify_watches; /* How many inotify watches does this user have? */
516 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ 519 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
517#endif 520#endif
521#ifdef CONFIG_POSIX_MQUEUE
518 /* protected by mq_lock */ 522 /* protected by mq_lock */
519 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */ 523 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
524#endif
520 unsigned long locked_shm; /* How many pages of mlocked shm ? */ 525 unsigned long locked_shm; /* How many pages of mlocked shm ? */
521 526
522#ifdef CONFIG_KEYS 527#ifdef CONFIG_KEYS
@@ -913,6 +918,16 @@ struct task_struct {
913#endif 918#endif
914 919
915 unsigned short ioprio; 920 unsigned short ioprio;
921 /*
922 * fpu_counter contains the number of consecutive context switches
923 * that the FPU is used. If this is over a threshold, the lazy fpu
924 * saving becomes unlazy to save the trap. This is an unsigned char
925 * so that after 256 times the counter wraps and the behavior turns
926 * lazy again; this to deal with bursty apps that only use FPU for
927 * a short time
928 */
929 unsigned char fpu_counter;
930 s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
916#ifdef CONFIG_BLK_DEV_IO_TRACE 931#ifdef CONFIG_BLK_DEV_IO_TRACE
917 unsigned int btrace_seq; 932 unsigned int btrace_seq;
918#endif 933#endif
@@ -998,16 +1013,6 @@ struct task_struct {
998 struct key *thread_keyring; /* keyring private to this thread */ 1013 struct key *thread_keyring; /* keyring private to this thread */
999 unsigned char jit_keyring; /* default keyring to attach requested keys to */ 1014 unsigned char jit_keyring; /* default keyring to attach requested keys to */
1000#endif 1015#endif
1001 /*
1002 * fpu_counter contains the number of consecutive context switches
1003 * that the FPU is used. If this is over a threshold, the lazy fpu
1004 * saving becomes unlazy to save the trap. This is an unsigned char
1005 * so that after 256 times the counter wraps and the behavior turns
1006 * lazy again; this to deal with bursty apps that only use FPU for
1007 * a short time
1008 */
1009 unsigned char fpu_counter;
1010 int oomkilladj; /* OOM kill score adjustment (bit shift). */
1011 char comm[TASK_COMM_LEN]; /* executable name excluding path 1016 char comm[TASK_COMM_LEN]; /* executable name excluding path
1012 - access with [gs]et_task_comm (which lock 1017 - access with [gs]et_task_comm (which lock
1013 it with task_lock()) 1018 it with task_lock())
@@ -1039,8 +1044,9 @@ struct task_struct {
1039 int (*notifier)(void *priv); 1044 int (*notifier)(void *priv);
1040 void *notifier_data; 1045 void *notifier_data;
1041 sigset_t *notifier_mask; 1046 sigset_t *notifier_mask;
1042 1047#ifdef CONFIG_SECURITY
1043 void *security; 1048 void *security;
1049#endif
1044 struct audit_context *audit_context; 1050 struct audit_context *audit_context;
1045 seccomp_t seccomp; 1051 seccomp_t seccomp;
1046 1052
@@ -1129,13 +1135,14 @@ struct task_struct {
1129 int cpuset_mems_generation; 1135 int cpuset_mems_generation;
1130 int cpuset_mem_spread_rotor; 1136 int cpuset_mem_spread_rotor;
1131#endif 1137#endif
1138#ifdef CONFIG_FUTEX
1132 struct robust_list_head __user *robust_list; 1139 struct robust_list_head __user *robust_list;
1133#ifdef CONFIG_COMPAT 1140#ifdef CONFIG_COMPAT
1134 struct compat_robust_list_head __user *compat_robust_list; 1141 struct compat_robust_list_head __user *compat_robust_list;
1135#endif 1142#endif
1136 struct list_head pi_state_list; 1143 struct list_head pi_state_list;
1137 struct futex_pi_state *pi_state_cache; 1144 struct futex_pi_state *pi_state_cache;
1138 1145#endif
1139 atomic_t fs_excl; /* holding fs exclusive resources */ 1146 atomic_t fs_excl; /* holding fs exclusive resources */
1140 struct rcu_head rcu; 1147 struct rcu_head rcu;
1141 1148
@@ -1149,6 +1156,7 @@ struct task_struct {
1149#ifdef CONFIG_FAULT_INJECTION 1156#ifdef CONFIG_FAULT_INJECTION
1150 int make_it_fail; 1157 int make_it_fail;
1151#endif 1158#endif
1159 struct prop_local_single dirties;
1152}; 1160};
1153 1161
1154/* 1162/*
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 3ee412bc00ec..ba81ffe9958a 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -47,15 +47,6 @@ struct screen_info {
47 47
48extern struct screen_info screen_info; 48extern struct screen_info screen_info;
49 49
50#define ORIG_X (screen_info.orig_x)
51#define ORIG_Y (screen_info.orig_y)
52#define ORIG_VIDEO_MODE (screen_info.orig_video_mode)
53#define ORIG_VIDEO_COLS (screen_info.orig_video_cols)
54#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx)
55#define ORIG_VIDEO_LINES (screen_info.orig_video_lines)
56#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA)
57#define ORIG_VIDEO_POINTS (screen_info.orig_video_points)
58
59#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ 50#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
60#define VIDEO_TYPE_CGA 0x11 /* CGA Display */ 51#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
61#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ 52#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
diff --git a/include/linux/security.h b/include/linux/security.h
index 928d4793c6f4..9b0b63c50f44 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -51,10 +51,16 @@ extern void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe);
51extern int cap_bprm_secureexec(struct linux_binprm *bprm); 51extern int cap_bprm_secureexec(struct linux_binprm *bprm);
52extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); 52extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags);
53extern int cap_inode_removexattr(struct dentry *dentry, char *name); 53extern int cap_inode_removexattr(struct dentry *dentry, char *name);
54extern int cap_inode_need_killpriv(struct dentry *dentry);
55extern int cap_inode_killpriv(struct dentry *dentry);
54extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); 56extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
55extern void cap_task_reparent_to_init (struct task_struct *p); 57extern void cap_task_reparent_to_init (struct task_struct *p);
58extern int cap_task_kill(struct task_struct *p, struct siginfo *info, int sig, u32 secid);
59extern int cap_task_setscheduler (struct task_struct *p, int policy, struct sched_param *lp);
60extern int cap_task_setioprio (struct task_struct *p, int ioprio);
61extern int cap_task_setnice (struct task_struct *p, int nice);
56extern int cap_syslog (int type); 62extern int cap_syslog (int type);
57extern int cap_vm_enough_memory (struct mm_struct *mm, long pages); 63extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
58 64
59struct msghdr; 65struct msghdr;
60struct sk_buff; 66struct sk_buff;
@@ -413,6 +419,18 @@ struct request_sock;
413 * is specified by @buffer_size. @buffer may be NULL to request 419 * is specified by @buffer_size. @buffer may be NULL to request
414 * the size of the buffer required. 420 * the size of the buffer required.
415 * Returns number of bytes used/required on success. 421 * Returns number of bytes used/required on success.
422 * @inode_need_killpriv:
423 * Called when an inode has been changed.
424 * @dentry is the dentry being changed.
425 * Return <0 on error to abort the inode change operation.
426 * Return 0 if inode_killpriv does not need to be called.
427 * Return >0 if inode_killpriv does need to be called.
428 * @inode_killpriv:
429 * The setuid bit is being removed. Remove similar security labels.
430 * Called with the dentry->d_inode->i_mutex held.
431 * @dentry is the dentry being changed.
432 * Return 0 on success. If error is returned, then the operation
433 * causing setuid bit removal is failed.
416 * 434 *
417 * Security hooks for file operations 435 * Security hooks for file operations
418 * 436 *
@@ -1140,10 +1158,6 @@ struct request_sock;
1140 * allow module stacking. 1158 * allow module stacking.
1141 * @name contains the name of the security module being stacked. 1159 * @name contains the name of the security module being stacked.
1142 * @ops contains a pointer to the struct security_operations of the module to stack. 1160 * @ops contains a pointer to the struct security_operations of the module to stack.
1143 * @unregister_security:
1144 * remove a stacked module.
1145 * @name contains the name of the security module being unstacked.
1146 * @ops contains a pointer to the struct security_operations of the module to unstack.
1147 * 1161 *
1148 * @secid_to_secctx: 1162 * @secid_to_secctx:
1149 * Convert secid to security context. 1163 * Convert secid to security context.
@@ -1239,7 +1253,8 @@ struct security_operations {
1239 int (*inode_getxattr) (struct dentry *dentry, char *name); 1253 int (*inode_getxattr) (struct dentry *dentry, char *name);
1240 int (*inode_listxattr) (struct dentry *dentry); 1254 int (*inode_listxattr) (struct dentry *dentry);
1241 int (*inode_removexattr) (struct dentry *dentry, char *name); 1255 int (*inode_removexattr) (struct dentry *dentry, char *name);
1242 const char *(*inode_xattr_getsuffix) (void); 1256 int (*inode_need_killpriv) (struct dentry *dentry);
1257 int (*inode_killpriv) (struct dentry *dentry);
1243 int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); 1258 int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
1244 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1259 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1245 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); 1260 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
@@ -1330,8 +1345,6 @@ struct security_operations {
1330 /* allow module stacking */ 1345 /* allow module stacking */
1331 int (*register_security) (const char *name, 1346 int (*register_security) (const char *name,
1332 struct security_operations *ops); 1347 struct security_operations *ops);
1333 int (*unregister_security) (const char *name,
1334 struct security_operations *ops);
1335 1348
1336 void (*d_instantiate) (struct dentry *dentry, struct inode *inode); 1349 void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
1337 1350
@@ -1409,748 +1422,10 @@ struct security_operations {
1409 1422
1410}; 1423};
1411 1424
1412/* global variables */
1413extern struct security_operations *security_ops;
1414
1415/* inline stuff */
1416static inline int security_ptrace (struct task_struct * parent, struct task_struct * child)
1417{
1418 return security_ops->ptrace (parent, child);
1419}
1420
1421static inline int security_capget (struct task_struct *target,
1422 kernel_cap_t *effective,
1423 kernel_cap_t *inheritable,
1424 kernel_cap_t *permitted)
1425{
1426 return security_ops->capget (target, effective, inheritable, permitted);
1427}
1428
1429static inline int security_capset_check (struct task_struct *target,
1430 kernel_cap_t *effective,
1431 kernel_cap_t *inheritable,
1432 kernel_cap_t *permitted)
1433{
1434 return security_ops->capset_check (target, effective, inheritable, permitted);
1435}
1436
1437static inline void security_capset_set (struct task_struct *target,
1438 kernel_cap_t *effective,
1439 kernel_cap_t *inheritable,
1440 kernel_cap_t *permitted)
1441{
1442 security_ops->capset_set (target, effective, inheritable, permitted);
1443}
1444
1445static inline int security_capable(struct task_struct *tsk, int cap)
1446{
1447 return security_ops->capable(tsk, cap);
1448}
1449
1450static inline int security_acct (struct file *file)
1451{
1452 return security_ops->acct (file);
1453}
1454
1455static inline int security_sysctl(struct ctl_table *table, int op)
1456{
1457 return security_ops->sysctl(table, op);
1458}
1459
1460static inline int security_quotactl (int cmds, int type, int id,
1461 struct super_block *sb)
1462{
1463 return security_ops->quotactl (cmds, type, id, sb);
1464}
1465
1466static inline int security_quota_on (struct dentry * dentry)
1467{
1468 return security_ops->quota_on (dentry);
1469}
1470
1471static inline int security_syslog(int type)
1472{
1473 return security_ops->syslog(type);
1474}
1475
1476static inline int security_settime(struct timespec *ts, struct timezone *tz)
1477{
1478 return security_ops->settime(ts, tz);
1479}
1480
1481static inline int security_vm_enough_memory(long pages)
1482{
1483 return security_ops->vm_enough_memory(current->mm, pages);
1484}
1485
1486static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1487{
1488 return security_ops->vm_enough_memory(mm, pages);
1489}
1490
1491static inline int security_bprm_alloc (struct linux_binprm *bprm)
1492{
1493 return security_ops->bprm_alloc_security (bprm);
1494}
1495static inline void security_bprm_free (struct linux_binprm *bprm)
1496{
1497 security_ops->bprm_free_security (bprm);
1498}
1499static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int unsafe)
1500{
1501 security_ops->bprm_apply_creds (bprm, unsafe);
1502}
1503static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm)
1504{
1505 security_ops->bprm_post_apply_creds (bprm);
1506}
1507static inline int security_bprm_set (struct linux_binprm *bprm)
1508{
1509 return security_ops->bprm_set_security (bprm);
1510}
1511
1512static inline int security_bprm_check (struct linux_binprm *bprm)
1513{
1514 return security_ops->bprm_check_security (bprm);
1515}
1516
1517static inline int security_bprm_secureexec (struct linux_binprm *bprm)
1518{
1519 return security_ops->bprm_secureexec (bprm);
1520}
1521
1522static inline int security_sb_alloc (struct super_block *sb)
1523{
1524 return security_ops->sb_alloc_security (sb);
1525}
1526
1527static inline void security_sb_free (struct super_block *sb)
1528{
1529 security_ops->sb_free_security (sb);
1530}
1531
1532static inline int security_sb_copy_data (struct file_system_type *type,
1533 void *orig, void *copy)
1534{
1535 return security_ops->sb_copy_data (type, orig, copy);
1536}
1537
1538static inline int security_sb_kern_mount (struct super_block *sb, void *data)
1539{
1540 return security_ops->sb_kern_mount (sb, data);
1541}
1542
1543static inline int security_sb_statfs (struct dentry *dentry)
1544{
1545 return security_ops->sb_statfs (dentry);
1546}
1547
1548static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
1549 char *type, unsigned long flags,
1550 void *data)
1551{
1552 return security_ops->sb_mount (dev_name, nd, type, flags, data);
1553}
1554
1555static inline int security_sb_check_sb (struct vfsmount *mnt,
1556 struct nameidata *nd)
1557{
1558 return security_ops->sb_check_sb (mnt, nd);
1559}
1560
1561static inline int security_sb_umount (struct vfsmount *mnt, int flags)
1562{
1563 return security_ops->sb_umount (mnt, flags);
1564}
1565
1566static inline void security_sb_umount_close (struct vfsmount *mnt)
1567{
1568 security_ops->sb_umount_close (mnt);
1569}
1570
1571static inline void security_sb_umount_busy (struct vfsmount *mnt)
1572{
1573 security_ops->sb_umount_busy (mnt);
1574}
1575
1576static inline void security_sb_post_remount (struct vfsmount *mnt,
1577 unsigned long flags, void *data)
1578{
1579 security_ops->sb_post_remount (mnt, flags, data);
1580}
1581
1582static inline void security_sb_post_mountroot (void)
1583{
1584 security_ops->sb_post_mountroot ();
1585}
1586
1587static inline void security_sb_post_addmount (struct vfsmount *mnt,
1588 struct nameidata *mountpoint_nd)
1589{
1590 security_ops->sb_post_addmount (mnt, mountpoint_nd);
1591}
1592
1593static inline int security_sb_pivotroot (struct nameidata *old_nd,
1594 struct nameidata *new_nd)
1595{
1596 return security_ops->sb_pivotroot (old_nd, new_nd);
1597}
1598
1599static inline void security_sb_post_pivotroot (struct nameidata *old_nd,
1600 struct nameidata *new_nd)
1601{
1602 security_ops->sb_post_pivotroot (old_nd, new_nd);
1603}
1604
1605static inline int security_inode_alloc (struct inode *inode)
1606{
1607 inode->i_security = NULL;
1608 return security_ops->inode_alloc_security (inode);
1609}
1610
1611static inline void security_inode_free (struct inode *inode)
1612{
1613 security_ops->inode_free_security (inode);
1614}
1615
1616static inline int security_inode_init_security (struct inode *inode,
1617 struct inode *dir,
1618 char **name,
1619 void **value,
1620 size_t *len)
1621{
1622 if (unlikely (IS_PRIVATE (inode)))
1623 return -EOPNOTSUPP;
1624 return security_ops->inode_init_security (inode, dir, name, value, len);
1625}
1626
1627static inline int security_inode_create (struct inode *dir,
1628 struct dentry *dentry,
1629 int mode)
1630{
1631 if (unlikely (IS_PRIVATE (dir)))
1632 return 0;
1633 return security_ops->inode_create (dir, dentry, mode);
1634}
1635
1636static inline int security_inode_link (struct dentry *old_dentry,
1637 struct inode *dir,
1638 struct dentry *new_dentry)
1639{
1640 if (unlikely (IS_PRIVATE (old_dentry->d_inode)))
1641 return 0;
1642 return security_ops->inode_link (old_dentry, dir, new_dentry);
1643}
1644
1645static inline int security_inode_unlink (struct inode *dir,
1646 struct dentry *dentry)
1647{
1648 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1649 return 0;
1650 return security_ops->inode_unlink (dir, dentry);
1651}
1652
1653static inline int security_inode_symlink (struct inode *dir,
1654 struct dentry *dentry,
1655 const char *old_name)
1656{
1657 if (unlikely (IS_PRIVATE (dir)))
1658 return 0;
1659 return security_ops->inode_symlink (dir, dentry, old_name);
1660}
1661
1662static inline int security_inode_mkdir (struct inode *dir,
1663 struct dentry *dentry,
1664 int mode)
1665{
1666 if (unlikely (IS_PRIVATE (dir)))
1667 return 0;
1668 return security_ops->inode_mkdir (dir, dentry, mode);
1669}
1670
1671static inline int security_inode_rmdir (struct inode *dir,
1672 struct dentry *dentry)
1673{
1674 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1675 return 0;
1676 return security_ops->inode_rmdir (dir, dentry);
1677}
1678
1679static inline int security_inode_mknod (struct inode *dir,
1680 struct dentry *dentry,
1681 int mode, dev_t dev)
1682{
1683 if (unlikely (IS_PRIVATE (dir)))
1684 return 0;
1685 return security_ops->inode_mknod (dir, dentry, mode, dev);
1686}
1687
1688static inline int security_inode_rename (struct inode *old_dir,
1689 struct dentry *old_dentry,
1690 struct inode *new_dir,
1691 struct dentry *new_dentry)
1692{
1693 if (unlikely (IS_PRIVATE (old_dentry->d_inode) ||
1694 (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode))))
1695 return 0;
1696 return security_ops->inode_rename (old_dir, old_dentry,
1697 new_dir, new_dentry);
1698}
1699
1700static inline int security_inode_readlink (struct dentry *dentry)
1701{
1702 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1703 return 0;
1704 return security_ops->inode_readlink (dentry);
1705}
1706
1707static inline int security_inode_follow_link (struct dentry *dentry,
1708 struct nameidata *nd)
1709{
1710 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1711 return 0;
1712 return security_ops->inode_follow_link (dentry, nd);
1713}
1714
1715static inline int security_inode_permission (struct inode *inode, int mask,
1716 struct nameidata *nd)
1717{
1718 if (unlikely (IS_PRIVATE (inode)))
1719 return 0;
1720 return security_ops->inode_permission (inode, mask, nd);
1721}
1722
1723static inline int security_inode_setattr (struct dentry *dentry,
1724 struct iattr *attr)
1725{
1726 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1727 return 0;
1728 return security_ops->inode_setattr (dentry, attr);
1729}
1730
1731static inline int security_inode_getattr (struct vfsmount *mnt,
1732 struct dentry *dentry)
1733{
1734 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1735 return 0;
1736 return security_ops->inode_getattr (mnt, dentry);
1737}
1738
1739static inline void security_inode_delete (struct inode *inode)
1740{
1741 if (unlikely (IS_PRIVATE (inode)))
1742 return;
1743 security_ops->inode_delete (inode);
1744}
1745
1746static inline int security_inode_setxattr (struct dentry *dentry, char *name,
1747 void *value, size_t size, int flags)
1748{
1749 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1750 return 0;
1751 return security_ops->inode_setxattr (dentry, name, value, size, flags);
1752}
1753
1754static inline void security_inode_post_setxattr (struct dentry *dentry, char *name,
1755 void *value, size_t size, int flags)
1756{
1757 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1758 return;
1759 security_ops->inode_post_setxattr (dentry, name, value, size, flags);
1760}
1761
1762static inline int security_inode_getxattr (struct dentry *dentry, char *name)
1763{
1764 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1765 return 0;
1766 return security_ops->inode_getxattr (dentry, name);
1767}
1768
1769static inline int security_inode_listxattr (struct dentry *dentry)
1770{
1771 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1772 return 0;
1773 return security_ops->inode_listxattr (dentry);
1774}
1775
1776static inline int security_inode_removexattr (struct dentry *dentry, char *name)
1777{
1778 if (unlikely (IS_PRIVATE (dentry->d_inode)))
1779 return 0;
1780 return security_ops->inode_removexattr (dentry, name);
1781}
1782
1783static inline const char *security_inode_xattr_getsuffix(void)
1784{
1785 return security_ops->inode_xattr_getsuffix();
1786}
1787
1788static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err)
1789{
1790 if (unlikely (IS_PRIVATE (inode)))
1791 return 0;
1792 return security_ops->inode_getsecurity(inode, name, buffer, size, err);
1793}
1794
1795static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags)
1796{
1797 if (unlikely (IS_PRIVATE (inode)))
1798 return 0;
1799 return security_ops->inode_setsecurity(inode, name, value, size, flags);
1800}
1801
1802static inline int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size)
1803{
1804 if (unlikely (IS_PRIVATE (inode)))
1805 return 0;
1806 return security_ops->inode_listsecurity(inode, buffer, buffer_size);
1807}
1808
1809static inline int security_file_permission (struct file *file, int mask)
1810{
1811 return security_ops->file_permission (file, mask);
1812}
1813
1814static inline int security_file_alloc (struct file *file)
1815{
1816 return security_ops->file_alloc_security (file);
1817}
1818
1819static inline void security_file_free (struct file *file)
1820{
1821 security_ops->file_free_security (file);
1822}
1823
1824static inline int security_file_ioctl (struct file *file, unsigned int cmd,
1825 unsigned long arg)
1826{
1827 return security_ops->file_ioctl (file, cmd, arg);
1828}
1829
1830static inline int security_file_mmap (struct file *file, unsigned long reqprot,
1831 unsigned long prot,
1832 unsigned long flags,
1833 unsigned long addr,
1834 unsigned long addr_only)
1835{
1836 return security_ops->file_mmap (file, reqprot, prot, flags, addr,
1837 addr_only);
1838}
1839
1840static inline int security_file_mprotect (struct vm_area_struct *vma,
1841 unsigned long reqprot,
1842 unsigned long prot)
1843{
1844 return security_ops->file_mprotect (vma, reqprot, prot);
1845}
1846
1847static inline int security_file_lock (struct file *file, unsigned int cmd)
1848{
1849 return security_ops->file_lock (file, cmd);
1850}
1851
1852static inline int security_file_fcntl (struct file *file, unsigned int cmd,
1853 unsigned long arg)
1854{
1855 return security_ops->file_fcntl (file, cmd, arg);
1856}
1857
1858static inline int security_file_set_fowner (struct file *file)
1859{
1860 return security_ops->file_set_fowner (file);
1861}
1862
1863static inline int security_file_send_sigiotask (struct task_struct *tsk,
1864 struct fown_struct *fown,
1865 int sig)
1866{
1867 return security_ops->file_send_sigiotask (tsk, fown, sig);
1868}
1869
1870static inline int security_file_receive (struct file *file)
1871{
1872 return security_ops->file_receive (file);
1873}
1874
1875static inline int security_dentry_open (struct file *file)
1876{
1877 return security_ops->dentry_open (file);
1878}
1879
1880static inline int security_task_create (unsigned long clone_flags)
1881{
1882 return security_ops->task_create (clone_flags);
1883}
1884
1885static inline int security_task_alloc (struct task_struct *p)
1886{
1887 return security_ops->task_alloc_security (p);
1888}
1889
1890static inline void security_task_free (struct task_struct *p)
1891{
1892 security_ops->task_free_security (p);
1893}
1894
1895static inline int security_task_setuid (uid_t id0, uid_t id1, uid_t id2,
1896 int flags)
1897{
1898 return security_ops->task_setuid (id0, id1, id2, flags);
1899}
1900
1901static inline int security_task_post_setuid (uid_t old_ruid, uid_t old_euid,
1902 uid_t old_suid, int flags)
1903{
1904 return security_ops->task_post_setuid (old_ruid, old_euid, old_suid, flags);
1905}
1906
1907static inline int security_task_setgid (gid_t id0, gid_t id1, gid_t id2,
1908 int flags)
1909{
1910 return security_ops->task_setgid (id0, id1, id2, flags);
1911}
1912
1913static inline int security_task_setpgid (struct task_struct *p, pid_t pgid)
1914{
1915 return security_ops->task_setpgid (p, pgid);
1916}
1917
1918static inline int security_task_getpgid (struct task_struct *p)
1919{
1920 return security_ops->task_getpgid (p);
1921}
1922
1923static inline int security_task_getsid (struct task_struct *p)
1924{
1925 return security_ops->task_getsid (p);
1926}
1927
1928static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
1929{
1930 security_ops->task_getsecid (p, secid);
1931}
1932
1933static inline int security_task_setgroups (struct group_info *group_info)
1934{
1935 return security_ops->task_setgroups (group_info);
1936}
1937
1938static inline int security_task_setnice (struct task_struct *p, int nice)
1939{
1940 return security_ops->task_setnice (p, nice);
1941}
1942
1943static inline int security_task_setioprio (struct task_struct *p, int ioprio)
1944{
1945 return security_ops->task_setioprio (p, ioprio);
1946}
1947
1948static inline int security_task_getioprio (struct task_struct *p)
1949{
1950 return security_ops->task_getioprio (p);
1951}
1952
1953static inline int security_task_setrlimit (unsigned int resource,
1954 struct rlimit *new_rlim)
1955{
1956 return security_ops->task_setrlimit (resource, new_rlim);
1957}
1958
1959static inline int security_task_setscheduler (struct task_struct *p,
1960 int policy,
1961 struct sched_param *lp)
1962{
1963 return security_ops->task_setscheduler (p, policy, lp);
1964}
1965
1966static inline int security_task_getscheduler (struct task_struct *p)
1967{
1968 return security_ops->task_getscheduler (p);
1969}
1970
1971static inline int security_task_movememory (struct task_struct *p)
1972{
1973 return security_ops->task_movememory (p);
1974}
1975
1976static inline int security_task_kill (struct task_struct *p,
1977 struct siginfo *info, int sig,
1978 u32 secid)
1979{
1980 return security_ops->task_kill (p, info, sig, secid);
1981}
1982
1983static inline int security_task_wait (struct task_struct *p)
1984{
1985 return security_ops->task_wait (p);
1986}
1987
1988static inline int security_task_prctl (int option, unsigned long arg2,
1989 unsigned long arg3,
1990 unsigned long arg4,
1991 unsigned long arg5)
1992{
1993 return security_ops->task_prctl (option, arg2, arg3, arg4, arg5);
1994}
1995
1996static inline void security_task_reparent_to_init (struct task_struct *p)
1997{
1998 security_ops->task_reparent_to_init (p);
1999}
2000
2001static inline void security_task_to_inode(struct task_struct *p, struct inode *inode)
2002{
2003 security_ops->task_to_inode(p, inode);
2004}
2005
2006static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
2007 short flag)
2008{
2009 return security_ops->ipc_permission (ipcp, flag);
2010}
2011
2012static inline int security_msg_msg_alloc (struct msg_msg * msg)
2013{
2014 return security_ops->msg_msg_alloc_security (msg);
2015}
2016
2017static inline void security_msg_msg_free (struct msg_msg * msg)
2018{
2019 security_ops->msg_msg_free_security(msg);
2020}
2021
2022static inline int security_msg_queue_alloc (struct msg_queue *msq)
2023{
2024 return security_ops->msg_queue_alloc_security (msq);
2025}
2026
2027static inline void security_msg_queue_free (struct msg_queue *msq)
2028{
2029 security_ops->msg_queue_free_security (msq);
2030}
2031
2032static inline int security_msg_queue_associate (struct msg_queue * msq,
2033 int msqflg)
2034{
2035 return security_ops->msg_queue_associate (msq, msqflg);
2036}
2037
2038static inline int security_msg_queue_msgctl (struct msg_queue * msq, int cmd)
2039{
2040 return security_ops->msg_queue_msgctl (msq, cmd);
2041}
2042
2043static inline int security_msg_queue_msgsnd (struct msg_queue * msq,
2044 struct msg_msg * msg, int msqflg)
2045{
2046 return security_ops->msg_queue_msgsnd (msq, msg, msqflg);
2047}
2048
2049static inline int security_msg_queue_msgrcv (struct msg_queue * msq,
2050 struct msg_msg * msg,
2051 struct task_struct * target,
2052 long type, int mode)
2053{
2054 return security_ops->msg_queue_msgrcv (msq, msg, target, type, mode);
2055}
2056
2057static inline int security_shm_alloc (struct shmid_kernel *shp)
2058{
2059 return security_ops->shm_alloc_security (shp);
2060}
2061
2062static inline void security_shm_free (struct shmid_kernel *shp)
2063{
2064 security_ops->shm_free_security (shp);
2065}
2066
2067static inline int security_shm_associate (struct shmid_kernel * shp,
2068 int shmflg)
2069{
2070 return security_ops->shm_associate(shp, shmflg);
2071}
2072
2073static inline int security_shm_shmctl (struct shmid_kernel * shp, int cmd)
2074{
2075 return security_ops->shm_shmctl (shp, cmd);
2076}
2077
2078static inline int security_shm_shmat (struct shmid_kernel * shp,
2079 char __user *shmaddr, int shmflg)
2080{
2081 return security_ops->shm_shmat(shp, shmaddr, shmflg);
2082}
2083
2084static inline int security_sem_alloc (struct sem_array *sma)
2085{
2086 return security_ops->sem_alloc_security (sma);
2087}
2088
2089static inline void security_sem_free (struct sem_array *sma)
2090{
2091 security_ops->sem_free_security (sma);
2092}
2093
2094static inline int security_sem_associate (struct sem_array * sma, int semflg)
2095{
2096 return security_ops->sem_associate (sma, semflg);
2097}
2098
2099static inline int security_sem_semctl (struct sem_array * sma, int cmd)
2100{
2101 return security_ops->sem_semctl(sma, cmd);
2102}
2103
2104static inline int security_sem_semop (struct sem_array * sma,
2105 struct sembuf * sops, unsigned nsops,
2106 int alter)
2107{
2108 return security_ops->sem_semop(sma, sops, nsops, alter);
2109}
2110
2111static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode)
2112{
2113 if (unlikely (inode && IS_PRIVATE (inode)))
2114 return;
2115 security_ops->d_instantiate (dentry, inode);
2116}
2117
2118static inline int security_getprocattr(struct task_struct *p, char *name, char **value)
2119{
2120 return security_ops->getprocattr(p, name, value);
2121}
2122
2123static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size)
2124{
2125 return security_ops->setprocattr(p, name, value, size);
2126}
2127
2128static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb)
2129{
2130 return security_ops->netlink_send(sk, skb);
2131}
2132
2133static inline int security_netlink_recv(struct sk_buff * skb, int cap)
2134{
2135 return security_ops->netlink_recv(skb, cap);
2136}
2137
2138static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2139{
2140 return security_ops->secid_to_secctx(secid, secdata, seclen);
2141}
2142
2143static inline void security_release_secctx(char *secdata, u32 seclen)
2144{
2145 return security_ops->release_secctx(secdata, seclen);
2146}
2147
2148/* prototypes */ 1425/* prototypes */
2149extern int security_init (void); 1426extern int security_init (void);
2150extern int register_security (struct security_operations *ops); 1427extern int register_security (struct security_operations *ops);
2151extern int unregister_security (struct security_operations *ops);
2152extern int mod_reg_security (const char *name, struct security_operations *ops); 1428extern int mod_reg_security (const char *name, struct security_operations *ops);
2153extern int mod_unreg_security (const char *name, struct security_operations *ops);
2154extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 1429extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
2155 struct dentry *parent, void *data, 1430 struct dentry *parent, void *data,
2156 const struct file_operations *fops); 1431 const struct file_operations *fops);
@@ -2158,6 +1433,158 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par
2158extern void securityfs_remove(struct dentry *dentry); 1433extern void securityfs_remove(struct dentry *dentry);
2159 1434
2160 1435
1436/* Security operations */
1437int security_ptrace(struct task_struct *parent, struct task_struct *child);
1438int security_capget(struct task_struct *target,
1439 kernel_cap_t *effective,
1440 kernel_cap_t *inheritable,
1441 kernel_cap_t *permitted);
1442int security_capset_check(struct task_struct *target,
1443 kernel_cap_t *effective,
1444 kernel_cap_t *inheritable,
1445 kernel_cap_t *permitted);
1446void security_capset_set(struct task_struct *target,
1447 kernel_cap_t *effective,
1448 kernel_cap_t *inheritable,
1449 kernel_cap_t *permitted);
1450int security_capable(struct task_struct *tsk, int cap);
1451int security_acct(struct file *file);
1452int security_sysctl(struct ctl_table *table, int op);
1453int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1454int security_quota_on(struct dentry *dentry);
1455int security_syslog(int type);
1456int security_settime(struct timespec *ts, struct timezone *tz);
1457int security_vm_enough_memory(long pages);
1458int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
1459int security_bprm_alloc(struct linux_binprm *bprm);
1460void security_bprm_free(struct linux_binprm *bprm);
1461void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe);
1462void security_bprm_post_apply_creds(struct linux_binprm *bprm);
1463int security_bprm_set(struct linux_binprm *bprm);
1464int security_bprm_check(struct linux_binprm *bprm);
1465int security_bprm_secureexec(struct linux_binprm *bprm);
1466int security_sb_alloc(struct super_block *sb);
1467void security_sb_free(struct super_block *sb);
1468int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy);
1469int security_sb_kern_mount(struct super_block *sb, void *data);
1470int security_sb_statfs(struct dentry *dentry);
1471int security_sb_mount(char *dev_name, struct nameidata *nd,
1472 char *type, unsigned long flags, void *data);
1473int security_sb_check_sb(struct vfsmount *mnt, struct nameidata *nd);
1474int security_sb_umount(struct vfsmount *mnt, int flags);
1475void security_sb_umount_close(struct vfsmount *mnt);
1476void security_sb_umount_busy(struct vfsmount *mnt);
1477void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data);
1478void security_sb_post_mountroot(void);
1479void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd);
1480int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd);
1481void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd);
1482int security_inode_alloc(struct inode *inode);
1483void security_inode_free(struct inode *inode);
1484int security_inode_init_security(struct inode *inode, struct inode *dir,
1485 char **name, void **value, size_t *len);
1486int security_inode_create(struct inode *dir, struct dentry *dentry, int mode);
1487int security_inode_link(struct dentry *old_dentry, struct inode *dir,
1488 struct dentry *new_dentry);
1489int security_inode_unlink(struct inode *dir, struct dentry *dentry);
1490int security_inode_symlink(struct inode *dir, struct dentry *dentry,
1491 const char *old_name);
1492int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode);
1493int security_inode_rmdir(struct inode *dir, struct dentry *dentry);
1494int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev);
1495int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1496 struct inode *new_dir, struct dentry *new_dentry);
1497int security_inode_readlink(struct dentry *dentry);
1498int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1499int security_inode_permission(struct inode *inode, int mask, struct nameidata *nd);
1500int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1501int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1502void security_inode_delete(struct inode *inode);
1503int security_inode_setxattr(struct dentry *dentry, char *name,
1504 void *value, size_t size, int flags);
1505void security_inode_post_setxattr(struct dentry *dentry, char *name,
1506 void *value, size_t size, int flags);
1507int security_inode_getxattr(struct dentry *dentry, char *name);
1508int security_inode_listxattr(struct dentry *dentry);
1509int security_inode_removexattr(struct dentry *dentry, char *name);
1510int security_inode_need_killpriv(struct dentry *dentry);
1511int security_inode_killpriv(struct dentry *dentry);
1512int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err);
1513int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1514int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
1515int security_file_permission(struct file *file, int mask);
1516int security_file_alloc(struct file *file);
1517void security_file_free(struct file *file);
1518int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1519int security_file_mmap(struct file *file, unsigned long reqprot,
1520 unsigned long prot, unsigned long flags,
1521 unsigned long addr, unsigned long addr_only);
1522int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
1523 unsigned long prot);
1524int security_file_lock(struct file *file, unsigned int cmd);
1525int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
1526int security_file_set_fowner(struct file *file);
1527int security_file_send_sigiotask(struct task_struct *tsk,
1528 struct fown_struct *fown, int sig);
1529int security_file_receive(struct file *file);
1530int security_dentry_open(struct file *file);
1531int security_task_create(unsigned long clone_flags);
1532int security_task_alloc(struct task_struct *p);
1533void security_task_free(struct task_struct *p);
1534int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1535int security_task_post_setuid(uid_t old_ruid, uid_t old_euid,
1536 uid_t old_suid, int flags);
1537int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags);
1538int security_task_setpgid(struct task_struct *p, pid_t pgid);
1539int security_task_getpgid(struct task_struct *p);
1540int security_task_getsid(struct task_struct *p);
1541void security_task_getsecid(struct task_struct *p, u32 *secid);
1542int security_task_setgroups(struct group_info *group_info);
1543int security_task_setnice(struct task_struct *p, int nice);
1544int security_task_setioprio(struct task_struct *p, int ioprio);
1545int security_task_getioprio(struct task_struct *p);
1546int security_task_setrlimit(unsigned int resource, struct rlimit *new_rlim);
1547int security_task_setscheduler(struct task_struct *p,
1548 int policy, struct sched_param *lp);
1549int security_task_getscheduler(struct task_struct *p);
1550int security_task_movememory(struct task_struct *p);
1551int security_task_kill(struct task_struct *p, struct siginfo *info,
1552 int sig, u32 secid);
1553int security_task_wait(struct task_struct *p);
1554int security_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1555 unsigned long arg4, unsigned long arg5);
1556void security_task_reparent_to_init(struct task_struct *p);
1557void security_task_to_inode(struct task_struct *p, struct inode *inode);
1558int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag);
1559int security_msg_msg_alloc(struct msg_msg *msg);
1560void security_msg_msg_free(struct msg_msg *msg);
1561int security_msg_queue_alloc(struct msg_queue *msq);
1562void security_msg_queue_free(struct msg_queue *msq);
1563int security_msg_queue_associate(struct msg_queue *msq, int msqflg);
1564int security_msg_queue_msgctl(struct msg_queue *msq, int cmd);
1565int security_msg_queue_msgsnd(struct msg_queue *msq,
1566 struct msg_msg *msg, int msqflg);
1567int security_msg_queue_msgrcv(struct msg_queue *msq, struct msg_msg *msg,
1568 struct task_struct *target, long type, int mode);
1569int security_shm_alloc(struct shmid_kernel *shp);
1570void security_shm_free(struct shmid_kernel *shp);
1571int security_shm_associate(struct shmid_kernel *shp, int shmflg);
1572int security_shm_shmctl(struct shmid_kernel *shp, int cmd);
1573int security_shm_shmat(struct shmid_kernel *shp, char __user *shmaddr, int shmflg);
1574int security_sem_alloc(struct sem_array *sma);
1575void security_sem_free(struct sem_array *sma);
1576int security_sem_associate(struct sem_array *sma, int semflg);
1577int security_sem_semctl(struct sem_array *sma, int cmd);
1578int security_sem_semop(struct sem_array *sma, struct sembuf *sops,
1579 unsigned nsops, int alter);
1580void security_d_instantiate (struct dentry *dentry, struct inode *inode);
1581int security_getprocattr(struct task_struct *p, char *name, char **value);
1582int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size);
1583int security_netlink_send(struct sock *sk, struct sk_buff *skb);
1584int security_netlink_recv(struct sk_buff *skb, int cap);
1585int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
1586void security_release_secctx(char *secdata, u32 seclen);
1587
2161#else /* CONFIG_SECURITY */ 1588#else /* CONFIG_SECURITY */
2162 1589
2163/* 1590/*
@@ -2476,9 +1903,14 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name)
2476 return cap_inode_removexattr(dentry, name); 1903 return cap_inode_removexattr(dentry, name);
2477} 1904}
2478 1905
2479static inline const char *security_inode_xattr_getsuffix (void) 1906static inline int security_inode_need_killpriv(struct dentry *dentry)
2480{ 1907{
2481 return NULL ; 1908 return cap_inode_need_killpriv(dentry);
1909}
1910
1911static inline int security_inode_killpriv(struct dentry *dentry)
1912{
1913 return cap_inode_killpriv(dentry);
2482} 1914}
2483 1915
2484static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) 1916static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err)
@@ -2620,12 +2052,12 @@ static inline int security_task_setgroups (struct group_info *group_info)
2620 2052
2621static inline int security_task_setnice (struct task_struct *p, int nice) 2053static inline int security_task_setnice (struct task_struct *p, int nice)
2622{ 2054{
2623 return 0; 2055 return cap_task_setnice(p, nice);
2624} 2056}
2625 2057
2626static inline int security_task_setioprio (struct task_struct *p, int ioprio) 2058static inline int security_task_setioprio (struct task_struct *p, int ioprio)
2627{ 2059{
2628 return 0; 2060 return cap_task_setioprio(p, ioprio);
2629} 2061}
2630 2062
2631static inline int security_task_getioprio (struct task_struct *p) 2063static inline int security_task_getioprio (struct task_struct *p)
@@ -2643,7 +2075,7 @@ static inline int security_task_setscheduler (struct task_struct *p,
2643 int policy, 2075 int policy,
2644 struct sched_param *lp) 2076 struct sched_param *lp)
2645{ 2077{
2646 return 0; 2078 return cap_task_setscheduler(p, policy, lp);
2647} 2079}
2648 2080
2649static inline int security_task_getscheduler (struct task_struct *p) 2081static inline int security_task_getscheduler (struct task_struct *p)
@@ -2660,7 +2092,7 @@ static inline int security_task_kill (struct task_struct *p,
2660 struct siginfo *info, int sig, 2092 struct siginfo *info, int sig,
2661 u32 secid) 2093 u32 secid)
2662{ 2094{
2663 return 0; 2095 return cap_task_kill(p, info, sig, secid);
2664} 2096}
2665 2097
2666static inline int security_task_wait (struct task_struct *p) 2098static inline int security_task_wait (struct task_struct *p)
@@ -2834,170 +2266,43 @@ static inline void security_release_secctx(char *secdata, u32 seclen)
2834#endif /* CONFIG_SECURITY */ 2266#endif /* CONFIG_SECURITY */
2835 2267
2836#ifdef CONFIG_SECURITY_NETWORK 2268#ifdef CONFIG_SECURITY_NETWORK
2837static inline int security_unix_stream_connect(struct socket * sock,
2838 struct socket * other,
2839 struct sock * newsk)
2840{
2841 return security_ops->unix_stream_connect(sock, other, newsk);
2842}
2843 2269
2270int security_unix_stream_connect(struct socket *sock, struct socket *other,
2271 struct sock *newsk);
2272int security_unix_may_send(struct socket *sock, struct socket *other);
2273int security_socket_create(int family, int type, int protocol, int kern);
2274int security_socket_post_create(struct socket *sock, int family,
2275 int type, int protocol, int kern);
2276int security_socket_bind(struct socket *sock, struct sockaddr *address, int addrlen);
2277int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen);
2278int security_socket_listen(struct socket *sock, int backlog);
2279int security_socket_accept(struct socket *sock, struct socket *newsock);
2280void security_socket_post_accept(struct socket *sock, struct socket *newsock);
2281int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size);
2282int security_socket_recvmsg(struct socket *sock, struct msghdr *msg,
2283 int size, int flags);
2284int security_socket_getsockname(struct socket *sock);
2285int security_socket_getpeername(struct socket *sock);
2286int security_socket_getsockopt(struct socket *sock, int level, int optname);
2287int security_socket_setsockopt(struct socket *sock, int level, int optname);
2288int security_socket_shutdown(struct socket *sock, int how);
2289int security_sock_rcv_skb(struct sock *sk, struct sk_buff *skb);
2290int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2291 int __user *optlen, unsigned len);
2292int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid);
2293int security_sk_alloc(struct sock *sk, int family, gfp_t priority);
2294void security_sk_free(struct sock *sk);
2295void security_sk_clone(const struct sock *sk, struct sock *newsk);
2296void security_sk_classify_flow(struct sock *sk, struct flowi *fl);
2297void security_req_classify_flow(const struct request_sock *req, struct flowi *fl);
2298void security_sock_graft(struct sock*sk, struct socket *parent);
2299int security_inet_conn_request(struct sock *sk,
2300 struct sk_buff *skb, struct request_sock *req);
2301void security_inet_csk_clone(struct sock *newsk,
2302 const struct request_sock *req);
2303void security_inet_conn_established(struct sock *sk,
2304 struct sk_buff *skb);
2844 2305
2845static inline int security_unix_may_send(struct socket * sock,
2846 struct socket * other)
2847{
2848 return security_ops->unix_may_send(sock, other);
2849}
2850
2851static inline int security_socket_create (int family, int type,
2852 int protocol, int kern)
2853{
2854 return security_ops->socket_create(family, type, protocol, kern);
2855}
2856
2857static inline int security_socket_post_create(struct socket * sock,
2858 int family,
2859 int type,
2860 int protocol, int kern)
2861{
2862 return security_ops->socket_post_create(sock, family, type,
2863 protocol, kern);
2864}
2865
2866static inline int security_socket_bind(struct socket * sock,
2867 struct sockaddr * address,
2868 int addrlen)
2869{
2870 return security_ops->socket_bind(sock, address, addrlen);
2871}
2872
2873static inline int security_socket_connect(struct socket * sock,
2874 struct sockaddr * address,
2875 int addrlen)
2876{
2877 return security_ops->socket_connect(sock, address, addrlen);
2878}
2879
2880static inline int security_socket_listen(struct socket * sock, int backlog)
2881{
2882 return security_ops->socket_listen(sock, backlog);
2883}
2884
2885static inline int security_socket_accept(struct socket * sock,
2886 struct socket * newsock)
2887{
2888 return security_ops->socket_accept(sock, newsock);
2889}
2890
2891static inline void security_socket_post_accept(struct socket * sock,
2892 struct socket * newsock)
2893{
2894 security_ops->socket_post_accept(sock, newsock);
2895}
2896
2897static inline int security_socket_sendmsg(struct socket * sock,
2898 struct msghdr * msg, int size)
2899{
2900 return security_ops->socket_sendmsg(sock, msg, size);
2901}
2902
2903static inline int security_socket_recvmsg(struct socket * sock,
2904 struct msghdr * msg, int size,
2905 int flags)
2906{
2907 return security_ops->socket_recvmsg(sock, msg, size, flags);
2908}
2909
2910static inline int security_socket_getsockname(struct socket * sock)
2911{
2912 return security_ops->socket_getsockname(sock);
2913}
2914
2915static inline int security_socket_getpeername(struct socket * sock)
2916{
2917 return security_ops->socket_getpeername(sock);
2918}
2919
2920static inline int security_socket_getsockopt(struct socket * sock,
2921 int level, int optname)
2922{
2923 return security_ops->socket_getsockopt(sock, level, optname);
2924}
2925
2926static inline int security_socket_setsockopt(struct socket * sock,
2927 int level, int optname)
2928{
2929 return security_ops->socket_setsockopt(sock, level, optname);
2930}
2931
2932static inline int security_socket_shutdown(struct socket * sock, int how)
2933{
2934 return security_ops->socket_shutdown(sock, how);
2935}
2936
2937static inline int security_sock_rcv_skb (struct sock * sk,
2938 struct sk_buff * skb)
2939{
2940 return security_ops->socket_sock_rcv_skb (sk, skb);
2941}
2942
2943static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2944 int __user *optlen, unsigned len)
2945{
2946 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
2947}
2948
2949static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
2950{
2951 return security_ops->socket_getpeersec_dgram(sock, skb, secid);
2952}
2953
2954static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
2955{
2956 return security_ops->sk_alloc_security(sk, family, priority);
2957}
2958
2959static inline void security_sk_free(struct sock *sk)
2960{
2961 return security_ops->sk_free_security(sk);
2962}
2963
2964static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
2965{
2966 return security_ops->sk_clone_security(sk, newsk);
2967}
2968
2969static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl)
2970{
2971 security_ops->sk_getsecid(sk, &fl->secid);
2972}
2973
2974static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl)
2975{
2976 security_ops->req_classify_flow(req, fl);
2977}
2978
2979static inline void security_sock_graft(struct sock* sk, struct socket *parent)
2980{
2981 security_ops->sock_graft(sk, parent);
2982}
2983
2984static inline int security_inet_conn_request(struct sock *sk,
2985 struct sk_buff *skb, struct request_sock *req)
2986{
2987 return security_ops->inet_conn_request(sk, skb, req);
2988}
2989
2990static inline void security_inet_csk_clone(struct sock *newsk,
2991 const struct request_sock *req)
2992{
2993 security_ops->inet_csk_clone(newsk, req);
2994}
2995
2996static inline void security_inet_conn_established(struct sock *sk,
2997 struct sk_buff *skb)
2998{
2999 security_ops->inet_conn_established(sk, skb);
3000}
3001#else /* CONFIG_SECURITY_NETWORK */ 2306#else /* CONFIG_SECURITY_NETWORK */
3002static inline int security_unix_stream_connect(struct socket * sock, 2307static inline int security_unix_stream_connect(struct socket * sock,
3003 struct socket * other, 2308 struct socket * other,
@@ -3155,77 +2460,24 @@ static inline void security_inet_conn_established(struct sock *sk,
3155#endif /* CONFIG_SECURITY_NETWORK */ 2460#endif /* CONFIG_SECURITY_NETWORK */
3156 2461
3157#ifdef CONFIG_SECURITY_NETWORK_XFRM 2462#ifdef CONFIG_SECURITY_NETWORK_XFRM
3158static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
3159{
3160 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx);
3161}
3162
3163static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
3164{
3165 return security_ops->xfrm_policy_clone_security(old, new);
3166}
3167
3168static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
3169{
3170 security_ops->xfrm_policy_free_security(xp);
3171}
3172
3173static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
3174{
3175 return security_ops->xfrm_policy_delete_security(xp);
3176}
3177 2463
3178static inline int security_xfrm_state_alloc(struct xfrm_state *x, 2464int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
3179 struct xfrm_user_sec_ctx *sec_ctx) 2465int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new);
3180{ 2466void security_xfrm_policy_free(struct xfrm_policy *xp);
3181 return security_ops->xfrm_state_alloc_security(x, sec_ctx, 0); 2467int security_xfrm_policy_delete(struct xfrm_policy *xp);
3182} 2468int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
3183 2469int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
3184static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, 2470 struct xfrm_sec_ctx *polsec, u32 secid);
3185 struct xfrm_sec_ctx *polsec, u32 secid) 2471int security_xfrm_state_delete(struct xfrm_state *x);
3186{ 2472void security_xfrm_state_free(struct xfrm_state *x);
3187 if (!polsec) 2473int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir);
3188 return 0; 2474int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3189 /* 2475 struct xfrm_policy *xp, struct flowi *fl);
3190 * We want the context to be taken from secid which is usually 2476int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid);
3191 * from the sock. 2477void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl);
3192 */
3193 return security_ops->xfrm_state_alloc_security(x, NULL, secid);
3194}
3195
3196static inline int security_xfrm_state_delete(struct xfrm_state *x)
3197{
3198 return security_ops->xfrm_state_delete_security(x);
3199}
3200
3201static inline void security_xfrm_state_free(struct xfrm_state *x)
3202{
3203 security_ops->xfrm_state_free_security(x);
3204}
3205
3206static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir)
3207{
3208 return security_ops->xfrm_policy_lookup(xp, fl_secid, dir);
3209}
3210
3211static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3212 struct xfrm_policy *xp, struct flowi *fl)
3213{
3214 return security_ops->xfrm_state_pol_flow_match(x, xp, fl);
3215}
3216 2478
3217static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3218{
3219 return security_ops->xfrm_decode_session(skb, secid, 1);
3220}
3221
3222static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl)
3223{
3224 int rc = security_ops->xfrm_decode_session(skb, &fl->secid, 0);
3225
3226 BUG_ON(rc);
3227}
3228#else /* CONFIG_SECURITY_NETWORK_XFRM */ 2479#else /* CONFIG_SECURITY_NETWORK_XFRM */
2480
3229static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 2481static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
3230{ 2482{
3231 return 0; 2483 return 0;
@@ -3290,24 +2542,11 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi
3290 2542
3291#ifdef CONFIG_KEYS 2543#ifdef CONFIG_KEYS
3292#ifdef CONFIG_SECURITY 2544#ifdef CONFIG_SECURITY
3293static inline int security_key_alloc(struct key *key,
3294 struct task_struct *tsk,
3295 unsigned long flags)
3296{
3297 return security_ops->key_alloc(key, tsk, flags);
3298}
3299
3300static inline void security_key_free(struct key *key)
3301{
3302 security_ops->key_free(key);
3303}
3304 2545
3305static inline int security_key_permission(key_ref_t key_ref, 2546int security_key_alloc(struct key *key, struct task_struct *tsk, unsigned long flags);
3306 struct task_struct *context, 2547void security_key_free(struct key *key);
3307 key_perm_t perm) 2548int security_key_permission(key_ref_t key_ref,
3308{ 2549 struct task_struct *context, key_perm_t perm);
3309 return security_ops->key_permission(key_ref, context, perm);
3310}
3311 2550
3312#else 2551#else
3313 2552
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 8bf1e05115b4..ebbc02b325fc 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -18,7 +18,7 @@ struct seq_file {
18 size_t from; 18 size_t from;
19 size_t count; 19 size_t count;
20 loff_t index; 20 loff_t index;
21 loff_t version; 21 u64 version;
22 struct mutex lock; 22 struct mutex lock;
23 const struct seq_operations *op; 23 const struct seq_operations *op;
24 void *private; 24 void *private;
diff --git a/include/linux/shm.h b/include/linux/shm.h
index ad2e3af65997..bea65d9c93ef 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -16,7 +16,9 @@
16#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ 16#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
17#define SHMSEG SHMMNI /* max shared segs per process */ 17#define SHMSEG SHMMNI /* max shared segs per process */
18 18
19#ifdef __KERNEL__
19#include <asm/shmparam.h> 20#include <asm/shmparam.h>
21#endif
20 22
21/* Obsolete, used only for backwards compatibility and libc5 compiles */ 23/* Obsolete, used only for backwards compatibility and libc5 compiles */
22struct shmid_ds { 24struct shmid_ds {
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
index 4c9ff0910ae0..86f9b1ef0e09 100644
--- a/include/linux/signalfd.h
+++ b/include/linux/signalfd.h
@@ -10,22 +10,22 @@
10 10
11 11
12struct signalfd_siginfo { 12struct signalfd_siginfo {
13 __u32 signo; 13 __u32 ssi_signo;
14 __s32 err; 14 __s32 ssi_errno;
15 __s32 code; 15 __s32 ssi_code;
16 __u32 pid; 16 __u32 ssi_pid;
17 __u32 uid; 17 __u32 ssi_uid;
18 __s32 fd; 18 __s32 ssi_fd;
19 __u32 tid; 19 __u32 ssi_tid;
20 __u32 band; 20 __u32 ssi_band;
21 __u32 overrun; 21 __u32 ssi_overrun;
22 __u32 trapno; 22 __u32 ssi_trapno;
23 __s32 status; 23 __s32 ssi_status;
24 __s32 svint; 24 __s32 ssi_int;
25 __u64 svptr; 25 __u64 ssi_ptr;
26 __u64 utime; 26 __u64 ssi_utime;
27 __u64 stime; 27 __u64 ssi_stime;
28 __u64 addr; 28 __u64 ssi_addr;
29 29
30 /* 30 /*
31 * Pad strcture to 128 bytes. Remember to update the 31 * Pad strcture to 128 bytes. Remember to update the
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 3a5bad3ad126..f3a8eecd99f3 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -53,7 +53,7 @@ int slab_is_available(void);
53 53
54struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 54struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
55 unsigned long, 55 unsigned long,
56 void (*)(void *, struct kmem_cache *, unsigned long)); 56 void (*)(struct kmem_cache *, void *));
57void kmem_cache_destroy(struct kmem_cache *); 57void kmem_cache_destroy(struct kmem_cache *);
58int kmem_cache_shrink(struct kmem_cache *); 58int kmem_cache_shrink(struct kmem_cache *);
59void kmem_cache_free(struct kmem_cache *, void *); 59void kmem_cache_free(struct kmem_cache *, void *);
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index d65159d1d4f5..40801e754afb 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -49,7 +49,7 @@ struct kmem_cache {
49 /* Allocation and freeing of slabs */ 49 /* Allocation and freeing of slabs */
50 int objects; /* Number of objects in slab */ 50 int objects; /* Number of objects in slab */
51 int refcount; /* Refcount for slab cache destroy */ 51 int refcount; /* Refcount for slab cache destroy */
52 void (*ctor)(void *, struct kmem_cache *, unsigned long); 52 void (*ctor)(struct kmem_cache *, void *);
53 int inuse; /* Offset to metadata */ 53 int inuse; /* Offset to metadata */
54 int align; /* Alignment */ 54 int align; /* Alignment */
55 const char *name; /* Name (only for display!) */ 55 const char *name; /* Name (only for display!) */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index edf681a7fd8f..4f3838adbb30 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -158,11 +158,6 @@ struct swap_list_t {
158/* Swap 50% full? Release swapcache more aggressively.. */ 158/* Swap 50% full? Release swapcache more aggressively.. */
159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
160 160
161/* linux/mm/oom_kill.c */
162extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
163extern int register_oom_notifier(struct notifier_block *nb);
164extern int unregister_oom_notifier(struct notifier_block *nb);
165
166/* linux/mm/memory.c */ 161/* linux/mm/memory.c */
167extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 162extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
168 163
diff --git a/include/linux/time.h b/include/linux/time.h
index 6a5f503b4f1d..b04136d60a2f 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -92,7 +92,7 @@ static inline struct timespec timespec_sub(struct timespec lhs,
92 92
93extern struct timespec xtime; 93extern struct timespec xtime;
94extern struct timespec wall_to_monotonic; 94extern struct timespec wall_to_monotonic;
95extern seqlock_t xtime_lock __attribute__((weak)); 95extern seqlock_t xtime_lock;
96 96
97extern unsigned long read_persistent_clock(void); 97extern unsigned long read_persistent_clock(void);
98extern int update_persistent_clock(struct timespec now); 98extern int update_persistent_clock(struct timespec now);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 60478f6e5dc6..56164d7ba0ad 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -81,11 +81,6 @@ struct tty_bufhead {
81 int memory_used; /* Buffer space used excluding free queue */ 81 int memory_used; /* Buffer space used excluding free queue */
82}; 82};
83/* 83/*
84 * The pty uses char_buf and flag_buf as a contiguous buffer
85 */
86#define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE
87
88/*
89 * When a break, frame error, or parity error happens, these codes are 84 * When a break, frame error, or parity error happens, these codes are
90 * stuffed into the flags buffer. 85 * stuffed into the flags buffer.
91 */ 86 */
@@ -321,6 +316,9 @@ extern void tty_flip_buffer_push(struct tty_struct *tty);
321extern speed_t tty_get_baud_rate(struct tty_struct *tty); 316extern speed_t tty_get_baud_rate(struct tty_struct *tty);
322extern speed_t tty_termios_baud_rate(struct ktermios *termios); 317extern speed_t tty_termios_baud_rate(struct ktermios *termios);
323extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 318extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
319extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud);
320extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud);
321extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
324 322
325extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); 323extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
326extern void tty_ldisc_deref(struct tty_ldisc *); 324extern void tty_ldisc_deref(struct tty_ldisc *);
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index daeba22b7656..10b854d3561f 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -46,11 +46,6 @@ typedef __u32 __bitwise __fs32;
46typedef __u16 __bitwise __fs16; 46typedef __u16 __bitwise __fs16;
47#endif 47#endif
48 48
49#ifdef __KERNEL__
50#include <linux/ufs_fs_i.h>
51#include <linux/ufs_fs_sb.h>
52#endif
53
54#define UFS_BBLOCK 0 49#define UFS_BBLOCK 0
55#define UFS_BBSIZE 8192 50#define UFS_BBSIZE 8192
56#define UFS_SBLOCK 8192 51#define UFS_SBLOCK 8192
@@ -170,8 +165,9 @@ typedef __u16 __bitwise __fs16;
170#define UFS_ST_MASK 0x00000700 /* mask for the following */ 165#define UFS_ST_MASK 0x00000700 /* mask for the following */
171#define UFS_ST_OLD 0x00000000 166#define UFS_ST_OLD 0x00000000
172#define UFS_ST_44BSD 0x00000100 167#define UFS_ST_44BSD 0x00000100
173#define UFS_ST_SUN 0x00000200 168#define UFS_ST_SUN 0x00000200 /* Solaris */
174#define UFS_ST_SUNx86 0x00000400 169#define UFS_ST_SUNOS 0x00000300
170#define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */
175/*cylinder group encoding */ 171/*cylinder group encoding */
176#define UFS_CG_MASK 0x00003000 /* mask for the following */ 172#define UFS_CG_MASK 0x00003000 /* mask for the following */
177#define UFS_CG_OLD 0x00000000 173#define UFS_CG_OLD 0x00000000
@@ -187,28 +183,6 @@ typedef __u16 __bitwise __fs16;
187#define UFS_42INODEFMT -1 183#define UFS_42INODEFMT -1
188#define UFS_44INODEFMT 2 184#define UFS_44INODEFMT 2
189 185
190/* mount options */
191#define UFS_MOUNT_ONERROR 0x0000000F
192#define UFS_MOUNT_ONERROR_PANIC 0x00000001
193#define UFS_MOUNT_ONERROR_LOCK 0x00000002
194#define UFS_MOUNT_ONERROR_UMOUNT 0x00000004
195#define UFS_MOUNT_ONERROR_REPAIR 0x00000008
196
197#define UFS_MOUNT_UFSTYPE 0x0000FFF0
198#define UFS_MOUNT_UFSTYPE_OLD 0x00000010
199#define UFS_MOUNT_UFSTYPE_44BSD 0x00000020
200#define UFS_MOUNT_UFSTYPE_SUN 0x00000040
201#define UFS_MOUNT_UFSTYPE_NEXTSTEP 0x00000080
202#define UFS_MOUNT_UFSTYPE_NEXTSTEP_CD 0x00000100
203#define UFS_MOUNT_UFSTYPE_OPENSTEP 0x00000200
204#define UFS_MOUNT_UFSTYPE_SUNx86 0x00000400
205#define UFS_MOUNT_UFSTYPE_HP 0x00000800
206#define UFS_MOUNT_UFSTYPE_UFS2 0x00001000
207
208#define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt
209#define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt
210#define ufs_test_opt(o,opt) ((o) & UFS_MOUNT_##opt)
211
212/* 186/*
213 * MINFREE gives the minimum acceptable percentage of file system 187 * MINFREE gives the minimum acceptable percentage of file system
214 * blocks which may be free. If the freelist drops below this level 188 * blocks which may be free. If the freelist drops below this level
@@ -223,19 +197,6 @@ typedef __u16 __bitwise __fs16;
223 */ 197 */
224#define UFS_MINFREE 5 198#define UFS_MINFREE 5
225#define UFS_DEFAULTOPT UFS_OPTTIME 199#define UFS_DEFAULTOPT UFS_OPTTIME
226
227/*
228 * Debug code
229 */
230#ifdef CONFIG_UFS_DEBUG
231# define UFSD(f, a...) { \
232 printk ("UFSD (%s, %d): %s:", \
233 __FILE__, __LINE__, __FUNCTION__); \
234 printk (f, ## a); \
235 }
236#else
237# define UFSD(f, a...) /**/
238#endif
239 200
240/* 201/*
241 * Turn file system block numbers into disk block addresses. 202 * Turn file system block numbers into disk block addresses.
@@ -374,7 +335,14 @@ struct ufs_csum_core {
374 * struct ufs_super_block_(first,second,third) instead. 335 * struct ufs_super_block_(first,second,third) instead.
375 */ 336 */
376struct ufs_super_block { 337struct ufs_super_block {
377 __fs32 fs_link; /* UNUSED */ 338 union {
339 struct {
340 __fs32 fs_link; /* UNUSED */
341 } fs_42;
342 struct {
343 __fs32 fs_state; /* file system state flag */
344 } fs_sun;
345 } fs_u0;
378 __fs32 fs_rlink; /* UNUSED */ 346 __fs32 fs_rlink; /* UNUSED */
379 __fs32 fs_sblkno; /* addr of super-block in filesys */ 347 __fs32 fs_sblkno; /* addr of super-block in filesys */
380 __fs32 fs_cblkno; /* offset of cyl-block in filesys */ 348 __fs32 fs_cblkno; /* offset of cyl-block in filesys */
@@ -545,6 +513,15 @@ struct ufs_super_block {
545#define CG_MAGIC 0x090255 513#define CG_MAGIC 0x090255
546#define ufs_cg_chkmagic(sb, ucg) \ 514#define ufs_cg_chkmagic(sb, ucg) \
547 (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) 515 (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC)
516/*
517 * Macros for access to old cylinder group array structures
518 */
519#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot)
520#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno])
521#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused)
522#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free)
523#define ufs_ocg_chkmagic(sb, ucg) \
524 (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC)
548 525
549/* 526/*
550 * size of this structure is 172 B 527 * size of this structure is 172 B
@@ -590,6 +567,28 @@ struct ufs_cylinder_group {
590/* actually longer */ 567/* actually longer */
591}; 568};
592 569
570/* Historic Cylinder group info */
571struct ufs_old_cylinder_group {
572 __fs32 cg_link; /* linked list of cyl groups */
573 __fs32 cg_rlink; /* for incore cyl groups */
574 __fs32 cg_time; /* time last written */
575 __fs32 cg_cgx; /* we are the cgx'th cylinder group */
576 __fs16 cg_ncyl; /* number of cyl's this cg */
577 __fs16 cg_niblk; /* number of inode blocks this cg */
578 __fs32 cg_ndblk; /* number of data blocks this cg */
579 struct ufs_csum cg_cs; /* cylinder summary information */
580 __fs32 cg_rotor; /* position of last used block */
581 __fs32 cg_frotor; /* position of last used frag */
582 __fs32 cg_irotor; /* position of last used inode */
583 __fs32 cg_frsum[8]; /* counts of available frags */
584 __fs32 cg_btot[32]; /* block totals per cylinder */
585 __fs16 cg_b[32][8]; /* positions of free blocks */
586 __u8 cg_iused[256]; /* used inode map */
587 __fs32 cg_magic; /* magic number */
588 __u8 cg_free[1]; /* free block map */
589/* actually longer */
590};
591
593/* 592/*
594 * structure of an on-disk inode 593 * structure of an on-disk inode
595 */ 594 */
@@ -796,7 +795,14 @@ struct ufs_sb_private_info {
796 * ufs_super_block_third 356 795 * ufs_super_block_third 356
797 */ 796 */
798struct ufs_super_block_first { 797struct ufs_super_block_first {
799 __fs32 fs_link; 798 union {
799 struct {
800 __fs32 fs_link; /* UNUSED */
801 } fs_42;
802 struct {
803 __fs32 fs_state; /* file system state flag */
804 } fs_sun;
805 } fs_u0;
800 __fs32 fs_rlink; 806 __fs32 fs_rlink;
801 __fs32 fs_sblkno; 807 __fs32 fs_sblkno;
802 __fs32 fs_cblkno; 808 __fs32 fs_cblkno;
@@ -944,89 +950,4 @@ struct ufs_super_block_third {
944 __u8 fs_space[1]; 950 __u8 fs_space[1];
945}; 951};
946 952
947#ifdef __KERNEL__
948
949/* balloc.c */
950extern void ufs_free_fragments (struct inode *, u64, unsigned);
951extern void ufs_free_blocks (struct inode *, u64, unsigned);
952extern u64 ufs_new_fragments(struct inode *, void *, u64, u64,
953 unsigned, int *, struct page *);
954
955/* cylinder.c */
956extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned);
957extern void ufs_put_cylinder (struct super_block *, unsigned);
958
959/* dir.c */
960extern const struct inode_operations ufs_dir_inode_operations;
961extern int ufs_add_link (struct dentry *, struct inode *);
962extern ino_t ufs_inode_by_name(struct inode *, struct dentry *);
963extern int ufs_make_empty(struct inode *, struct inode *);
964extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **);
965extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *);
966extern int ufs_empty_dir (struct inode *);
967extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **);
968extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
969 struct page *page, struct inode *inode);
970
971/* file.c */
972extern const struct inode_operations ufs_file_inode_operations;
973extern const struct file_operations ufs_file_operations;
974
975extern const struct address_space_operations ufs_aops;
976
977/* ialloc.c */
978extern void ufs_free_inode (struct inode *inode);
979extern struct inode * ufs_new_inode (struct inode *, int);
980
981/* inode.c */
982extern void ufs_read_inode (struct inode *);
983extern void ufs_put_inode (struct inode *);
984extern int ufs_write_inode (struct inode *, int);
985extern int ufs_sync_inode (struct inode *);
986extern void ufs_delete_inode (struct inode *);
987extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
988extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
989
990/* namei.c */
991extern const struct file_operations ufs_dir_operations;
992
993/* super.c */
994extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
995extern void ufs_error (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
996extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
997
998/* symlink.c */
999extern const struct inode_operations ufs_fast_symlink_inode_operations;
1000
1001/* truncate.c */
1002extern int ufs_truncate (struct inode *, loff_t);
1003
1004static inline struct ufs_sb_info *UFS_SB(struct super_block *sb)
1005{
1006 return sb->s_fs_info;
1007}
1008
1009static inline struct ufs_inode_info *UFS_I(struct inode *inode)
1010{
1011 return container_of(inode, struct ufs_inode_info, vfs_inode);
1012}
1013
1014/*
1015 * Give cylinder group number for a file system block.
1016 * Give cylinder group block number for a file system block.
1017 */
1018/* #define ufs_dtog(d) ((d) / uspi->s_fpg) */
1019static inline u64 ufs_dtog(struct ufs_sb_private_info * uspi, u64 b)
1020{
1021 do_div(b, uspi->s_fpg);
1022 return b;
1023}
1024/* #define ufs_dtogd(d) ((d) % uspi->s_fpg) */
1025static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b)
1026{
1027 return do_div(b, uspi->s_fpg);
1028}
1029
1030#endif /* __KERNEL__ */
1031
1032#endif /* __LINUX_UFS_FS_H */ 953#endif /* __LINUX_UFS_FS_H */
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h
deleted file mode 100644
index 6496caa82f9e..000000000000
--- a/include/linux/ufs_fs_i.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * linux/include/linux/ufs_fs_i.h
3 *
4 * Copyright (C) 1996
5 * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
6 * Laboratory for Computer Science Research Computing Facility
7 * Rutgers, The State University of New Jersey
8 *
9 * NeXTstep support added on February 5th 1998 by
10 * Niels Kristian Bech Jensen <nkbj@image.dk>.
11 */
12
13#ifndef _LINUX_UFS_FS_I_H
14#define _LINUX_UFS_FS_I_H
15
16struct ufs_inode_info {
17 union {
18 __fs32 i_data[15];
19 __u8 i_symlink[4*15];
20 __fs64 u2_i_data[15];
21 } i_u1;
22 __u32 i_flags;
23 __u32 i_shadow;
24 __u32 i_unused1;
25 __u32 i_unused2;
26 __u32 i_oeftflag;
27 __u16 i_osync;
28 __u64 i_lastfrag;
29 __u32 i_dir_start_lookup;
30 struct inode vfs_inode;
31};
32
33#endif /* _LINUX_UFS_FS_I_H */
diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h
deleted file mode 100644
index e114c93fc578..000000000000
--- a/include/linux/ufs_fs_sb.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * linux/include/linux/ufs_fs_sb.h
3 *
4 * Copyright (C) 1996
5 * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
6 * Laboratory for Computer Science Research Computing Facility
7 * Rutgers, The State University of New Jersey
8 *
9 * $Id: ufs_fs_sb.h,v 1.8 1998/05/06 12:04:40 jj Exp $
10 *
11 * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
12 */
13
14#ifndef __LINUX_UFS_FS_SB_H
15#define __LINUX_UFS_FS_SB_H
16
17
18#define UFS_MAX_GROUP_LOADED 8
19#define UFS_CGNO_EMPTY ((unsigned)-1)
20
21struct ufs_sb_private_info;
22struct ufs_cg_private_info;
23struct ufs_csum;
24
25struct ufs_sb_info {
26 struct ufs_sb_private_info * s_uspi;
27 struct ufs_csum * s_csp;
28 unsigned s_bytesex;
29 unsigned s_flags;
30 struct buffer_head ** s_ucg;
31 struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED];
32 unsigned s_cgno[UFS_MAX_GROUP_LOADED];
33 unsigned short s_cg_loaded;
34 unsigned s_mount_opt;
35};
36
37#endif
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 699b7e9864fa..feb5e99a1079 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -87,6 +87,7 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last,
87extern char con_buf[CON_BUF_SIZE]; 87extern char con_buf[CON_BUF_SIZE];
88extern struct mutex con_buf_mtx; 88extern struct mutex con_buf_mtx;
89extern char vt_dont_switch; 89extern char vt_dont_switch;
90extern int default_utf8;
90 91
91struct vt_spawn_console { 92struct vt_spawn_console {
92 spinlock_t lock; 93 spinlock_t lock;
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index d1321a81c9c4..bef7d66601cb 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -62,13 +62,13 @@ struct writeback_control {
62 unsigned for_reclaim:1; /* Invoked from the page allocator */ 62 unsigned for_reclaim:1; /* Invoked from the page allocator */
63 unsigned for_writepages:1; /* This is a writepages() call */ 63 unsigned for_writepages:1; /* This is a writepages() call */
64 unsigned range_cyclic:1; /* range_start is cyclic */ 64 unsigned range_cyclic:1; /* range_start is cyclic */
65 unsigned more_io:1; /* more io to be dispatched */
65}; 66};
66 67
67/* 68/*
68 * fs/fs-writeback.c 69 * fs/fs-writeback.c
69 */ 70 */
70void writeback_inodes(struct writeback_control *wbc); 71void writeback_inodes(struct writeback_control *wbc);
71void wake_up_inode(struct inode *inode);
72int inode_wait(void *); 72int inode_wait(void *);
73void sync_inodes_sb(struct super_block *, int wait); 73void sync_inodes_sb(struct super_block *, int wait);
74void sync_inodes(int wait); 74void sync_inodes(int wait);
@@ -80,6 +80,13 @@ static inline void wait_on_inode(struct inode *inode)
80 wait_on_bit(&inode->i_state, __I_LOCK, inode_wait, 80 wait_on_bit(&inode->i_state, __I_LOCK, inode_wait,
81 TASK_UNINTERRUPTIBLE); 81 TASK_UNINTERRUPTIBLE);
82} 82}
83static inline void inode_sync_wait(struct inode *inode)
84{
85 might_sleep();
86 wait_on_bit(&inode->i_state, __I_SYNC, inode_wait,
87 TASK_UNINTERRUPTIBLE);
88}
89
83 90
84/* 91/*
85 * mm/page-writeback.c 92 * mm/page-writeback.c
@@ -97,6 +104,10 @@ extern int dirty_expire_interval;
97extern int block_dump; 104extern int block_dump;
98extern int laptop_mode; 105extern int laptop_mode;
99 106
107extern int dirty_ratio_handler(struct ctl_table *table, int write,
108 struct file *filp, void __user *buffer, size_t *lenp,
109 loff_t *ppos);
110
100struct ctl_table; 111struct ctl_table;
101struct file; 112struct file;
102int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, 113int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild
deleted file mode 100644
index 744f85011f1e..000000000000
--- a/include/scsi/Kbuild
+++ /dev/null
@@ -1,4 +0,0 @@
1header-y += scsi.h
2
3unifdef-y += scsi_ioctl.h
4unifdef-y += sg.h