diff options
Diffstat (limited to 'include')
195 files changed, 1756 insertions, 1971 deletions
diff --git a/include/Kbuild b/include/Kbuild index 2d03f995865f..b52288774345 100644 --- a/include/Kbuild +++ b/include/Kbuild @@ -1,6 +1,5 @@ header-y += asm-generic/ header-y += linux/ -header-y += scsi/ header-y += sound/ header-y += mtd/ header-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; extern int alpha_l2_cacheshape; extern int alpha_l3_cacheshape; +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ 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; #define N_FDC 2 #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - /* * Most Alphas have no problems with floppy DMA crossing 64k borders, * 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); #endif #define RTC_ALWAYS_BCD 0 -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - /* * Some mucking forons use if[n]def writeq to check if platform has it. * 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init(struct semaphore *sem, int val) { 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 @@ #ifndef __ASSEMBLY__ #include <linux/kernel.h> +#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ /* * 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) #define N_FDC 1 #define N_DRIVE 4 -#define FLOPPY_MOTOR_MASK 0xf0 - #define CROSS_64KB(a,s) (0) /* 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INIT(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init(struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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); #define ioport_map(port, nr) ioremap(port, nr) #define ioport_unmap(port) iounmap(port) -#define dma_cache_wback_inv(_start, _size) \ - flush_dcache_region(_start, _size) -#define dma_cache_inv(_start, _size) \ - invalidate_dcache_region(_start, _size) -#define dma_cache_wback(_start, _size) \ - clean_dcache_region(_start, _size) - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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); #define ioport_map(port, nr) ((void __iomem*)(port)) #define ioport_unmap(addr) -#define dma_cache_inv(_start,_size) do { blkfin_inv_cache_all();} while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { blkfin_inv_cache_all();} while (0) - /* Pages to physical address... */ #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init(struct semaphore *sem, int val) { 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; typedef unsigned int __u32; /* HK0617 -- Changes to unsigned long temporarily */ -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init(struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 header-y += errno.h header-y += fcntl.h header-y += ioctl.h -header-y += ipc.h header-y += mman.h header-y += poll.h header-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 unifdef-y += user.h # These probably shouldn't be exported -unifdef-y += shmparam.h unifdef-y += elf.h unifdef-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 @@ -#ifndef _ASM_GENERIC_IPC_H -#define _ASM_GENERIC_IPC_H -/* - * These are used to wrap system calls. - * - * See architecture code for ugly details.. - */ -struct ipc_kludge { - struct msgbuf __user *msgp; - long msgtyp; -}; - -#define SEMOP 1 -#define SEMGET 2 -#define SEMCTL 3 -#define SEMTIMEDOP 4 -#define MSGSND 11 -#define MSGRCV 12 -#define MSGGET 13 -#define MSGCTL 14 -#define SHMAT 21 -#define SHMDT 22 -#define SHMGET 23 -#define SHMCTL 24 - -/* Used by the DIPC package, try and avoid reusing it */ -#define DIPC 25 - -#define IPCCALL(version,op) ((version)<<16 | (op)) - -#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 extern void iounmap(void *addr); -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - /* H8/300 internal I/O functions */ static __inline__ unsigned char ctrl_inb(unsigned long addr) { 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif /* 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 *); #define GATE_EHDR ((const struct elfhdr *) GATE_ADDR) +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ 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); extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n); extern void memset_io(volatile void __iomem *s, int c, long n); -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - # endif /* __KERNEL__ */ /* 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 @@ extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned; extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; +extern pg_data_t *pgdat_list[MAX_NUMNODES]; /* Stuff below this line could be architecture independent */ 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) static inline void sema_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 @@ #include <linux/kernel.h> #include <linux/types.h> +#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ + struct pci_vector_struct { __u16 segment; /* PCI Segment number */ __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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #endif /* __ASSEMBLY__ */ 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); #define FLOPPY0_TYPE (MACH_IS_Q40 ? 6 : 4) #define FLOPPY1_TYPE 0 -#define FLOPPY_MOTOR_MASK 0xf0 - - /* basically PC init + set use_virtual_dma */ #define FDC1 m68k_floppy_init() 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, return __ioremap(physaddr, size, IOMAP_FULL_CACHING); } - -/* m68k caches aren't DMA coherent */ -extern void dma_cache_wback_inv(unsigned long start, unsigned long size); -extern void dma_cache_wback(unsigned long start, unsigned long size); -extern void dma_cache_inv(unsigned long start, unsigned long size); - static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) { __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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init(struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 extern void iounmap(void *addr); -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - /* Pages to physical address... */ #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) #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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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) #define N_FDC 1 /* do you *really* want a second controller? */ #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - /* * The DMA channel used by the floppy controller cannot access data at * 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 * caches. Dirty lines of the caches may be written back or simply * be discarded. This operation is necessary before dma operations * to the memory. + * + * This API used to be exported; it now is for arch code internal use only. */ #ifdef CONFIG_DMA_NONCOHERENT 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) static inline void sema_init(struct semaphore *sem, int val) { 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; #else -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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; #define N_FDC 1 #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - -#define AUTO_DMA - #define EXTRA_FLOPPY_PARAMS #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); /* IO Port space is : BBiiii where BB is HBA number. */ #define IO_SPACE_LIMIT 0x00ffffff - -#define dma_cache_inv(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0) -#define dma_cache_wback(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0) -#define dma_cache_wback_inv(_start,_size) do { flush_kernel_dcache_range(_start,_size); } while (0) - /* PA machines have an MM I/O space from 0xf0000000-0xffffffff in 32 * bit mode and from 0xfffffffff0000000-0xfffffffffffffff in 64 bit * 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) extern inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 header-y += socket.h header-y += termbits.h header-y += fcntl.h -header-y += ipc.h header-y += poll.h -header-y += shmparam.h header-y += sockios.h header-y += ucontext.h header-y += ioctl.h diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index ae093ef68363..9d74338e3dec 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h @@ -165,6 +165,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, #define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000) #define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) #define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000) +#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000) #ifndef __ASSEMBLY__ @@ -367,7 +368,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | \ CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ - CPU_FTR_PURR | CPU_FTR_REAL_LE) + CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_NO_SLBIE_B) #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | \ CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) 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]; typedef unsigned int elf_greg_t32; typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; +typedef elf_gregset_t32 compat_elf_gregset_t; /* * 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]; #define ELF_ET_DYN_BASE (0x20000000) -/* Common routine for both 32-bit and 64-bit processes */ +/* + * Our registers are always unsigned longs, whether we're a 32 bit + * process or 64 bit, on either a 64 bit or 32 bit kernel. + * + * This macro relies on elf_regs[i] having the right type to truncate to, + * either u32 or u64. It defines the body of the elf_core_copy_regs + * function, either the native one with elf_gregset_t elf_regs or + * the 32-bit one with elf_gregset_t32 elf_regs. + */ +#define PPC_ELF_CORE_COPY_REGS(elf_regs, regs) \ + int i, nregs = min(sizeof(*regs) / sizeof(unsigned long), \ + (size_t)ELF_NGREG); \ + for (i = 0; i < nregs; i++) \ + elf_regs[i] = ((unsigned long *) regs)[i]; \ + memset(&elf_regs[i], 0, (ELF_NGREG - i) * sizeof(elf_regs[0])) + +/* Common routine for both 32-bit and 64-bit native processes */ static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, - struct pt_regs *regs) + struct pt_regs *regs) { - int i, nregs; - - memset((void *)elf_regs, 0, sizeof(elf_gregset_t)); - - /* Our registers are always unsigned longs, whether we're a 32 bit - * process or 64 bit, on either a 64 bit or 32 bit kernel. - * Don't use ELF_GREG_TYPE here. */ - nregs = sizeof(struct pt_regs) / sizeof(unsigned long); - if (nregs > ELF_NGREG) - nregs = ELF_NGREG; - - for (i = 0; i < nregs; i++) { - /* This will correctly truncate 64 bit registers to 32 bits - * for a 32 bit process on a 64 bit kernel. */ - elf_regs[i] = (elf_greg_t)((ELF_GREG_TYPE *)regs)[i]; - } + PPC_ELF_CORE_COPY_REGS(elf_regs, regs); } #define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs); @@ -212,6 +214,14 @@ static inline int dump_task_regs(struct task_struct *tsk, extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) +typedef elf_vrregset_t elf_fpxregset_t; + +#ifdef CONFIG_ALTIVEC +extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs); +#define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_altivec(tsk, regs) +#define ELF_CORE_XFPREG_TYPE NT_PPC_VMX +#endif + #endif /* __KERNEL__ */ /* 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, * AT_IGNOREPPC is used for that. * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. + * update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ 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; #define N_FDC 2 /* Don't change this! */ #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - /* * The PowerPC has no problems with floppy DMA crossing 64k borders. */ diff --git a/include/asm-powerpc/ibmebus.h b/include/asm-powerpc/ibmebus.h index 87d396e28db2..1a9d9aea21fa 100644 --- a/include/asm-powerpc/ibmebus.h +++ b/include/asm-powerpc/ibmebus.h @@ -43,42 +43,18 @@ #include <linux/device.h> #include <linux/interrupt.h> #include <linux/mod_devicetable.h> -#include <asm/of_device.h> +#include <linux/of_device.h> +#include <linux/of_platform.h> extern struct bus_type ibmebus_bus_type; -struct ibmebus_dev { - struct of_device ofdev; -}; +int ibmebus_register_driver(struct of_platform_driver *drv); +void ibmebus_unregister_driver(struct of_platform_driver *drv); -struct ibmebus_driver { - char *name; - struct of_device_id *id_table; - int (*probe) (struct ibmebus_dev *dev, const struct of_device_id *id); - int (*remove) (struct ibmebus_dev *dev); - struct device_driver driver; -}; - -int ibmebus_register_driver(struct ibmebus_driver *drv); -void ibmebus_unregister_driver(struct ibmebus_driver *drv); - -int ibmebus_request_irq(struct ibmebus_dev *dev, - u32 ist, - irq_handler_t handler, - unsigned long irq_flags, const char * devname, +int ibmebus_request_irq(u32 ist, irq_handler_t handler, + unsigned long irq_flags, const char *devname, void *dev_id); -void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id); - -static inline struct ibmebus_driver *to_ibmebus_driver(struct device_driver *drv) -{ - return container_of(drv, struct ibmebus_driver, driver); -} - -static inline struct ibmebus_dev *to_ibmebus_dev(struct device *dev) -{ - return container_of(dev, struct ibmebus_dev, ofdev.dev); -} - +void ibmebus_free_irq(u32 ist, void *dev_id); #endif /* __KERNEL__ */ #endif /* _ASM_IBMEBUS_H */ 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 \ #define writeq writeq #endif -#ifdef CONFIG_NOT_COHERENT_CACHE - -#define dma_cache_inv(_start,_size) \ - invalidate_dcache_range(_start, (_start + _size)) -#define dma_cache_wback(_start,_size) \ - clean_dcache_range(_start, (_start + _size)) -#define dma_cache_wback_inv(_start,_size) \ - flush_dcache_range(_start, (_start + _size)) - -#else /* CONFIG_NOT_COHERENT_CACHE */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - -#endif /* !CONFIG_NOT_COHERENT_CACHE */ - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * 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 @@ -#include <asm-generic/ipc.h> diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h index 93262f2546ad..6526e139a463 100644 --- a/include/asm-powerpc/of_device.h +++ b/include/asm-powerpc/of_device.h @@ -17,6 +17,10 @@ struct of_device struct device dev; /* Generic device interface */ }; +extern struct of_device *of_device_alloc(struct device_node *np, + const char *bus_id, + struct device *parent); + extern ssize_t of_device_get_modalias(struct of_device *ofdev, char *str, ssize_t len); extern int of_device_uevent(struct device *dev, 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) static inline void sema_init (struct semaphore *sem, int val) { 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 @@ #define set_mb(var, value) do { var = value; mb(); } while (0) #ifdef __KERNEL__ +#define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */ #ifdef CONFIG_SMP #define smp_mb() mb() #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; typedef __signed__ long __s64; typedef unsigned long __u64; #else -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #endif /* __powerpc64__ */ 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; #define N_FDC 2 /* Don't change this! */ #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - /* * The PowerPC has no problems with floppy DMA crossing 64k borders. */ 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 *); #include <asm/mpc8260_pci9.h> #endif -#ifdef CONFIG_NOT_COHERENT_CACHE - -#define dma_cache_inv(_start,_size) \ - invalidate_dcache_range(_start, (_start + _size)) -#define dma_cache_wback(_start,_size) \ - clean_dcache_range(_start, (_start + _size)) -#define dma_cache_wback_inv(_start,_size) \ - flush_dcache_range(_start, (_start + _size)) - -#else - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - -#endif - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * 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-ppc/mpc52xx_psc.h b/include/asm-ppc/mpc52xx_psc.h index 9d850b2b20b8..c82b8d49a7da 100644 --- a/include/asm-ppc/mpc52xx_psc.h +++ b/include/asm-ppc/mpc52xx_psc.h @@ -28,6 +28,10 @@ #define MPC52xx_PSC_MAXNUM 6 /* Programmable Serial Controller (PSC) status register bits */ +#define MPC52xx_PSC_SR_UNEX_RX 0x0001 +#define MPC52xx_PSC_SR_DATA_VAL 0x0002 +#define MPC52xx_PSC_SR_DATA_OVR 0x0004 +#define MPC52xx_PSC_SR_CMDSEND 0x0008 #define MPC52xx_PSC_SR_CDE 0x0080 #define MPC52xx_PSC_SR_RXRDY 0x0100 #define MPC52xx_PSC_SR_RXFULL 0x0200 @@ -132,8 +136,10 @@ struct mpc52xx_psc { u8 reserved5[3]; u8 ctlr; /* PSC + 0x1c */ u8 reserved6[3]; - u16 ccr; /* PSC + 0x20 */ - u8 reserved7[14]; + u32 ccr; /* PSC + 0x20 */ + u32 ac97_slots; /* PSC + 0x24 */ + u32 ac97_cmd; /* PSC + 0x28 */ + u32 ac97_data; /* PSC + 0x2c */ u8 ivr; /* PSC + 0x30 */ u8 reserved8[3]; u8 ip; /* PSC + 0x34 */ 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef unsigned int __u32; #ifndef __s390x__ -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #else /* __s390x__ */ typedef __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; #define VDSO_BASE ((unsigned long)current->mm->context.vdso) #define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do { \ 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) } #endif - dma_cache_wback_inv(addr, size); + __flush_purge_region(addr, size); /* actual, physical DMA */ doing_pdma = 0; @@ -263,10 +263,6 @@ static int FDC2 = -1; #define N_FDC 2 #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - -#define AUTO_DMA - #define EXTRA_FLOPPY_PARAMS #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) __iounmap((addr)) /* - * The caches on some architectures aren't dma-coherent and have need to - * handle this in software. There are three types of operations that - * can be applied to dma buffers. - * - * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by - * writing the content of the caches back to memory, if necessary. - * The function also invalidates the affected part of the caches as - * necessary before DMA transfers from outside to memory. - * - dma_cache_inv(start, size) invalidates the affected parts of the - * caches. Dirty lines of the caches may be written back or simply - * be discarded. This operation is necessary before dma operations - * to the memory. - * - dma_cache_wback(start, size) writes back any dirty lines but does - * not invalidate the cache. This can be used before DMA reads from - * memory, - */ - -#define dma_cache_wback_inv(_start,_size) \ - __flush_purge_region(_start,_size) -#define dma_cache_inv(_start,_size) \ - __flush_invalidate_region(_start,_size) -#define dma_cache_wback(_start,_size) \ - __flush_wback_region(_start,_size) - -/* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access */ 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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 @@ struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next); +#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ /* * switch_to() should switch tasks to task nr n, first */ 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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, static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction dir) { - dma_cache_wback_inv((unsigned long)vaddr, size); + unsigned long s = (unsigned long) vaddr & L1_CACHE_ALIGN_MASK; + unsigned long e = (vaddr + size) & L1_CACHE_ALIGN_MASK; + + for (; s <= e; s += L1_CACHE_BYTES) + asm volatile ("ocbp %0, 0" : : "r" (s)); } static 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 extern void onchip_unmap(unsigned long vaddr); /* - * The caches on some architectures aren't dma-coherent and have need to - * handle this in software. There are three types of operations that - * can be applied to dma buffers. - * - * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by - * writing the content of the caches back to memory, if necessary. - * The function also invalidates the affected part of the caches as - * necessary before DMA transfers from outside to memory. - * - dma_cache_inv(start, size) invalidates the affected parts of the - * caches. Dirty lines of the caches may be written back or simply - * be discarded. This operation is necessary before dma operations - * to the memory. - * - dma_cache_wback(start, size) writes back any dirty lines but does - * not invalidate the cache. This can be used before DMA reads from - * memory, - */ - -static __inline__ void dma_cache_wback_inv (unsigned long start, unsigned long size) -{ - unsigned long s = start & L1_CACHE_ALIGN_MASK; - unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; - - for (; s <= e; s += L1_CACHE_BYTES) - asm volatile ("ocbp %0, 0" : : "r" (s)); -} - -static __inline__ void dma_cache_inv (unsigned long start, unsigned long size) -{ - // Note that caller has to be careful with overzealous - // invalidation should there be partial cache lines at the extremities - // of the specified range - unsigned long s = start & L1_CACHE_ALIGN_MASK; - unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; - - for (; s <= e; s += L1_CACHE_BYTES) - asm volatile ("ocbi %0, 0" : : "r" (s)); -} - -static __inline__ void dma_cache_wback (unsigned long start, unsigned long size) -{ - unsigned long s = start & L1_CACHE_ALIGN_MASK; - unsigned long e = (start + size) & L1_CACHE_ALIGN_MASK; - - for (; s <= e; s += L1_CACHE_BYTES) - asm volatile ("ocbwb %0, 0" : : "r" (s)); -} - -/* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access */ 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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; #define fd_dma_mem_free(addr,size) (vfree((void *)(addr))) #endif -#define FLOPPY_MOTOR_MASK 0x10 - /* XXX This isn't really correct. XXX */ #define get_dma_residue(x) (0) 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); #define RTC_PORT(x) (rtc_port + (x)) #define RTC_ALWAYS_BCD 0 -/* Nothing to do */ -/* P3: Only IDE DMA may need these. XXX Verify that it still does... */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - #endif #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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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 header-y += bpp.h header-y += display7seg.h header-y += envctrl.h -header-y += ipc.h header-y += openprom.h header-y += openpromio.h header-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; #define fd_free_irq() sun_fdops.fd_free_irq() #define fd_eject(drive) sun_fdops.fd_eject(drive) -static int FLOPPY_MOTOR_MASK = 0x10; - /* Super paranoid... */ #undef HAVE_DISABLE_HLT @@ -622,7 +620,6 @@ isa_done: sun_fdops.fd_eject = sun_pci_fd_eject; fdc_status = (unsigned long) &sun_fdc->status_82077; - FLOPPY_MOTOR_MASK = 0xf0; allowed_drive_mask = 0; sun_floppy_types[0] = 0; @@ -729,7 +726,6 @@ static unsigned long __init sun_floppy_init(void) sun_fdops.fd_eject = sun_pci_fd_eject; fdc_status = (unsigned long) &sun_fdc->status_82077; - FLOPPY_MOTOR_MASK = 0xf0; /* * 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 *); #define sbus_iounmap(__addr, __size) \ release_region((unsigned long)(__addr), (__size)) -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * 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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) static inline void sema_init (struct semaphore *sem, int val) { 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 @@ /* $Id: shmparam.h,v 1.5 2001/09/24 21:17:57 kanoj Exp $ */ #ifndef _ASMSPARC64_SHMPARAM_H #define _ASMSPARC64_SHMPARAM_H -#ifdef __KERNEL__ #include <asm/spitfire.h> @@ -9,5 +8,4 @@ /* attach addr a multiple of this */ #define SHMLBA ((PAGE_SIZE > L1DCACHE_SIZE) ? PAGE_SIZE : L1DCACHE_SIZE) -#endif /* __KERNEL__ */ #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 @@ -#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 @@ -#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 { struct semaphore name = __SEMAPHORE_INITIALIZER (name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 @@ include include/asm-generic/Kbuild.asm header-y += boot.h -header-y += bootsetup.h header-y += debugreg_32.h header-y += debugreg_64.h header-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 { u16 root_flags; u32 syssize; u16 ram_size; +#define RAMDISK_IMAGE_START_MASK 0x07FF +#define RAMDISK_PROMPT_FLAG 0x8000 +#define RAMDISK_LOAD_FLAG 0x4000 u16 vid_mode; u16 root_dev; 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 @@ - -#ifndef _X86_64_BOOTSETUP_H -#define _X86_64_BOOTSETUP_H 1 - -#define BOOT_PARAM_SIZE 4096 -extern char x86_boot_params[BOOT_PARAM_SIZE]; - -/* - * This is set up by the setup-routine at boot-time - */ -#define PARAM ((unsigned char *)x86_boot_params) -#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) -#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) -#define ALT_MEM_K (*(unsigned int *) (PARAM+0x1e0)) -#define E820_MAP_NR (*(char*) (PARAM+E820NR)) -#define E820_MAP ((struct e820entry *) (PARAM+E820MAP)) -#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40)) -#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80)) -#define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0)) -#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) -#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) -#define SAVED_VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA)) -#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC)) -#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) -#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) -#define KERNEL_START (*(unsigned int *) (PARAM+0x214)) -#define INITRD_START (*(unsigned int *) (PARAM+0x218)) -#define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c)) -#define EDID_INFO (*(struct edid_info *) (PARAM+0x140)) -#define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) -#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) -#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) -#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) -#define COMMAND_LINE boot_command_line - -#define RAMDISK_IMAGE_START_MASK 0x07FF -#define RAMDISK_PROMPT_FLAG 0x8000 -#define RAMDISK_LOAD_FLAG 0x4000 - -#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 #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) @@ -152,6 +153,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, extern unsigned int vdso_enabled; +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do if (vdso_enabled) { \ 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; #define N_FDC 2 #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - -#define AUTO_DMA - #define EXTRA_FLOPPY_PARAMS #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; #define N_FDC 2 #define N_DRIVE 8 -#define FLOPPY_MOTOR_MASK 0xf0 - -#define AUTO_DMA - #define EXTRA_FLOPPY_PARAMS #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) __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory"); } -#define dma_cache_inv(_start,_size) flush_write_buffers() -#define dma_cache_wback(_start,_size) flush_write_buffers() -#define dma_cache_wback_inv(_start,_size) flush_write_buffers() - #else -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) -#define flush_write_buffers() +#define flush_write_buffers() do { } while (0) #endif 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); */ #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) -/* Nothing to do */ - -#define dma_cache_inv(_start,_size) do { } while (0) -#define dma_cache_wback(_start,_size) do { } while (0) -#define dma_cache_wback_inv(_start,_size) do { } while (0) - #define flush_write_buffers() extern 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 @@ -#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; extern struct page *pgd_list; void check_pgt_cache(void); -void pmd_ctor(void *, struct kmem_cache *, unsigned long); +void pmd_ctor(struct kmem_cache *, void *); void pgtable_cache_init(void); void paging_init(void); 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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 @@ */ extern struct boot_params boot_params; -#define PARAM ((char *)&boot_params) -#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) -#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) -#define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0)) -#define E820_MAP_NR (*(char*) (PARAM+E820NR)) -#define E820_MAP ((struct e820entry *) (PARAM+E820MAP)) -#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40)) -#define IST_INFO (*(struct ist_info *) (PARAM+0x60)) -#define SYS_DESC_TABLE (*(struct sys_desc_table *)(PARAM+0xa0)) -#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) -#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) -#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) -#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0))) -#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4))) -#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) -#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) -#define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA)) -#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC)) -#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) -#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) -#define KERNEL_START (*(unsigned long *) (PARAM+0x214)) -#define INITRD_START (*(unsigned long *) (PARAM+0x218)) -#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c)) -#define EDID_INFO (*(struct edid_info *) (PARAM+0x140)) -#define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) -#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) -#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) -#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) - /* * Do NOT EVER look at the BIOS memory size location. * 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 @@ #define COMMAND_LINE_SIZE 2048 +#ifdef __KERNEL__ + +#ifndef __ASSEMBLY__ +#include <asm/bootparam.h> + +/* + * This is set up by the setup-routine at boot-time + */ +extern struct boot_params boot_params; + +#endif /* not __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #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 @@ #include <asm/cmpxchg.h> #ifdef __KERNEL__ +#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ struct task_struct; /* one of the stranger aspects of C forward declarations.. */ extern 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif #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 { struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) static inline void sema_init (struct semaphore *sem, int val) { 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; typedef __signed__ int __s32; typedef unsigned int __u32; -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; +#if defined(__GNUC__) +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #endif /* 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 @@ */ extern struct key_type key_type_rxrpc; +extern struct key *rxrpc_get_null_key(const char *); + #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 header-y += coda_psdev.h header-y += coff.h header-y += comstats.h -header-y += consolemap.h header-y += const.h header-y += cycx_cfm.h header-y += dlm_device.h @@ -283,6 +282,7 @@ unifdef-y += nfs_idmap.h unifdef-y += n_r3964.h unifdef-y += nubus.h unifdef-y += nvram.h +unifdef-y += oom.h unifdef-y += parport.h unifdef-y += patchkey.h unifdef-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 @@ +#ifndef __INCLUDE_ATMEL_SSC_H +#define __INCLUDE_ATMEL_SSC_H + +#include <linux/platform_device.h> +#include <linux/list.h> + +struct ssc_device { + struct list_head list; + void __iomem *regs; + struct platform_device *pdev; + struct clk *clk; + int user; + int irq; +}; + +struct ssc_device * __must_check ssc_request(unsigned int ssc_num); +void ssc_free(struct ssc_device *ssc); + +/* SSC register offsets */ + +/* SSC Control Register */ +#define SSC_CR 0x00000000 +#define SSC_CR_RXDIS_SIZE 1 +#define SSC_CR_RXDIS_OFFSET 1 +#define SSC_CR_RXEN_SIZE 1 +#define SSC_CR_RXEN_OFFSET 0 +#define SSC_CR_SWRST_SIZE 1 +#define SSC_CR_SWRST_OFFSET 15 +#define SSC_CR_TXDIS_SIZE 1 +#define SSC_CR_TXDIS_OFFSET 9 +#define SSC_CR_TXEN_SIZE 1 +#define SSC_CR_TXEN_OFFSET 8 + +/* SSC Clock Mode Register */ +#define SSC_CMR 0x00000004 +#define SSC_CMR_DIV_SIZE 12 +#define SSC_CMR_DIV_OFFSET 0 + +/* SSC Receive Clock Mode Register */ +#define SSC_RCMR 0x00000010 +#define SSC_RCMR_CKG_SIZE 2 +#define SSC_RCMR_CKG_OFFSET 6 +#define SSC_RCMR_CKI_SIZE 1 +#define SSC_RCMR_CKI_OFFSET 5 +#define SSC_RCMR_CKO_SIZE 3 +#define SSC_RCMR_CKO_OFFSET 2 +#define SSC_RCMR_CKS_SIZE 2 +#define SSC_RCMR_CKS_OFFSET 0 +#define SSC_RCMR_PERIOD_SIZE 8 +#define SSC_RCMR_PERIOD_OFFSET 24 +#define SSC_RCMR_START_SIZE 4 +#define SSC_RCMR_START_OFFSET 8 +#define SSC_RCMR_STOP_SIZE 1 +#define SSC_RCMR_STOP_OFFSET 12 +#define SSC_RCMR_STTDLY_SIZE 8 +#define SSC_RCMR_STTDLY_OFFSET 16 + +/* SSC Receive Frame Mode Register */ +#define SSC_RFMR 0x00000014 +#define SSC_RFMR_DATLEN_SIZE 5 +#define SSC_RFMR_DATLEN_OFFSET 0 +#define SSC_RFMR_DATNB_SIZE 4 +#define SSC_RFMR_DATNB_OFFSET 8 +#define SSC_RFMR_FSEDGE_SIZE 1 +#define SSC_RFMR_FSEDGE_OFFSET 24 +#define SSC_RFMR_FSLEN_SIZE 4 +#define SSC_RFMR_FSLEN_OFFSET 16 +#define SSC_RFMR_FSOS_SIZE 4 +#define SSC_RFMR_FSOS_OFFSET 20 +#define SSC_RFMR_LOOP_SIZE 1 +#define SSC_RFMR_LOOP_OFFSET 5 +#define SSC_RFMR_MSBF_SIZE 1 +#define SSC_RFMR_MSBF_OFFSET 7 + +/* SSC Transmit Clock Mode Register */ +#define SSC_TCMR 0x00000018 +#define SSC_TCMR_CKG_SIZE 2 +#define SSC_TCMR_CKG_OFFSET 6 +#define SSC_TCMR_CKI_SIZE 1 +#define SSC_TCMR_CKI_OFFSET 5 +#define SSC_TCMR_CKO_SIZE 3 +#define SSC_TCMR_CKO_OFFSET 2 +#define SSC_TCMR_CKS_SIZE 2 +#define SSC_TCMR_CKS_OFFSET 0 +#define SSC_TCMR_PERIOD_SIZE 8 +#define SSC_TCMR_PERIOD_OFFSET 24 +#define SSC_TCMR_START_SIZE 4 +#define SSC_TCMR_START_OFFSET 8 +#define SSC_TCMR_STTDLY_SIZE 8 +#define SSC_TCMR_STTDLY_OFFSET 16 + +/* SSC Transmit Frame Mode Register */ +#define SSC_TFMR 0x0000001c +#define SSC_TFMR_DATDEF_SIZE 1 +#define SSC_TFMR_DATDEF_OFFSET 5 +#define SSC_TFMR_DATLEN_SIZE 5 +#define SSC_TFMR_DATLEN_OFFSET 0 +#define SSC_TFMR_DATNB_SIZE 4 +#define SSC_TFMR_DATNB_OFFSET 8 +#define SSC_TFMR_FSDEN_SIZE 1 +#define SSC_TFMR_FSDEN_OFFSET 23 +#define SSC_TFMR_FSEDGE_SIZE 1 +#define SSC_TFMR_FSEDGE_OFFSET 24 +#define SSC_TFMR_FSLEN_SIZE 4 +#define SSC_TFMR_FSLEN_OFFSET 16 +#define SSC_TFMR_FSOS_SIZE 3 +#define SSC_TFMR_FSOS_OFFSET 20 +#define SSC_TFMR_MSBF_SIZE 1 +#define SSC_TFMR_MSBF_OFFSET 7 + +/* SSC Receive Hold Register */ +#define SSC_RHR 0x00000020 +#define SSC_RHR_RDAT_SIZE 32 +#define SSC_RHR_RDAT_OFFSET 0 + +/* SSC Transmit Hold Register */ +#define SSC_THR 0x00000024 +#define SSC_THR_TDAT_SIZE 32 +#define SSC_THR_TDAT_OFFSET 0 + +/* SSC Receive Sync. Holding Register */ +#define SSC_RSHR 0x00000030 +#define SSC_RSHR_RSDAT_SIZE 16 +#define SSC_RSHR_RSDAT_OFFSET 0 + +/* SSC Transmit Sync. Holding Register */ +#define SSC_TSHR 0x00000034 +#define SSC_TSHR_TSDAT_SIZE 16 +#define SSC_TSHR_RSDAT_OFFSET 0 + +/* SSC Receive Compare 0 Register */ +#define SSC_RC0R 0x00000038 +#define SSC_RC0R_CP0_SIZE 16 +#define SSC_RC0R_CP0_OFFSET 0 + +/* SSC Receive Compare 1 Register */ +#define SSC_RC1R 0x0000003c +#define SSC_RC1R_CP1_SIZE 16 +#define SSC_RC1R_CP1_OFFSET 0 + +/* SSC Status Register */ +#define SSC_SR 0x00000040 +#define SSC_SR_CP0_SIZE 1 +#define SSC_SR_CP0_OFFSET 8 +#define SSC_SR_CP1_SIZE 1 +#define SSC_SR_CP1_OFFSET 9 +#define SSC_SR_ENDRX_SIZE 1 +#define SSC_SR_ENDRX_OFFSET 6 +#define SSC_SR_ENDTX_SIZE 1 +#define SSC_SR_ENDTX_OFFSET 2 +#define SSC_SR_OVRUN_SIZE 1 +#define SSC_SR_OVRUN_OFFSET 5 +#define SSC_SR_RXBUFF_SIZE 1 +#define SSC_SR_RXBUFF_OFFSET 7 +#define SSC_SR_RXEN_SIZE 1 +#define SSC_SR_RXEN_OFFSET 17 +#define SSC_SR_RXRDY_SIZE 1 +#define SSC_SR_RXRDY_OFFSET 4 +#define SSC_SR_RXSYN_SIZE 1 +#define SSC_SR_RXSYN_OFFSET 11 +#define SSC_SR_TXBUFE_SIZE 1 +#define SSC_SR_TXBUFE_OFFSET 3 +#define SSC_SR_TXEMPTY_SIZE 1 +#define SSC_SR_TXEMPTY_OFFSET 1 +#define SSC_SR_TXEN_SIZE 1 +#define SSC_SR_TXEN_OFFSET 16 +#define SSC_SR_TXRDY_SIZE 1 +#define SSC_SR_TXRDY_OFFSET 0 +#define SSC_SR_TXSYN_SIZE 1 +#define SSC_SR_TXSYN_OFFSET 10 + +/* SSC Interrupt Enable Register */ +#define SSC_IER 0x00000044 +#define SSC_IER_CP0_SIZE 1 +#define SSC_IER_CP0_OFFSET 8 +#define SSC_IER_CP1_SIZE 1 +#define SSC_IER_CP1_OFFSET 9 +#define SSC_IER_ENDRX_SIZE 1 +#define SSC_IER_ENDRX_OFFSET 6 +#define SSC_IER_ENDTX_SIZE 1 +#define SSC_IER_ENDTX_OFFSET 2 +#define SSC_IER_OVRUN_SIZE 1 +#define SSC_IER_OVRUN_OFFSET 5 +#define SSC_IER_RXBUFF_SIZE 1 +#define SSC_IER_RXBUFF_OFFSET 7 +#define SSC_IER_RXRDY_SIZE 1 +#define SSC_IER_RXRDY_OFFSET 4 +#define SSC_IER_RXSYN_SIZE 1 +#define SSC_IER_RXSYN_OFFSET 11 +#define SSC_IER_TXBUFE_SIZE 1 +#define SSC_IER_TXBUFE_OFFSET 3 +#define SSC_IER_TXEMPTY_SIZE 1 +#define SSC_IER_TXEMPTY_OFFSET 1 +#define SSC_IER_TXRDY_SIZE 1 +#define SSC_IER_TXRDY_OFFSET 0 +#define SSC_IER_TXSYN_SIZE 1 +#define SSC_IER_TXSYN_OFFSET 10 + +/* SSC Interrupt Disable Register */ +#define SSC_IDR 0x00000048 +#define SSC_IDR_CP0_SIZE 1 +#define SSC_IDR_CP0_OFFSET 8 +#define SSC_IDR_CP1_SIZE 1 +#define SSC_IDR_CP1_OFFSET 9 +#define SSC_IDR_ENDRX_SIZE 1 +#define SSC_IDR_ENDRX_OFFSET 6 +#define SSC_IDR_ENDTX_SIZE 1 +#define SSC_IDR_ENDTX_OFFSET 2 +#define SSC_IDR_OVRUN_SIZE 1 +#define SSC_IDR_OVRUN_OFFSET 5 +#define SSC_IDR_RXBUFF_SIZE 1 +#define SSC_IDR_RXBUFF_OFFSET 7 +#define SSC_IDR_RXRDY_SIZE 1 +#define SSC_IDR_RXRDY_OFFSET 4 +#define SSC_IDR_RXSYN_SIZE 1 +#define SSC_IDR_RXSYN_OFFSET 11 +#define SSC_IDR_TXBUFE_SIZE 1 +#define SSC_IDR_TXBUFE_OFFSET 3 +#define SSC_IDR_TXEMPTY_SIZE 1 +#define SSC_IDR_TXEMPTY_OFFSET 1 +#define SSC_IDR_TXRDY_SIZE 1 +#define SSC_IDR_TXRDY_OFFSET 0 +#define SSC_IDR_TXSYN_SIZE 1 +#define SSC_IDR_TXSYN_OFFSET 10 + +/* SSC Interrupt Mask Register */ +#define SSC_IMR 0x0000004c +#define SSC_IMR_CP0_SIZE 1 +#define SSC_IMR_CP0_OFFSET 8 +#define SSC_IMR_CP1_SIZE 1 +#define SSC_IMR_CP1_OFFSET 9 +#define SSC_IMR_ENDRX_SIZE 1 +#define SSC_IMR_ENDRX_OFFSET 6 +#define SSC_IMR_ENDTX_SIZE 1 +#define SSC_IMR_ENDTX_OFFSET 2 +#define SSC_IMR_OVRUN_SIZE 1 +#define SSC_IMR_OVRUN_OFFSET 5 +#define SSC_IMR_RXBUFF_SIZE 1 +#define SSC_IMR_RXBUFF_OFFSET 7 +#define SSC_IMR_RXRDY_SIZE 1 +#define SSC_IMR_RXRDY_OFFSET 4 +#define SSC_IMR_RXSYN_SIZE 1 +#define SSC_IMR_RXSYN_OFFSET 11 +#define SSC_IMR_TXBUFE_SIZE 1 +#define SSC_IMR_TXBUFE_OFFSET 3 +#define SSC_IMR_TXEMPTY_SIZE 1 +#define SSC_IMR_TXEMPTY_OFFSET 1 +#define SSC_IMR_TXRDY_SIZE 1 +#define SSC_IMR_TXRDY_OFFSET 0 +#define SSC_IMR_TXSYN_SIZE 1 +#define SSC_IMR_TXSYN_OFFSET 10 + +/* SSC PDC Receive Pointer Register */ +#define SSC_PDC_RPR 0x00000100 + +/* SSC PDC Receive Counter Register */ +#define SSC_PDC_RCR 0x00000104 + +/* SSC PDC Transmit Pointer Register */ +#define SSC_PDC_TPR 0x00000108 + +/* SSC PDC Receive Next Pointer Register */ +#define SSC_PDC_RNPR 0x00000110 + +/* SSC PDC Receive Next Counter Register */ +#define SSC_PDC_RNCR 0x00000114 + +/* SSC PDC Transmit Counter Register */ +#define SSC_PDC_TCR 0x0000010c + +/* SSC PDC Transmit Next Pointer Register */ +#define SSC_PDC_TNPR 0x00000118 + +/* SSC PDC Transmit Next Counter Register */ +#define SSC_PDC_TNCR 0x0000011c + +/* SSC PDC Transfer Control Register */ +#define SSC_PDC_PTCR 0x00000120 +#define SSC_PDC_PTCR_RXTDIS_SIZE 1 +#define SSC_PDC_PTCR_RXTDIS_OFFSET 1 +#define SSC_PDC_PTCR_RXTEN_SIZE 1 +#define SSC_PDC_PTCR_RXTEN_OFFSET 0 +#define SSC_PDC_PTCR_TXTDIS_SIZE 1 +#define SSC_PDC_PTCR_TXTDIS_OFFSET 9 +#define SSC_PDC_PTCR_TXTEN_SIZE 1 +#define SSC_PDC_PTCR_TXTEN_OFFSET 8 + +/* SSC PDC Transfer Status Register */ +#define SSC_PDC_PTSR 0x00000124 +#define SSC_PDC_PTSR_RXTEN_SIZE 1 +#define SSC_PDC_PTSR_RXTEN_OFFSET 0 +#define SSC_PDC_PTSR_TXTEN_SIZE 1 +#define SSC_PDC_PTSR_TXTEN_OFFSET 8 + +/* Bit manipulation macros */ +#define SSC_BIT(name) \ + (1 << SSC_##name##_OFFSET) +#define SSC_BF(name, value) \ + (((value) & ((1 << SSC_##name##_SIZE) - 1)) \ + << SSC_##name##_OFFSET) +#define SSC_BFEXT(name, value) \ + (((value) >> SSC_##name##_OFFSET) \ + & ((1 << SSC_##name##_SIZE) - 1)) +#define SSC_BFINS(name, value, old) \ + (((old) & ~(((1 << SSC_##name##_SIZE) - 1) \ + << SSC_##name##_OFFSET)) | SSC_BF(name, value)) + +/* Register access macros */ +#define ssc_readl(base, reg) __raw_readl(base + SSC_##reg) +#define ssc_writel(base, reg, value) __raw_writel((value), base + SSC_##reg) + +#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 @@ #define AT_SECURE 23 /* secure mode boolean */ -#define AT_VECTOR_SIZE 44 /* Size of auxiliary table. */ +#ifdef __KERNEL__ +#define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */ +#endif #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 @@ #ifndef _LINUX_BACKING_DEV_H #define _LINUX_BACKING_DEV_H +#include <linux/percpu_counter.h> +#include <linux/log2.h> +#include <linux/proportions.h> #include <asm/atomic.h> struct page; @@ -24,6 +27,14 @@ enum bdi_state { typedef int (congested_fn)(void *, int); +enum bdi_stat_item { + BDI_RECLAIMABLE, + BDI_WRITEBACK, + NR_BDI_STAT_ITEMS +}; + +#define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) + struct backing_dev_info { unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ unsigned long state; /* Always use atomic bitops on this */ @@ -32,8 +43,90 @@ struct backing_dev_info { void *congested_data; /* Pointer to aux data for congested func */ void (*unplug_io_fn)(struct backing_dev_info *, struct page *); void *unplug_io_data; + + struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; + + struct prop_local_percpu completions; + int dirty_exceeded; }; +int bdi_init(struct backing_dev_info *bdi); +void bdi_destroy(struct backing_dev_info *bdi); + +static inline void __add_bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item, s64 amount) +{ + __percpu_counter_add(&bdi->bdi_stat[item], amount, BDI_STAT_BATCH); +} + +static inline void __inc_bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + __add_bdi_stat(bdi, item, 1); +} + +static inline void inc_bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + unsigned long flags; + + local_irq_save(flags); + __inc_bdi_stat(bdi, item); + local_irq_restore(flags); +} + +static inline void __dec_bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + __add_bdi_stat(bdi, item, -1); +} + +static inline void dec_bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + unsigned long flags; + + local_irq_save(flags); + __dec_bdi_stat(bdi, item); + local_irq_restore(flags); +} + +static inline s64 bdi_stat(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + return percpu_counter_read_positive(&bdi->bdi_stat[item]); +} + +static inline s64 __bdi_stat_sum(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + return percpu_counter_sum_positive(&bdi->bdi_stat[item]); +} + +static inline s64 bdi_stat_sum(struct backing_dev_info *bdi, + enum bdi_stat_item item) +{ + s64 sum; + unsigned long flags; + + local_irq_save(flags); + sum = __bdi_stat_sum(bdi, item); + local_irq_restore(flags); + + return sum; +} + +/* + * maximal error of a stat counter. + */ +static inline unsigned long bdi_stat_error(struct backing_dev_info *bdi) +{ +#ifdef CONFIG_SMP + return nr_cpu_ids * BDI_STAT_BATCH; +#else + return 1; +#endif +} /* * Flags in backing_dev_info::capability @@ -93,7 +186,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) void clear_bdi_congested(struct backing_dev_info *bdi, int rw); void set_bdi_congested(struct backing_dev_info *bdi, int rw); long congestion_wait(int rw, long timeout); -void congestion_end(int rw); #define bdi_cap_writeback_dirty(bdi) \ (!((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{ int sh_bang; struct file * file; int e_uid, e_gid; - kernel_cap_t cap_inheritable, cap_permitted, cap_effective; + kernel_cap_t cap_inheritable, cap_permitted; + bool cap_effective; void *security; int argc, envc; char * filename; /* Name of binary as seen by procps */ @@ -63,17 +64,17 @@ struct linux_binprm{ * linux accepts. */ struct linux_binfmt { - struct linux_binfmt * next; + struct list_head lh; struct module *module; int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); int (*load_shlib)(struct file *); - int (*core_dump)(long signr, struct pt_regs * regs, struct file * file); + int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit); unsigned long min_coredump; /* minimal dump size */ int hasvdso; }; extern int register_binfmt(struct linux_binfmt *); -extern int unregister_binfmt(struct linux_binfmt *); +extern void unregister_binfmt(struct linux_binfmt *); extern int prepare_binprm(struct linux_binprm *); extern 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 @@ /* * This is <linux/capability.h> * - * Andrew G. Morgan <morgan@transmeta.com> + * Andrew G. Morgan <morgan@kernel.org> * Alexander Kjeldaas <astor@guardian.no> * with help from Aleph1, Roland Buresund and Andrew Main. * * See here for the libcap library ("POSIX draft" compliance): * - * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/ - */ + * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ + */ #ifndef _LINUX_CAPABILITY_H #define _LINUX_CAPABILITY_H @@ -28,23 +28,41 @@ struct task_struct; following structure to such a composite is better handled in a user library since the draft standard requires the use of malloc/free etc.. */ - + #define _LINUX_CAPABILITY_VERSION 0x19980330 typedef struct __user_cap_header_struct { __u32 version; int pid; } __user *cap_user_header_t; - + typedef struct __user_cap_data_struct { __u32 effective; __u32 permitted; __u32 inheritable; } __user *cap_user_data_t; - -#ifdef __KERNEL__ -#include <asm/current.h> +#define XATTR_CAPS_SUFFIX "capability" +#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX + +#define XATTR_CAPS_SZ (3*sizeof(__le32)) +#define VFS_CAP_REVISION_MASK 0xFF000000 +#define VFS_CAP_REVISION_1 0x01000000 + +#define VFS_CAP_REVISION VFS_CAP_REVISION_1 + +#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK +#define VFS_CAP_FLAGS_EFFECTIVE 0x000001 + +struct vfs_cap_data { + __u32 magic_etc; /* Little endian */ + struct { + __u32 permitted; /* Little endian */ + __u32 inheritable; /* Little endian */ + } data[1]; +}; + +#ifdef __KERNEL__ /* #define STRICT_CAP_T_TYPECHECKS */ @@ -59,7 +77,7 @@ typedef struct kernel_cap_struct { typedef __u32 kernel_cap_t; #endif - + #define _USER_CAP_HEADER_SIZE (2*sizeof(__u32)) #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) @@ -67,7 +85,7 @@ typedef __u32 kernel_cap_t; /** - ** POSIX-draft defined capabilities. + ** POSIX-draft defined capabilities. **/ /* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this @@ -87,7 +105,7 @@ typedef __u32 kernel_cap_t; defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */ #define CAP_DAC_READ_SEARCH 2 - + /* Overrides all restrictions about allowed operations on files, where file owner ID must be equal to the user ID, except where CAP_FSETID is applicable. It doesn't override MAC and DAC restrictions. */ @@ -257,7 +275,7 @@ typedef __u32 kernel_cap_t; /* Override reserved space on ext2 filesystem */ /* Modify data journaling mode on ext3 filesystem (uses journaling resources) */ -/* NOTE: ext2 honors fsuid when checking for resource overrides, so +/* NOTE: ext2 honors fsuid when checking for resource overrides, so you can override using fsuid too */ /* Override size restrictions on IPC message queues */ /* Allow more than 64hz interrupts from the real-time clock */ @@ -289,8 +307,10 @@ typedef __u32 kernel_cap_t; #define CAP_AUDIT_CONTROL 30 +#define CAP_SETFCAP 31 + #ifdef __KERNEL__ -/* +/* * Bounding set */ extern kernel_cap_t cap_bset; @@ -298,7 +318,7 @@ extern kernel_cap_t cap_bset; /* * Internal kernel functions only */ - + #ifdef STRICT_CAP_T_TYPECHECKS #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 @@ -/* Never include this file directly. Include <linux/compiler.h> instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead." +#endif /* * 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 @@ -/* Never include this file directly. Include <linux/compiler.h> instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." +#endif /* These definitions are for GCC v3.x. */ #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 @@ -/* Never include this file directly. Include <linux/compiler.h> instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." +#endif /* These definitions are for GCC v4.x. */ #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 @@ -/* Never include this file directly. Include <linux/compiler.h> instead. */ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead." +#endif #ifdef __ECC 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); extern unsigned short *set_translate(int m, struct vc_data *vc); extern int conv_uni_to_pc(struct vc_data *conp, long ucs); extern u32 conv_8bit_to_uni(unsigned char c); +extern int conv_uni_to_8bit(u32 uni); void 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) __cpuset_zone_allowed_hardwall(z, gfp_mask); } -extern int cpuset_excl_nodes_overlap(const struct task_struct *p); +extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, + const struct task_struct *tsk2); #define cpuset_memory_pressure_bump() \ do { \ @@ -113,7 +114,8 @@ static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask) return 1; } -static inline int cpuset_excl_nodes_overlap(const struct task_struct *p) +static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, + const struct task_struct *tsk2) { return 1; } 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 @@ #include <linux/types.h> #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ +#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */ #define CRAMFS_SIGNATURE "Compressed ROMFS" /* 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 @@ #define _LINUX_ELF_H #include <linux/types.h> -#include <linux/auxvec.h> #include <linux/elf-em.h> #include <asm/elf.h> @@ -355,6 +354,7 @@ typedef struct elf64_shdr { #define NT_TASKSTRUCT 4 #define NT_AUXV 6 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ +#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ /* 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 @@ +#ifndef _LINUX_ELFCORE_COMPAT_H +#define _LINUX_ELFCORE_COMPAT_H + +#include <linux/elf.h> +#include <linux/elfcore.h> +#include <linux/compat.h> + +/* + * Make sure these layouts match the linux/elfcore.h native definitions. + */ + +struct compat_elf_siginfo +{ + compat_int_t si_signo; + compat_int_t si_code; + compat_int_t si_errno; +}; + +struct compat_elf_prstatus +{ + struct compat_elf_siginfo pr_info; + short pr_cursig; + compat_ulong_t pr_sigpend; + compat_ulong_t pr_sighold; + compat_pid_t pr_pid; + compat_pid_t pr_ppid; + compat_pid_t pr_pgrp; + compat_pid_t pr_sid; + struct compat_timeval pr_utime; + struct compat_timeval pr_stime; + struct compat_timeval pr_cutime; + struct compat_timeval pr_cstime; + compat_elf_gregset_t pr_reg; +#ifdef CONFIG_BINFMT_ELF_FDPIC + compat_ulong_t pr_exec_fdpic_loadmap; + compat_ulong_t pr_interp_fdpic_loadmap; +#endif + compat_int_t pr_fpvalid; +}; + +struct compat_elf_prpsinfo +{ + char pr_state; + char pr_sname; + char pr_zomb; + char pr_nice; + compat_ulong_t pr_flag; + compat_uid_t pr_uid; + compat_gid_t pr_gid; + compat_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; + char pr_fname[16]; + char pr_psargs[ELF_PRARGSZ]; +}; + +#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 @@ #undef EXT2FS_DEBUG /* - * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files + * Define EXT2_RESERVATION to reserve data blocks for expanding files */ -#define EXT2_PREALLOCATE -#define EXT2_DEFAULT_PREALLOC_BLOCKS 8 - +#define EXT2_DEFAULT_RESERVE_BLOCKS 8 +/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ +#define EXT2_MAX_RESERVE_BLOCKS 1027 +#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0 /* * The second extended file system version */ @@ -200,6 +201,8 @@ struct ext2_group_desc #define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS #define EXT2_IOC_GETVERSION FS_IOC_GETVERSION #define EXT2_IOC_SETVERSION FS_IOC_SETVERSION +#define EXT2_IOC_GETRSVSZ _IOR('f', 5, long) +#define EXT2_IOC_SETRSVSZ _IOW('f', 6, long) /* * ioctl commands in 32 bit emulation @@ -317,8 +320,9 @@ struct ext2_inode { #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ -#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ -#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ +#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ +#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ +#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */ #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt @@ -558,4 +562,11 @@ enum { #define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ~EXT2_DIR_ROUND) +static inline ext2_fsblk_t +ext2_group_first_block_no(struct super_block *sb, unsigned long group_no) +{ + return group_no * (ext2_fsblk_t)EXT2_BLOCKS_PER_GROUP(sb) + + le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block); +} + #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 @@ #include <linux/blockgroup_lock.h> #include <linux/percpu_counter.h> +#include <linux/rbtree.h> + +/* XXX Here for now... not interested in restructing headers JUST now */ + +/* data type for block offset of block group */ +typedef int ext2_grpblk_t; + +/* data type for filesystem-wide blocks number */ +typedef unsigned long ext2_fsblk_t; + +#define E2FSBLK "%lu" + +struct ext2_reserve_window { + ext2_fsblk_t _rsv_start; /* First byte reserved */ + ext2_fsblk_t _rsv_end; /* Last byte reserved or 0 */ +}; + +struct ext2_reserve_window_node { + struct rb_node rsv_node; + __u32 rsv_goal_size; + __u32 rsv_alloc_hit; + struct ext2_reserve_window rsv_window; +}; + +struct ext2_block_alloc_info { + /* information about reservation window */ + struct ext2_reserve_window_node rsv_window_node; + /* + * was i_next_alloc_block in ext2_inode_info + * is the logical (file-relative) number of the + * most-recently-allocated block in this file. + * We use this for detecting linearly ascending allocation requests. + */ + __u32 last_alloc_logical_block; + /* + * Was i_next_alloc_goal in ext2_inode_info + * is the *physical* companion to i_next_alloc_block. + * it the the physical block number of the block which was most-recentl + * allocated to this file. This give us the goal (target) for the next + * allocation when we detect linearly ascending requests. + */ + ext2_fsblk_t last_alloc_physical_block; +}; + +#define rsv_start rsv_window._rsv_start +#define rsv_end rsv_window._rsv_end /* * second extended-fs super-block data in memory @@ -39,6 +85,7 @@ struct ext2_sb_info { struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; unsigned long s_mount_opt; + unsigned long s_sb_block; uid_t s_resuid; gid_t s_resgid; unsigned short s_mount_state; @@ -55,6 +102,10 @@ struct ext2_sb_info { struct percpu_counter s_freeinodes_counter; struct percpu_counter s_dirs_counter; struct blockgroup_lock s_blockgroup_lock; + /* root of the per fs reservation window tree */ + spinlock_t s_rsv_window_lock; + struct rb_root s_rsv_window_root; + struct ext2_reserve_window_node s_rsv_window_head; }; #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 @@ /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ #define EXT3_MAX_RESERVE_BLOCKS 1027 #define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0 -/* - * Always enable hashed directories - */ -#define CONFIG_EXT3_INDEX /* * Debug code @@ -665,17 +661,11 @@ struct ext3_dir_entry_2 { * (c) Daniel Phillips, 2001 */ -#ifdef CONFIG_EXT3_INDEX - #define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \ - EXT3_FEATURE_COMPAT_DIR_INDEX) && \ +#define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \ + EXT3_FEATURE_COMPAT_DIR_INDEX) && \ (EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) #define EXT3_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT3_LINK_MAX) #define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1) -#else - #define is_dx(dir) 0 -#define EXT3_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT3_LINK_MAX) -#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2) -#endif /* Legal values for the dx_root hash_version field: */ 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 { struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; unsigned long s_mount_opt; + ext3_fsblk_t s_sb_block; uid_t s_resuid; gid_t s_resgid; 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 { struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ struct buffer_head ** s_group_desc; unsigned long s_mount_opt; + ext4_fsblk_t s_sb_block; uid_t s_resuid; gid_t s_resgid; 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 @@ #include <asm/fcntl.h> -/* Cancel a blocking posix lock; internal use only until we expose an - * asynchronous lock api to userspace: */ -#define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5) +#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0) +#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1) -#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) -#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) +/* + * Cancel a blocking posix lock; internal use only until we expose an + * asynchronous lock api to userspace: + */ +#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5) + +/* Create a file descriptor with FD_CLOEXEC set. */ +#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6) /* * 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; extern void FASTCALL(__fput(struct file *)); extern void FASTCALL(fput(struct file *)); +struct file_operations; +struct vfsmount; +struct dentry; +extern int init_file(struct file *, struct vfsmount *mnt, + struct dentry *dentry, mode_t mode, + const struct file_operations *fop); +extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry, + mode_t mode, const struct file_operations *fop); + static inline void fput_light(struct file *file, int fput_needed) { 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; #include <linux/init.h> #include <linux/pid.h> #include <linux/mutex.h> -#include <linux/sysctl.h> #include <linux/capability.h> #include <asm/atomic.h> @@ -301,9 +300,9 @@ struct kstatfs; struct vm_area_struct; struct vfsmount; -extern void __init inode_init(unsigned long); +extern void __init inode_init(void); extern void __init inode_init_early(void); -extern void __init mnt_init(unsigned long); +extern void __init mnt_init(void); extern void __init files_init(unsigned long); struct buffer_head; @@ -330,6 +329,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, #define ATTR_KILL_SUID 2048 #define ATTR_KILL_SGID 4096 #define ATTR_FILE 8192 +#define ATTR_KILL_PRIV 16384 /* * This is the Inode Attributes structure, used for notify_change(). It @@ -793,7 +793,7 @@ struct file { unsigned int f_uid, f_gid; struct file_ra_state f_ra; - unsigned long f_version; + u64 f_version; #ifdef CONFIG_SECURITY void *f_security; #endif @@ -1003,6 +1003,7 @@ struct super_block { struct list_head s_inodes; /* all inodes */ struct list_head s_dirty; /* dirty inodes */ struct list_head s_io; /* parked for writeback */ + struct list_head s_more_io; /* parked for more writeback */ struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ struct list_head s_files; @@ -1261,16 +1262,68 @@ struct super_operations { #endif }; -/* Inode state bits. Protected by inode_lock. */ -#define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ -#define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ -#define I_DIRTY_PAGES 4 /* Data-related inode changes pending */ -#define __I_LOCK 3 +/* + * Inode state bits. Protected by inode_lock. + * + * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, + * I_DIRTY_DATASYNC and I_DIRTY_PAGES. + * + * Four bits define the lifetime of an inode. Initially, inodes are I_NEW, + * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at + * various stages of removing an inode. + * + * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. + * + * I_DIRTY_SYNC Inode itself is dirty. + * I_DIRTY_DATASYNC Data-related inode changes pending + * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. + * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both + * are cleared by unlock_new_inode(), called from iget(). + * I_WILL_FREE Must be set when calling write_inode_now() if i_count + * is zero. I_FREEING must be set when I_WILL_FREE is + * cleared. + * I_FREEING Set when inode is about to be freed but still has dirty + * pages or buffers attached or the inode itself is still + * dirty. + * I_CLEAR Set by clear_inode(). In this state the inode is clean + * and can be destroyed. + * + * Inodes that are I_WILL_FREE, I_FREEING or I_CLEAR are + * prohibited for many purposes. iget() must wait for + * the inode to be completely released, then create it + * anew. Other functions will just ignore such inodes, + * if appropriate. I_LOCK is used for waiting. + * + * I_LOCK Serves as both a mutex and completion notification. + * New inodes set I_LOCK. If two processes both create + * the same inode, one of them will release its inode and + * wait for I_LOCK to be released before returning. + * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can + * also cause waiting on I_LOCK, without I_LOCK actually + * being set. find_inode() uses this to prevent returning + * nearly-dead inodes. + * I_SYNC Similar to I_LOCK, but limited in scope to writeback + * of inode dirty data. Having a seperate lock for this + * purpose reduces latency and prevents some filesystem- + * specific deadlocks. + * + * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced + * by (I_DIRTY_SYNC|I_DIRTY_PAGES). + * Q: What is the difference between I_WILL_FREE and I_FREEING? + * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on + * I_CLEAR? If not, why? + */ +#define I_DIRTY_SYNC 1 +#define I_DIRTY_DATASYNC 2 +#define I_DIRTY_PAGES 4 +#define I_NEW 8 +#define I_WILL_FREE 16 +#define I_FREEING 32 +#define I_CLEAR 64 +#define __I_LOCK 7 #define I_LOCK (1 << __I_LOCK) -#define I_FREEING 16 -#define I_CLEAR 32 -#define I_NEW 64 -#define I_WILL_FREE 128 +#define __I_SYNC 8 +#define I_SYNC (1 << __I_SYNC) #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) @@ -1729,6 +1782,7 @@ extern int bdev_read_only(struct block_device *); extern int set_blocksize(struct block_device *, int); extern int sb_set_blocksize(struct super_block *, int); extern int sb_min_blocksize(struct super_block *, int); +extern int sb_has_dirty_inodes(struct super_block *); extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); @@ -1887,8 +1941,6 @@ extern int simple_empty(struct dentry *); extern int simple_readpage(struct file *file, struct page *page); extern int simple_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to); -extern int simple_commit_write(struct file *file, struct page *page, - unsigned offset, unsigned to); extern int simple_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata); @@ -2032,7 +2084,8 @@ static inline void free_secdata(void *secdata) { } #endif /* CONFIG_SECURITY */ -int proc_nr_files(ctl_table *table, int write, struct file *filp, +struct ctl_table; +int proc_nr_files(struct ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos); 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 @@ #ifndef _LINUX_IF_FDDI_H #define _LINUX_IF_FDDI_H +#include <linux/types.h> + /* * Define max and min legal sizes. The frame sizes do not include * 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 { * obs_kernel_param "array" too far apart in .init.setup. */ #define __setup_param(str, unique_id, fn, early) \ - static char __setup_str_##unique_id[] __initdata = str; \ + static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \ static struct obs_kernel_param __setup_##unique_id \ __attribute_used__ \ __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; #define INIT_NSPROXY(nsproxy) { \ .pid_ns = &init_pid_ns, \ .count = ATOMIC_INIT(1), \ - .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ .uts_ns = &init_uts_ns, \ .mnt_ns = NULL, \ INIT_NET_NS(net_ns) \ @@ -171,6 +170,7 @@ extern struct group_info init_groups; [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ }, \ + .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ INIT_TRACE_IRQFLAGS \ INIT_LOCKDEP \ } 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 @@ #define IRQF_NOBALANCING 0x00000800 #define IRQF_IRQPOLL 0x00001000 -/* - * Migration helpers. Scheduled for removal in 9/2007 - * Do not use for new code ! - */ -static inline -unsigned long __deprecated deprecated_irq_flag(unsigned long flag) -{ - return flag; -} - -#define SA_INTERRUPT deprecated_irq_flag(IRQF_DISABLED) -#define SA_SAMPLE_RANDOM deprecated_irq_flag(IRQF_SAMPLE_RANDOM) -#define SA_SHIRQ deprecated_irq_flag(IRQF_SHARED) -#define SA_PROBEIRQ deprecated_irq_flag(IRQF_PROBE_SHARED) -#define SA_PERCPU deprecated_irq_flag(IRQF_PERCPU) - -#define SA_TRIGGER_LOW deprecated_irq_flag(IRQF_TRIGGER_LOW) -#define SA_TRIGGER_HIGH deprecated_irq_flag(IRQF_TRIGGER_HIGH) -#define SA_TRIGGER_FALLING deprecated_irq_flag(IRQF_TRIGGER_FALLING) -#define SA_TRIGGER_RISING deprecated_irq_flag(IRQF_TRIGGER_RISING) -#define SA_TRIGGER_MASK deprecated_irq_flag(IRQF_TRIGGER_MASK) - typedef irqreturn_t (*irq_handler_t)(int, void *); struct 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 #define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger message sizes, etc. */ +/* + * These are used to wrap system calls. + * + * See architecture code for ugly details.. + */ +struct ipc_kludge { + struct msgbuf __user *msgp; + long msgtyp; +}; + +#define SEMOP 1 +#define SEMGET 2 +#define SEMCTL 3 +#define SEMTIMEDOP 4 +#define MSGSND 11 +#define MSGRCV 12 +#define MSGGET 13 +#define MSGCTL 14 +#define SHMAT 21 +#define SHMDT 22 +#define SHMGET 23 +#define SHMCTL 24 + +/* Used by the DIPC package, try and avoid reusing it */ +#define DIPC 25 + +#define IPCCALL(version,op) ((version)<<16 | (op)) + #ifdef __KERNEL__ #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 @@ #define _DIACR_H #include <linux/kd.h> -extern struct kbdiacr accent_table[]; +extern struct kbdiacruc accent_table[]; extern unsigned int accent_table_size; #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 { #define KDGKBDIACR 0x4B4A /* read kernel accent table */ #define KDSKBDIACR 0x4B4B /* write kernel accent table */ +struct kbdiacruc { + __u32 diacr, base, result; +}; +struct kbdiacrsuc { + unsigned int kb_cnt; /* number of entries in following array */ + struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */ +}; +#define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */ +#define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */ + struct kbkeycode { unsigned int scancode, keycode; }; 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[]; #define KERN_INFO "<6>" /* informational */ #define KERN_DEBUG "<7>" /* debug-level messages */ +/* + * Annotation for a "continued" line of log printout (only done after a + * line that had no enclosing \n). Only to be used by core/arch code + * during early bootup (a continued line is not SMP-safe otherwise). + */ +#define KERN_CONT "" + extern int console_printk[]; #define console_loglevel (console_printk[0]) @@ -172,6 +179,9 @@ asmlinkage int vprintk(const char *fmt, va_list args) __attribute__ ((format (printf, 1, 0))); asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))) __cold; +extern int log_buf_get_len(void); +extern int log_buf_read(int idx); +extern int log_buf_copy(char *dest, int idx, int len); #else static inline int vprintk(const char *s, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -179,6 +189,9 @@ static inline int vprintk(const char *s, va_list args) { return 0; } static inline int printk(const char *s, ...) __attribute__ ((format (printf, 1, 2))); static inline int __cold printk(const char *s, ...) { return 0; } +static inline int log_buf_get_len(void) { return 0; } +static inline int log_buf_read(int idx) { return 0; } +static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } #endif unsigned long int_sqrt(unsigned long); @@ -245,10 +258,25 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, const void *buf, size_t len); #define hex_asc(x) "0123456789abcdef"[x] +#define pr_emerg(fmt, arg...) \ + printk(KERN_EMERG fmt, ##arg) +#define pr_alert(fmt, arg...) \ + printk(KERN_ALERT fmt, ##arg) +#define pr_crit(fmt, arg...) \ + printk(KERN_CRIT fmt, ##arg) +#define pr_err(fmt, arg...) \ + printk(KERN_ERR fmt, ##arg) +#define pr_warning(fmt, arg...) \ + printk(KERN_WARNING fmt, ##arg) +#define pr_notice(fmt, arg...) \ + printk(KERN_NOTICE fmt, ##arg) +#define pr_info(fmt, arg...) \ + printk(KERN_INFO fmt, ##arg) + #ifdef DEBUG /* If you are writing a driver, please use dev_dbg instead */ -#define pr_debug(fmt,arg...) \ - printk(KERN_DEBUG fmt,##arg) +#define pr_debug(fmt, arg...) \ + printk(KERN_DEBUG fmt, ##arg) #else static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) { @@ -256,9 +284,6 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * } #endif -#define pr_info(fmt,arg...) \ - printk(KERN_INFO fmt,##arg) - /* * Display an IP address in readable format. */ 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, extern void crash_kexec(struct pt_regs *); int kexec_should_crash(struct task_struct *); void crash_save_cpu(struct pt_regs *regs, int cpu); +void crash_save_vmcoreinfo(void); +void arch_crash_save_vmcoreinfo(void); +void vmcoreinfo_append_str(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); +unsigned long paddr_vmcoreinfo_note(void); + +#define VMCOREINFO_SYMBOL(name) \ + vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) +#define VMCOREINFO_SIZE(name) \ + vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ + (unsigned long)sizeof(struct name)) +#define VMCOREINFO_TYPEDEF_SIZE(name) \ + vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ + (unsigned long)sizeof(name)) +#define VMCOREINFO_OFFSET(name, field) \ + vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ + (unsigned long)&(((struct name *)0)->field)) +#define VMCOREINFO_LENGTH(name, value) \ + vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) +#define VMCOREINFO_NUMBER(name) \ + vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) +#define VMCOREINFO_CONFIG(name) \ + vmcoreinfo_append_str("CONFIG_%s=y\n", #name) + extern struct kimage *kexec_image; extern struct kimage *kexec_crash_image; @@ -148,11 +172,20 @@ extern struct kimage *kexec_crash_image; #define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ +#define VMCOREINFO_BYTES (4096) +#define VMCOREINFO_NOTE_NAME "VMCOREINFO" +#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4) +#define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \ + + VMCOREINFO_NOTE_NAME_BYTES) + /* Location of a reserved region to hold the crash kernel. */ extern struct resource crashk_res; typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; extern note_buf_t *crash_notes; +extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; +extern size_t vmcoreinfo_size; +extern size_t vmcoreinfo_max_size; #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 @@ +/* Definitions for key type implementations + * + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public Licence + * as published by the Free Software Foundation; either version + * 2 of the Licence, or (at your option) any later version. + */ + +#ifndef _LINUX_KEY_TYPE_H +#define _LINUX_KEY_TYPE_H + +#include <linux/key.h> + +#ifdef CONFIG_KEYS + +/* + * key under-construction record + * - passed to the request_key actor if supplied + */ +struct key_construction { + struct key *key; /* key being constructed */ + struct key *authkey;/* authorisation for key being constructed */ +}; + +typedef int (*request_key_actor_t)(struct key_construction *key, + const char *op, void *aux); + +/* + * kernel managed key type definition + */ +struct key_type { + /* name of the type */ + const char *name; + + /* default payload length for quota precalculation (optional) + * - this can be used instead of calling key_payload_reserve(), that + * function only needs to be called if the real datalen is different + */ + size_t def_datalen; + + /* instantiate a key of this type + * - this method should call key_payload_reserve() to determine if the + * user's quota will hold the payload + */ + int (*instantiate)(struct key *key, const void *data, size_t datalen); + + /* update a key of this type (optional) + * - this method should call key_payload_reserve() to recalculate the + * quota consumption + * - the key must be locked against read when modifying + */ + int (*update)(struct key *key, const void *data, size_t datalen); + + /* match a key against a description */ + int (*match)(const struct key *key, const void *desc); + + /* clear some of the data from a key on revokation (optional) + * - the key's semaphore will be write-locked by the caller + */ + void (*revoke)(struct key *key); + + /* clear the data from a key (optional) */ + void (*destroy)(struct key *key); + + /* describe a key */ + void (*describe)(const struct key *key, struct seq_file *p); + + /* read a key's data (optional) + * - permission checks will be done by the caller + * - the key's semaphore will be readlocked by the caller + * - should return the amount of data that could be read, no matter how + * much is copied into the buffer + * - shouldn't do the copy if the buffer is NULL + */ + long (*read)(const struct key *key, char __user *buffer, size_t buflen); + + /* handle request_key() for this type instead of invoking + * /sbin/request-key (optional) + * - key is the key to instantiate + * - authkey is the authority to assume when instantiating this key + * - op is the operation to be done, usually "create" + * - the call must not return until the instantiation process has run + * its course + */ + request_key_actor_t request_key; + + /* internal fields */ + struct list_head link; /* link in types list */ +}; + +extern struct key_type key_type_keyring; + +extern int register_key_type(struct key_type *ktype); +extern void unregister_key_type(struct key_type *ktype); + +extern int key_payload_reserve(struct key *key, size_t datalen); +extern int key_instantiate_and_link(struct key *key, + const void *data, + size_t datalen, + struct key *keyring, + struct key *instkey); +extern int key_negate_and_link(struct key *key, + unsigned timeout, + struct key *keyring, + struct key *instkey); +extern void complete_request_key(struct key_construction *cons, int error); + +#endif /* CONFIG_KEYS */ +#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 @@ -/* key.h: authentication token and access key management +/* Authentication token and access key management * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. + * Copyright (C) 2004, 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or @@ -175,78 +175,6 @@ struct key { } payload; }; -/*****************************************************************************/ -/* - * kernel managed key type definition - */ -typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, - const char *op, void *aux); - -struct key_type { - /* name of the type */ - const char *name; - - /* default payload length for quota precalculation (optional) - * - this can be used instead of calling key_payload_reserve(), that - * function only needs to be called if the real datalen is different - */ - size_t def_datalen; - - /* instantiate a key of this type - * - this method should call key_payload_reserve() to determine if the - * user's quota will hold the payload - */ - int (*instantiate)(struct key *key, const void *data, size_t datalen); - - /* update a key of this type (optional) - * - this method should call key_payload_reserve() to recalculate the - * quota consumption - * - the key must be locked against read when modifying - */ - int (*update)(struct key *key, const void *data, size_t datalen); - - /* match a key against a description */ - int (*match)(const struct key *key, const void *desc); - - /* clear some of the data from a key on revokation (optional) - * - the key's semaphore will be write-locked by the caller - */ - void (*revoke)(struct key *key); - - /* clear the data from a key (optional) */ - void (*destroy)(struct key *key); - - /* describe a key */ - void (*describe)(const struct key *key, struct seq_file *p); - - /* read a key's data (optional) - * - permission checks will be done by the caller - * - the key's semaphore will be readlocked by the caller - * - should return the amount of data that could be read, no matter how - * much is copied into the buffer - * - shouldn't do the copy if the buffer is NULL - */ - long (*read)(const struct key *key, char __user *buffer, size_t buflen); - - /* handle request_key() for this type instead of invoking - * /sbin/request-key (optional) - * - key is the key to instantiate - * - authkey is the authority to assume when instantiating this key - * - op is the operation to be done, usually "create" - * - the call must not return until the instantiation process has run - * its course - */ - request_key_actor_t request_key; - - /* internal fields */ - struct list_head link; /* link in types list */ -}; - -extern struct key_type key_type_keyring; - -extern int register_key_type(struct key_type *ktype); -extern void unregister_key_type(struct key_type *ktype); - extern struct key *key_alloc(struct key_type *type, const char *desc, uid_t uid, gid_t gid, @@ -259,16 +187,6 @@ extern struct key *key_alloc(struct key_type *type, #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ -extern int key_payload_reserve(struct key *key, size_t datalen); -extern int key_instantiate_and_link(struct key *key, - const void *data, - size_t datalen, - struct key *keyring, - struct key *instkey); -extern int key_negate_and_link(struct key *key, - unsigned timeout, - struct key *keyring, - struct key *instkey); extern void key_revoke(struct key *key); extern void key_put(struct key *key); @@ -293,6 +211,17 @@ extern struct key *request_key_with_auxdata(struct key_type *type, const char *callout_info, void *aux); +extern struct key *request_key_async(struct key_type *type, + const char *description, + const char *callout_info); + +extern struct key *request_key_async_with_auxdata(struct key_type *type, + const char *description, + const char *callout_info, + void *aux); + +extern int wait_for_key_construction(struct key *key, bool intr); + extern int key_validate(struct key *key); extern key_ref_t key_create_or_update(key_ref_t keyring, @@ -328,8 +257,6 @@ extern int keyring_add_key(struct key *keyring, extern struct key *key_lookup(key_serial_t id); -extern void keyring_replace_payload(struct key *key, void *replacement); - #define key_serial(key) ((key) ? (key)->serial : 0) /* 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, pos = n, n = pos->next) /** + * list_for_each_prev_safe - iterate over a list backwards safe against removal + of list entry + * @pos: the &struct list_head to use as a loop cursor. + * @n: another &struct list_head to use as temporary storage + * @head: the head for your list. + */ +#define list_for_each_prev_safe(pos, n, head) \ + for (pos = (head)->prev, n = pos->prev; \ + prefetch(pos->prev), pos != (head); \ + pos = n, n = pos->prev) + +/** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @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) return 1UL << fls_long(n - 1); } +/* + * round down to nearest power of two + */ +static inline __attribute__((const)) +unsigned long __rounddown_pow_of_two(unsigned long n) +{ + return 1UL << (fls_long(n) - 1); +} + /** * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value * @n - parameter @@ -165,4 +174,20 @@ unsigned long __roundup_pow_of_two(unsigned long n) __roundup_pow_of_two(n) \ ) +/** + * rounddown_pow_of_two - round the given value down to nearest power of two + * @n - parameter + * + * round the given value down to the nearest power of two + * - the result is undefined when n == 0 + * - this can be used to initialise global variables from constant data + */ +#define rounddown_pow_of_two(n) \ +( \ + __builtin_constant_p(n) ? ( \ + (n == 1) ? 0 : \ + (1UL << ilog2(n))) : \ + __rounddown_pow_of_two(n) \ + ) + #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 @@ #define SMB_SUPER_MAGIC 0x517B #define USBDEVICE_SUPER_MAGIC 0x9fa2 +#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA +#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA + #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 @@ #include <linux/mmzone.h> #include <linux/rbtree.h> #include <linux/prio_tree.h> -#include <linux/mutex.h> #include <linux/debug_locks.h> -#include <linux/backing-dev.h> #include <linux/mm_types.h> struct 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 @@ #ifndef _LINUX_MM_TYPES_H #define _LINUX_MM_TYPES_H -#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ +#include <linux/auxvec.h> #include <linux/types.h> #include <linux/threads.h> #include <linux/list.h> @@ -13,6 +13,11 @@ #include <asm/page.h> #include <asm/mmu.h> +#ifndef AT_VECTOR_SIZE_ARCH +#define AT_VECTOR_SIZE_ARCH 0 +#endif +#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) + struct address_space; #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 @@ #include <linux/spinlock.h> #include <linux/list.h> #include <linux/wait.h> +#include <linux/bitops.h> #include <linux/cache.h> #include <linux/threads.h> #include <linux/numa.h> @@ -262,10 +263,7 @@ struct zone { unsigned long nr_scan_active; unsigned long nr_scan_inactive; unsigned long pages_scanned; /* since last reclaim */ - int all_unreclaimable; /* All pages pinned */ - - /* A count of how many reclaimers are scanning this zone */ - atomic_t reclaim_in_progress; + unsigned long flags; /* zone flags, see below */ /* Zone statistics */ atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; @@ -343,6 +341,42 @@ struct zone { const char *name; } ____cacheline_internodealigned_in_smp; +typedef enum { + ZONE_ALL_UNRECLAIMABLE, /* all pages pinned */ + ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ + ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ +} zone_flags_t; + +static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) +{ + set_bit(flag, &zone->flags); +} + +static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag) +{ + return test_and_set_bit(flag, &zone->flags); +} + +static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag) +{ + clear_bit(flag, &zone->flags); +} + +static inline int zone_is_all_unreclaimable(const struct zone *zone) +{ + return test_bit(ZONE_ALL_UNRECLAIMABLE, &zone->flags); +} + +static inline int zone_is_reclaim_locked(const struct zone *zone) +{ + return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); +} + +static inline int zone_is_oom_locked(const struct zone *zone) +{ + return test_bit(ZONE_OOM_LOCKED, &zone->flags); +} + /* * The "priority" of VM scanning is how much of the queues we will scan in one * 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 /* Arch-specific module values */ struct mod_arch_specific arch; - /* Am I unsafe to unload? */ - int unsafe; - unsigned int taints; /* same bits as kernel:tainted */ #ifdef CONFIG_GENERIC_BUG @@ -346,6 +343,9 @@ struct module /* Section attributes */ struct module_sect_attrs *sect_attrs; + + /* Notes attributes */ + struct module_notes_attrs *notes_attrs; #endif /* Per-cpu data. */ @@ -441,16 +441,6 @@ static inline void __module_get(struct module *module) __mod ? __mod->name : "kernel"; \ }) -#define __unsafe(mod) \ -do { \ - if (mod && !(mod)->unsafe) { \ - printk(KERN_WARNING \ - "Module %s cannot be unloaded due to unsafe usage in" \ - " %s:%u\n", (mod)->name, __FILE__, __LINE__); \ - (mod)->unsafe = 1; \ - } \ -} while(0) - /* For kallsyms to ask for address resolution. NULL means not found. */ const char *module_address_lookup(unsigned long addr, unsigned long *symbolsize, @@ -518,8 +508,6 @@ static inline void module_put(struct module *module) #define module_name(mod) "kernel" -#define __unsafe(mod) - /* For kallsyms to ask for address resolution. NULL means not found. */ static inline const char *module_address_lookup(unsigned long addr, 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 { unsigned int perm; param_set_fn set; param_get_fn get; - void *arg; + union { + void *arg; + const struct kparam_string *str; + const struct kparam_array *arr; + }; }; /* Special one for strings we want to copy into */ @@ -66,11 +70,11 @@ struct kparam_array /* Default value instead of permissions? */ \ static int __param_perm_check_##name __attribute__((unused)) = \ BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ - static char __param_str_##name[] = prefix #name; \ + static const char __param_str_##name[] = prefix #name; \ static struct kernel_param const __param_##name \ __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ - = { __param_str_##name, perm, set, get, arg } + = { __param_str_##name, perm, set, get, { arg } } #define module_param_call(name, set, get, arg, perm) \ __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) @@ -88,10 +92,10 @@ struct kparam_array /* Actually copy string: maxlen param is usually sizeof(string). */ #define module_param_string(name, string, len, perm) \ - static struct kparam_string __param_string_##name \ + static const struct kparam_string __param_string_##name \ = { len, string }; \ module_param_call(name, param_set_copystring, param_get_string, \ - &__param_string_##name, perm); \ + .str = &__param_string_##name, perm); \ __MODULE_PARM_TYPE(name, "string") /* Called on module insert or kernel boot */ @@ -149,11 +153,11 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); /* Comma-separated array: *nump is set to number they actually specified. */ #define module_param_array_named(name, array, type, nump, perm) \ - static struct kparam_array __param_arr_##name \ + static const struct kparam_array __param_arr_##name \ = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ - &__param_arr_##name, perm); \ + .arr = &__param_arr_##name, perm); \ __MODULE_PARM_TYPE(name, "array of " #type) #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 @@ * - task may not exit with mutex held * - memory areas where held locks reside must not be freed * - held mutexes must not be reinitialized - * - mutexes may not be used in irq contexts + * - mutexes may not be used in hardware or software interrupt + * contexts such as tasklets and timers * * These semantics are fully enforced when DEBUG_MUTEXES is * 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 extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); extern void release_open_intent(struct nameidata *); -extern struct dentry * lookup_one_len(const char *, struct dentry *, int); -extern struct dentry *lookup_one_len_kern(const char *, struct dentry *, int); +extern struct dentry *lookup_one_len(const char *, struct dentry *, int); +extern struct dentry *lookup_one_noperm(const char *, struct dentry *); extern int follow_down(struct vfsmount **, struct dentry **); extern 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 @@ #define NBD_PRINT_DEBUG _IO( 0xab, 6 ) #define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) #define NBD_DISCONNECT _IO( 0xab, 8 ) +#define NBD_SET_TIMEOUT _IO( 0xab, 9 ) enum { NBD_CMD_READ = 0, @@ -65,6 +66,7 @@ struct nbd_device { int blksize; u64 bytesize; pid_t pid; /* pid of nbd-client, if attached */ + int xmit_timeout; }; #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 @@ typedef __u16 wchar_t; struct nls_table { - char *charset; - char *alias; + const char *charset; + const char *alias; int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen); int (*char2uni) (const unsigned char *rawstring, int boundlen, wchar_t *uni); - unsigned char *charset2lower; - unsigned char *charset2upper; + const unsigned char *charset2lower; + const unsigned char *charset2upper; struct module *owner; struct nls_table *next; }; 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; */ struct nsproxy { atomic_t count; - spinlock_t nslock; struct uts_namespace *uts_ns; struct ipc_namespace *ipc_ns; struct mnt_namespace *mnt_ns; diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 91bf84b9d144..212bffb2b174 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -22,5 +22,10 @@ extern int of_device_register(struct of_device *ofdev); extern void of_device_unregister(struct of_device *ofdev); extern void of_release_dev(struct device *dev); +static inline void of_device_free(struct of_device *dev) +{ + of_release_dev(&dev->dev); +} + #endif /* __KERNEL__ */ #endif /* _LINUX_OF_DEVICE_H */ 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 @@ #define OOM_ADJUST_MIN (-16) #define OOM_ADJUST_MAX 15 -#endif +#ifdef __KERNEL__ + +#include <linux/types.h> + +struct zonelist; +struct notifier_block; + +/* + * Types of limitations to the nodes from which allocations may occur + */ +enum oom_constraint { + CONSTRAINT_NONE, + CONSTRAINT_CPUSET, + CONSTRAINT_MEMORY_POLICY, +}; + +extern int try_set_zone_oom(struct zonelist *zonelist); +extern void clear_zonelist_oom(struct zonelist *zonelist); + +extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); +extern int register_oom_notifier(struct notifier_block *nb); +extern int unregister_oom_notifier(struct notifier_block *nb); + +#endif /* __KERNEL__*/ +#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 { #define FBC_BATCH (NR_CPUS*4) #endif -void percpu_counter_init(struct percpu_counter *fbc, s64 amount); +int percpu_counter_init(struct percpu_counter *fbc, s64 amount); +int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); void percpu_counter_destroy(struct percpu_counter *fbc); -void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); -s64 percpu_counter_sum(struct percpu_counter *fbc); +void percpu_counter_set(struct percpu_counter *fbc, s64 amount); +void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); +s64 __percpu_counter_sum(struct percpu_counter *fbc); + +static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) +{ + __percpu_counter_add(fbc, amount, FBC_BATCH); +} + +static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) +{ + s64 ret = __percpu_counter_sum(fbc); + return ret < 0 ? 0 : ret; +} + +static inline s64 percpu_counter_sum(struct percpu_counter *fbc) +{ + return __percpu_counter_sum(fbc); +} static inline s64 percpu_counter_read(struct percpu_counter *fbc) { @@ -61,17 +79,28 @@ struct percpu_counter { s64 count; }; -static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) +static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount) { fbc->count = amount; + return 0; } +#define percpu_counter_init_irq percpu_counter_init + static inline void percpu_counter_destroy(struct percpu_counter *fbc) { } +static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount) +{ + fbc->count = amount; +} + +#define __percpu_counter_add(fbc, amount, batch) \ + percpu_counter_add(fbc, amount) + static inline void -percpu_counter_mod(struct percpu_counter *fbc, s32 amount) +percpu_counter_add(struct percpu_counter *fbc, s64 amount) { preempt_disable(); fbc->count += amount; @@ -88,21 +117,31 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) return fbc->count; } -static inline s64 percpu_counter_sum(struct percpu_counter *fbc) +static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) { return percpu_counter_read_positive(fbc); } +static inline s64 percpu_counter_sum(struct percpu_counter *fbc) +{ + return percpu_counter_read(fbc); +} + #endif /* CONFIG_SMP */ static inline void percpu_counter_inc(struct percpu_counter *fbc) { - percpu_counter_mod(fbc, 1); + percpu_counter_add(fbc, 1); } static inline void percpu_counter_dec(struct percpu_counter *fbc) { - percpu_counter_mod(fbc, -1); + percpu_counter_add(fbc, -1); +} + +static inline void percpu_counter_sub(struct percpu_counter *fbc, s64 amount) +{ + percpu_counter_add(fbc, -amount); } #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 { #define PNP_CONFIGURABLE 0x0008 #define PNP_REMOVABLE 0x0010 -#define pnp_can_read(dev) (((dev)->protocol) && ((dev)->protocol->get) && \ +#define pnp_can_read(dev) (((dev)->protocol->get) && \ ((dev)->capabilities & PNP_READ)) -#define pnp_can_write(dev) (((dev)->protocol) && ((dev)->protocol->set) && \ +#define pnp_can_write(dev) (((dev)->protocol->set) && \ ((dev)->capabilities & PNP_WRITE)) -#define pnp_can_disable(dev) (((dev)->protocol) && ((dev)->protocol->disable) && \ +#define pnp_can_disable(dev) (((dev)->protocol->disable) && \ ((dev)->capabilities & PNP_DISABLE)) #define pnp_can_configure(dev) ((!(dev)->active) && \ ((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); int register_timer_hook(int (*hook)(struct pt_regs *)); void unregister_timer_hook(int (*hook)(struct pt_regs *)); -/* Timer based profiling hook */ -extern int (*timer_hook)(struct pt_regs *); - struct pt_regs; #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 @@ +/* + * FLoating proportions + * + * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> + * + * This file contains the public data structure and API definitions. + */ + +#ifndef _LINUX_PROPORTIONS_H +#define _LINUX_PROPORTIONS_H + +#include <linux/percpu_counter.h> +#include <linux/spinlock.h> +#include <linux/mutex.h> + +struct prop_global { + /* + * The period over which we differentiate + * + * period = 2^shift + */ + int shift; + /* + * The total event counter aka 'time'. + * + * Treated as an unsigned long; the lower 'shift - 1' bits are the + * counter bits, the remaining upper bits the period counter. + */ + struct percpu_counter events; +}; + +/* + * global proportion descriptor + * + * this is needed to consitently flip prop_global structures. + */ +struct prop_descriptor { + int index; + struct prop_global pg[2]; + struct mutex mutex; /* serialize the prop_global switch */ +}; + +int prop_descriptor_init(struct prop_descriptor *pd, int shift); +void prop_change_shift(struct prop_descriptor *pd, int new_shift); + +/* + * ----- PERCPU ------ + */ + +struct prop_local_percpu { + /* + * the local events counter + */ + struct percpu_counter events; + + /* + * snapshot of the last seen global state + */ + int shift; + unsigned long period; + spinlock_t lock; /* protect the snapshot state */ +}; + +int prop_local_init_percpu(struct prop_local_percpu *pl); +void prop_local_destroy_percpu(struct prop_local_percpu *pl); +void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl); +void prop_fraction_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl, + long *numerator, long *denominator); + +static inline +void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl) +{ + unsigned long flags; + + local_irq_save(flags); + __prop_inc_percpu(pd, pl); + local_irq_restore(flags); +} + +/* + * ----- SINGLE ------ + */ + +struct prop_local_single { + /* + * the local events counter + */ + unsigned long events; + + /* + * snapshot of the last seen global state + * and a lock protecting this state + */ + int shift; + unsigned long period; + spinlock_t lock; /* protect the snapshot state */ +}; + +#define INIT_PROP_LOCAL_SINGLE(name) \ +{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ +} + +int prop_local_init_single(struct prop_local_single *pl); +void prop_local_destroy_single(struct prop_local_single *pl); +void __prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl); +void prop_fraction_single(struct prop_descriptor *pd, struct prop_local_single *pl, + long *numerator, long *denominator); + +static inline +void prop_inc_single(struct prop_descriptor *pd, struct prop_local_single *pl) +{ + unsigned long flags; + + local_irq_save(flags); + __prop_inc_single(pd, pl); + local_irq_restore(flags); +} + +#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 { __u32 dqi_valid; }; +/* + * Definitions for quota netlink interface + */ +#define QUOTA_NL_NOWARN 0 +#define QUOTA_NL_IHARDWARN 1 /* Inode hardlimit reached */ +#define QUOTA_NL_ISOFTLONGWARN 2 /* Inode grace time expired */ +#define QUOTA_NL_ISOFTWARN 3 /* Inode softlimit reached */ +#define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */ +#define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */ +#define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */ + +enum { + QUOTA_NL_C_UNSPEC, + QUOTA_NL_C_WARNING, + __QUOTA_NL_C_MAX, +}; +#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1) + +enum { + QUOTA_NL_A_UNSPEC, + QUOTA_NL_A_QTYPE, + QUOTA_NL_A_EXCESS_ID, + QUOTA_NL_A_WARNING, + QUOTA_NL_A_DEV_MAJOR, + QUOTA_NL_A_DEV_MINOR, + QUOTA_NL_A_CAUSED_ID, + __QUOTA_NL_A_MAX, +}; +#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1) + + #ifdef __KERNEL__ #include <linux/spinlock.h> #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; /* use these for bitmap->flags and bitmap->sb->state bit-fields */ enum bitmap_state { - BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */ BITMAP_WRITE_ERROR = 0x004, /* A write error has occurred */ BITMAP_HOSTENDIAN = 0x8000, @@ -258,7 +257,6 @@ struct bitmap { int bitmap_create(mddev_t *mddev); void bitmap_flush(mddev_t *mddev); void bitmap_destroy(mddev_t *mddev); -int bitmap_active(struct bitmap *bitmap); char *file_path(struct file *file, char *buf, int count); void 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; local_bh_enable(); \ } while(0) +/* + * Prevent the compiler from merging or refetching accesses. The compiler + * is also forbidden from reordering successive instances of ACCESS_ONCE(), + * but only when the compiler is aware of some particular ordering. One way + * to make the compiler aware of ordering is to put the two invocations of + * ACCESS_ONCE() in different C statements. + * + * This macro does absolutely -nothing- to prevent the CPU from reordering, + * merging, or refetching absolutely anything at any time. + */ +#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) + /** * rcu_dereference - fetch an RCU-protected pointer in an * RCU read-side critical section. This pointer may later @@ -242,7 +254,7 @@ extern struct lockdep_map rcu_lock_map; */ #define rcu_dereference(p) ({ \ - typeof(p) _________p1 = p; \ + typeof(p) _________p1 = ACCESS_ONCE(p); \ smp_read_barrier_depends(); \ (_________p1); \ }) 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 return th->t_blocks_allocated - th->t_blocks_logged; } -int reiserfs_async_progress_wait(struct super_block *s); - struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct super_block *, @@ -1859,8 +1857,6 @@ void padd_item(char *item, int total_length, int length); #define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */ #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ -int restart_transaction(struct reiserfs_transaction_handle *th, - struct inode *inode, struct treepath *path); void reiserfs_read_locked_inode(struct inode *inode, struct reiserfs_iget_args *args); int reiserfs_find_actor(struct inode *inode, void *p); @@ -2137,9 +2133,6 @@ void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th, struct inode *inode); void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th); #endif -void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks); -void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks); -int reiserfs_can_fit_pages(struct super_block *sb); /* hashes.c */ __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 { #include <linux/pid.h> #include <linux/percpu.h> #include <linux/topology.h> +#include <linux/proportions.h> #include <linux/seccomp.h> #include <linux/rcupdate.h> #include <linux/futex.h> @@ -260,6 +261,7 @@ extern void softlockup_tick(void); extern void spawn_softlockup_task(void); extern void touch_softlockup_watchdog(void); extern void touch_all_softlockup_watchdogs(void); +extern int softlockup_thresh; #else static inline void softlockup_tick(void) { @@ -357,8 +359,9 @@ extern int get_dumpable(struct mm_struct *mm); #define MMF_DUMP_ANON_SHARED 3 #define MMF_DUMP_MAPPED_PRIVATE 4 #define MMF_DUMP_MAPPED_SHARED 5 +#define MMF_DUMP_ELF_HEADERS 6 #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS -#define MMF_DUMP_FILTER_BITS 4 +#define MMF_DUMP_FILTER_BITS 5 #define MMF_DUMP_FILTER_MASK \ (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) #define MMF_DUMP_FILTER_DEFAULT \ @@ -515,8 +518,10 @@ struct user_struct { atomic_t inotify_watches; /* How many inotify watches does this user have? */ atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ #endif +#ifdef CONFIG_POSIX_MQUEUE /* protected by mq_lock */ unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */ +#endif unsigned long locked_shm; /* How many pages of mlocked shm ? */ #ifdef CONFIG_KEYS @@ -913,6 +918,16 @@ struct task_struct { #endif unsigned short ioprio; + /* + * fpu_counter contains the number of consecutive context switches + * that the FPU is used. If this is over a threshold, the lazy fpu + * saving becomes unlazy to save the trap. This is an unsigned char + * so that after 256 times the counter wraps and the behavior turns + * lazy again; this to deal with bursty apps that only use FPU for + * a short time + */ + unsigned char fpu_counter; + s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ #ifdef CONFIG_BLK_DEV_IO_TRACE unsigned int btrace_seq; #endif @@ -998,16 +1013,6 @@ struct task_struct { struct key *thread_keyring; /* keyring private to this thread */ unsigned char jit_keyring; /* default keyring to attach requested keys to */ #endif - /* - * fpu_counter contains the number of consecutive context switches - * that the FPU is used. If this is over a threshold, the lazy fpu - * saving becomes unlazy to save the trap. This is an unsigned char - * so that after 256 times the counter wraps and the behavior turns - * lazy again; this to deal with bursty apps that only use FPU for - * a short time - */ - unsigned char fpu_counter; - int oomkilladj; /* OOM kill score adjustment (bit shift). */ char comm[TASK_COMM_LEN]; /* executable name excluding path - access with [gs]et_task_comm (which lock it with task_lock()) @@ -1039,8 +1044,9 @@ struct task_struct { int (*notifier)(void *priv); void *notifier_data; sigset_t *notifier_mask; - +#ifdef CONFIG_SECURITY void *security; +#endif struct audit_context *audit_context; seccomp_t seccomp; @@ -1129,13 +1135,14 @@ struct task_struct { int cpuset_mems_generation; int cpuset_mem_spread_rotor; #endif +#ifdef CONFIG_FUTEX struct robust_list_head __user *robust_list; #ifdef CONFIG_COMPAT struct compat_robust_list_head __user *compat_robust_list; #endif struct list_head pi_state_list; struct futex_pi_state *pi_state_cache; - +#endif atomic_t fs_excl; /* holding fs exclusive resources */ struct rcu_head rcu; @@ -1149,6 +1156,7 @@ struct task_struct { #ifdef CONFIG_FAULT_INJECTION int make_it_fail; #endif + struct prop_local_single dirties; }; /* 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 { extern struct screen_info screen_info; -#define ORIG_X (screen_info.orig_x) -#define ORIG_Y (screen_info.orig_y) -#define ORIG_VIDEO_MODE (screen_info.orig_video_mode) -#define ORIG_VIDEO_COLS (screen_info.orig_video_cols) -#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx) -#define ORIG_VIDEO_LINES (screen_info.orig_video_lines) -#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) -#define ORIG_VIDEO_POINTS (screen_info.orig_video_points) - #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ #define VIDEO_TYPE_CGA 0x11 /* CGA Display */ #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); extern int cap_bprm_secureexec(struct linux_binprm *bprm); extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); extern int cap_inode_removexattr(struct dentry *dentry, char *name); +extern int cap_inode_need_killpriv(struct dentry *dentry); +extern int cap_inode_killpriv(struct dentry *dentry); extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); extern void cap_task_reparent_to_init (struct task_struct *p); +extern int cap_task_kill(struct task_struct *p, struct siginfo *info, int sig, u32 secid); +extern int cap_task_setscheduler (struct task_struct *p, int policy, struct sched_param *lp); +extern int cap_task_setioprio (struct task_struct *p, int ioprio); +extern int cap_task_setnice (struct task_struct *p, int nice); extern int cap_syslog (int type); -extern int cap_vm_enough_memory (struct mm_struct *mm, long pages); +extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); struct msghdr; struct sk_buff; @@ -413,6 +419,18 @@ struct request_sock; * is specified by @buffer_size. @buffer may be NULL to request * the size of the buffer required. * Returns number of bytes used/required on success. + * @inode_need_killpriv: + * Called when an inode has been changed. + * @dentry is the dentry being changed. + * Return <0 on error to abort the inode change operation. + * Return 0 if inode_killpriv does not need to be called. + * Return >0 if inode_killpriv does need to be called. + * @inode_killpriv: + * The setuid bit is being removed. Remove similar security labels. + * Called with the dentry->d_inode->i_mutex held. + * @dentry is the dentry being changed. + * Return 0 on success. If error is returned, then the operation + * causing setuid bit removal is failed. * * Security hooks for file operations * @@ -1140,10 +1158,6 @@ struct request_sock; * allow module stacking. * @name contains the name of the security module being stacked. * @ops contains a pointer to the struct security_operations of the module to stack. - * @unregister_security: - * remove a stacked module. - * @name contains the name of the security module being unstacked. - * @ops contains a pointer to the struct security_operations of the module to unstack. * * @secid_to_secctx: * Convert secid to security context. @@ -1239,7 +1253,8 @@ struct security_operations { int (*inode_getxattr) (struct dentry *dentry, char *name); int (*inode_listxattr) (struct dentry *dentry); int (*inode_removexattr) (struct dentry *dentry, char *name); - const char *(*inode_xattr_getsuffix) (void); + int (*inode_need_killpriv) (struct dentry *dentry); + int (*inode_killpriv) (struct dentry *dentry); int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); @@ -1330,8 +1345,6 @@ struct security_operations { /* allow module stacking */ int (*register_security) (const char *name, struct security_operations *ops); - int (*unregister_security) (const char *name, - struct security_operations *ops); void (*d_instantiate) (struct dentry *dentry, struct inode *inode); @@ -1409,748 +1422,10 @@ struct security_operations { }; -/* global variables */ -extern struct security_operations *security_ops; - -/* inline stuff */ -static inline int security_ptrace (struct task_struct * parent, struct task_struct * child) -{ - return security_ops->ptrace (parent, child); -} - -static inline int security_capget (struct task_struct *target, - kernel_cap_t *effective, - kernel_cap_t *inheritable, - kernel_cap_t *permitted) -{ - return security_ops->capget (target, effective, inheritable, permitted); -} - -static inline int security_capset_check (struct task_struct *target, - kernel_cap_t *effective, - kernel_cap_t *inheritable, - kernel_cap_t *permitted) -{ - return security_ops->capset_check (target, effective, inheritable, permitted); -} - -static inline void security_capset_set (struct task_struct *target, - kernel_cap_t *effective, - kernel_cap_t *inheritable, - kernel_cap_t *permitted) -{ - security_ops->capset_set (target, effective, inheritable, permitted); -} - -static inline int security_capable(struct task_struct *tsk, int cap) -{ - return security_ops->capable(tsk, cap); -} - -static inline int security_acct (struct file *file) -{ - return security_ops->acct (file); -} - -static inline int security_sysctl(struct ctl_table *table, int op) -{ - return security_ops->sysctl(table, op); -} - -static inline int security_quotactl (int cmds, int type, int id, - struct super_block *sb) -{ - return security_ops->quotactl (cmds, type, id, sb); -} - -static inline int security_quota_on (struct dentry * dentry) -{ - return security_ops->quota_on (dentry); -} - -static inline int security_syslog(int type) -{ - return security_ops->syslog(type); -} - -static inline int security_settime(struct timespec *ts, struct timezone *tz) -{ - return security_ops->settime(ts, tz); -} - -static inline int security_vm_enough_memory(long pages) -{ - return security_ops->vm_enough_memory(current->mm, pages); -} - -static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) -{ - return security_ops->vm_enough_memory(mm, pages); -} - -static inline int security_bprm_alloc (struct linux_binprm *bprm) -{ - return security_ops->bprm_alloc_security (bprm); -} -static inline void security_bprm_free (struct linux_binprm *bprm) -{ - security_ops->bprm_free_security (bprm); -} -static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) -{ - security_ops->bprm_apply_creds (bprm, unsafe); -} -static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm) -{ - security_ops->bprm_post_apply_creds (bprm); -} -static inline int security_bprm_set (struct linux_binprm *bprm) -{ - return security_ops->bprm_set_security (bprm); -} - -static inline int security_bprm_check (struct linux_binprm *bprm) -{ - return security_ops->bprm_check_security (bprm); -} - -static inline int security_bprm_secureexec (struct linux_binprm *bprm) -{ - return security_ops->bprm_secureexec (bprm); -} - -static inline int security_sb_alloc (struct super_block *sb) -{ - return security_ops->sb_alloc_security (sb); -} - -static inline void security_sb_free (struct super_block *sb) -{ - security_ops->sb_free_security (sb); -} - -static inline int security_sb_copy_data (struct file_system_type *type, - void *orig, void *copy) -{ - return security_ops->sb_copy_data (type, orig, copy); -} - -static inline int security_sb_kern_mount (struct super_block *sb, void *data) -{ - return security_ops->sb_kern_mount (sb, data); -} - -static inline int security_sb_statfs (struct dentry *dentry) -{ - return security_ops->sb_statfs (dentry); -} - -static inline int security_sb_mount (char *dev_name, struct nameidata *nd, - char *type, unsigned long flags, - void *data) -{ - return security_ops->sb_mount (dev_name, nd, type, flags, data); -} - -static inline int security_sb_check_sb (struct vfsmount *mnt, - struct nameidata *nd) -{ - return security_ops->sb_check_sb (mnt, nd); -} - -static inline int security_sb_umount (struct vfsmount *mnt, int flags) -{ - return security_ops->sb_umount (mnt, flags); -} - -static inline void security_sb_umount_close (struct vfsmount *mnt) -{ - security_ops->sb_umount_close (mnt); -} - -static inline void security_sb_umount_busy (struct vfsmount *mnt) -{ - security_ops->sb_umount_busy (mnt); -} - -static inline void security_sb_post_remount (struct vfsmount *mnt, - unsigned long flags, void *data) -{ - security_ops->sb_post_remount (mnt, flags, data); -} - -static inline void security_sb_post_mountroot (void) -{ - security_ops->sb_post_mountroot (); -} - -static inline void security_sb_post_addmount (struct vfsmount *mnt, - struct nameidata *mountpoint_nd) -{ - security_ops->sb_post_addmount (mnt, mountpoint_nd); -} - -static inline int security_sb_pivotroot (struct nameidata *old_nd, - struct nameidata *new_nd) -{ - return security_ops->sb_pivotroot (old_nd, new_nd); -} - -static inline void security_sb_post_pivotroot (struct nameidata *old_nd, - struct nameidata *new_nd) -{ - security_ops->sb_post_pivotroot (old_nd, new_nd); -} - -static inline int security_inode_alloc (struct inode *inode) -{ - inode->i_security = NULL; - return security_ops->inode_alloc_security (inode); -} - -static inline void security_inode_free (struct inode *inode) -{ - security_ops->inode_free_security (inode); -} - -static inline int security_inode_init_security (struct inode *inode, - struct inode *dir, - char **name, - void **value, - size_t *len) -{ - if (unlikely (IS_PRIVATE (inode))) - return -EOPNOTSUPP; - return security_ops->inode_init_security (inode, dir, name, value, len); -} - -static inline int security_inode_create (struct inode *dir, - struct dentry *dentry, - int mode) -{ - if (unlikely (IS_PRIVATE (dir))) - return 0; - return security_ops->inode_create (dir, dentry, mode); -} - -static inline int security_inode_link (struct dentry *old_dentry, - struct inode *dir, - struct dentry *new_dentry) -{ - if (unlikely (IS_PRIVATE (old_dentry->d_inode))) - return 0; - return security_ops->inode_link (old_dentry, dir, new_dentry); -} - -static inline int security_inode_unlink (struct inode *dir, - struct dentry *dentry) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_unlink (dir, dentry); -} - -static inline int security_inode_symlink (struct inode *dir, - struct dentry *dentry, - const char *old_name) -{ - if (unlikely (IS_PRIVATE (dir))) - return 0; - return security_ops->inode_symlink (dir, dentry, old_name); -} - -static inline int security_inode_mkdir (struct inode *dir, - struct dentry *dentry, - int mode) -{ - if (unlikely (IS_PRIVATE (dir))) - return 0; - return security_ops->inode_mkdir (dir, dentry, mode); -} - -static inline int security_inode_rmdir (struct inode *dir, - struct dentry *dentry) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_rmdir (dir, dentry); -} - -static inline int security_inode_mknod (struct inode *dir, - struct dentry *dentry, - int mode, dev_t dev) -{ - if (unlikely (IS_PRIVATE (dir))) - return 0; - return security_ops->inode_mknod (dir, dentry, mode, dev); -} - -static inline int security_inode_rename (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry) -{ - if (unlikely (IS_PRIVATE (old_dentry->d_inode) || - (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode)))) - return 0; - return security_ops->inode_rename (old_dir, old_dentry, - new_dir, new_dentry); -} - -static inline int security_inode_readlink (struct dentry *dentry) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_readlink (dentry); -} - -static inline int security_inode_follow_link (struct dentry *dentry, - struct nameidata *nd) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_follow_link (dentry, nd); -} - -static inline int security_inode_permission (struct inode *inode, int mask, - struct nameidata *nd) -{ - if (unlikely (IS_PRIVATE (inode))) - return 0; - return security_ops->inode_permission (inode, mask, nd); -} - -static inline int security_inode_setattr (struct dentry *dentry, - struct iattr *attr) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_setattr (dentry, attr); -} - -static inline int security_inode_getattr (struct vfsmount *mnt, - struct dentry *dentry) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_getattr (mnt, dentry); -} - -static inline void security_inode_delete (struct inode *inode) -{ - if (unlikely (IS_PRIVATE (inode))) - return; - security_ops->inode_delete (inode); -} - -static inline int security_inode_setxattr (struct dentry *dentry, char *name, - void *value, size_t size, int flags) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_setxattr (dentry, name, value, size, flags); -} - -static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, - void *value, size_t size, int flags) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return; - security_ops->inode_post_setxattr (dentry, name, value, size, flags); -} - -static inline int security_inode_getxattr (struct dentry *dentry, char *name) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_getxattr (dentry, name); -} - -static inline int security_inode_listxattr (struct dentry *dentry) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_listxattr (dentry); -} - -static inline int security_inode_removexattr (struct dentry *dentry, char *name) -{ - if (unlikely (IS_PRIVATE (dentry->d_inode))) - return 0; - return security_ops->inode_removexattr (dentry, name); -} - -static inline const char *security_inode_xattr_getsuffix(void) -{ - return security_ops->inode_xattr_getsuffix(); -} - -static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) -{ - if (unlikely (IS_PRIVATE (inode))) - return 0; - return security_ops->inode_getsecurity(inode, name, buffer, size, err); -} - -static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) -{ - if (unlikely (IS_PRIVATE (inode))) - return 0; - return security_ops->inode_setsecurity(inode, name, value, size, flags); -} - -static inline int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size) -{ - if (unlikely (IS_PRIVATE (inode))) - return 0; - return security_ops->inode_listsecurity(inode, buffer, buffer_size); -} - -static inline int security_file_permission (struct file *file, int mask) -{ - return security_ops->file_permission (file, mask); -} - -static inline int security_file_alloc (struct file *file) -{ - return security_ops->file_alloc_security (file); -} - -static inline void security_file_free (struct file *file) -{ - security_ops->file_free_security (file); -} - -static inline int security_file_ioctl (struct file *file, unsigned int cmd, - unsigned long arg) -{ - return security_ops->file_ioctl (file, cmd, arg); -} - -static inline int security_file_mmap (struct file *file, unsigned long reqprot, - unsigned long prot, - unsigned long flags, - unsigned long addr, - unsigned long addr_only) -{ - return security_ops->file_mmap (file, reqprot, prot, flags, addr, - addr_only); -} - -static inline int security_file_mprotect (struct vm_area_struct *vma, - unsigned long reqprot, - unsigned long prot) -{ - return security_ops->file_mprotect (vma, reqprot, prot); -} - -static inline int security_file_lock (struct file *file, unsigned int cmd) -{ - return security_ops->file_lock (file, cmd); -} - -static inline int security_file_fcntl (struct file *file, unsigned int cmd, - unsigned long arg) -{ - return security_ops->file_fcntl (file, cmd, arg); -} - -static inline int security_file_set_fowner (struct file *file) -{ - return security_ops->file_set_fowner (file); -} - -static inline int security_file_send_sigiotask (struct task_struct *tsk, - struct fown_struct *fown, - int sig) -{ - return security_ops->file_send_sigiotask (tsk, fown, sig); -} - -static inline int security_file_receive (struct file *file) -{ - return security_ops->file_receive (file); -} - -static inline int security_dentry_open (struct file *file) -{ - return security_ops->dentry_open (file); -} - -static inline int security_task_create (unsigned long clone_flags) -{ - return security_ops->task_create (clone_flags); -} - -static inline int security_task_alloc (struct task_struct *p) -{ - return security_ops->task_alloc_security (p); -} - -static inline void security_task_free (struct task_struct *p) -{ - security_ops->task_free_security (p); -} - -static inline int security_task_setuid (uid_t id0, uid_t id1, uid_t id2, - int flags) -{ - return security_ops->task_setuid (id0, id1, id2, flags); -} - -static inline int security_task_post_setuid (uid_t old_ruid, uid_t old_euid, - uid_t old_suid, int flags) -{ - return security_ops->task_post_setuid (old_ruid, old_euid, old_suid, flags); -} - -static inline int security_task_setgid (gid_t id0, gid_t id1, gid_t id2, - int flags) -{ - return security_ops->task_setgid (id0, id1, id2, flags); -} - -static inline int security_task_setpgid (struct task_struct *p, pid_t pgid) -{ - return security_ops->task_setpgid (p, pgid); -} - -static inline int security_task_getpgid (struct task_struct *p) -{ - return security_ops->task_getpgid (p); -} - -static inline int security_task_getsid (struct task_struct *p) -{ - return security_ops->task_getsid (p); -} - -static inline void security_task_getsecid (struct task_struct *p, u32 *secid) -{ - security_ops->task_getsecid (p, secid); -} - -static inline int security_task_setgroups (struct group_info *group_info) -{ - return security_ops->task_setgroups (group_info); -} - -static inline int security_task_setnice (struct task_struct *p, int nice) -{ - return security_ops->task_setnice (p, nice); -} - -static inline int security_task_setioprio (struct task_struct *p, int ioprio) -{ - return security_ops->task_setioprio (p, ioprio); -} - -static inline int security_task_getioprio (struct task_struct *p) -{ - return security_ops->task_getioprio (p); -} - -static inline int security_task_setrlimit (unsigned int resource, - struct rlimit *new_rlim) -{ - return security_ops->task_setrlimit (resource, new_rlim); -} - -static inline int security_task_setscheduler (struct task_struct *p, - int policy, - struct sched_param *lp) -{ - return security_ops->task_setscheduler (p, policy, lp); -} - -static inline int security_task_getscheduler (struct task_struct *p) -{ - return security_ops->task_getscheduler (p); -} - -static inline int security_task_movememory (struct task_struct *p) -{ - return security_ops->task_movememory (p); -} - -static inline int security_task_kill (struct task_struct *p, - struct siginfo *info, int sig, - u32 secid) -{ - return security_ops->task_kill (p, info, sig, secid); -} - -static inline int security_task_wait (struct task_struct *p) -{ - return security_ops->task_wait (p); -} - -static inline int security_task_prctl (int option, unsigned long arg2, - unsigned long arg3, - unsigned long arg4, - unsigned long arg5) -{ - return security_ops->task_prctl (option, arg2, arg3, arg4, arg5); -} - -static inline void security_task_reparent_to_init (struct task_struct *p) -{ - security_ops->task_reparent_to_init (p); -} - -static inline void security_task_to_inode(struct task_struct *p, struct inode *inode) -{ - security_ops->task_to_inode(p, inode); -} - -static inline int security_ipc_permission (struct kern_ipc_perm *ipcp, - short flag) -{ - return security_ops->ipc_permission (ipcp, flag); -} - -static inline int security_msg_msg_alloc (struct msg_msg * msg) -{ - return security_ops->msg_msg_alloc_security (msg); -} - -static inline void security_msg_msg_free (struct msg_msg * msg) -{ - security_ops->msg_msg_free_security(msg); -} - -static inline int security_msg_queue_alloc (struct msg_queue *msq) -{ - return security_ops->msg_queue_alloc_security (msq); -} - -static inline void security_msg_queue_free (struct msg_queue *msq) -{ - security_ops->msg_queue_free_security (msq); -} - -static inline int security_msg_queue_associate (struct msg_queue * msq, - int msqflg) -{ - return security_ops->msg_queue_associate (msq, msqflg); -} - -static inline int security_msg_queue_msgctl (struct msg_queue * msq, int cmd) -{ - return security_ops->msg_queue_msgctl (msq, cmd); -} - -static inline int security_msg_queue_msgsnd (struct msg_queue * msq, - struct msg_msg * msg, int msqflg) -{ - return security_ops->msg_queue_msgsnd (msq, msg, msqflg); -} - -static inline int security_msg_queue_msgrcv (struct msg_queue * msq, - struct msg_msg * msg, - struct task_struct * target, - long type, int mode) -{ - return security_ops->msg_queue_msgrcv (msq, msg, target, type, mode); -} - -static inline int security_shm_alloc (struct shmid_kernel *shp) -{ - return security_ops->shm_alloc_security (shp); -} - -static inline void security_shm_free (struct shmid_kernel *shp) -{ - security_ops->shm_free_security (shp); -} - -static inline int security_shm_associate (struct shmid_kernel * shp, - int shmflg) -{ - return security_ops->shm_associate(shp, shmflg); -} - -static inline int security_shm_shmctl (struct shmid_kernel * shp, int cmd) -{ - return security_ops->shm_shmctl (shp, cmd); -} - -static inline int security_shm_shmat (struct shmid_kernel * shp, - char __user *shmaddr, int shmflg) -{ - return security_ops->shm_shmat(shp, shmaddr, shmflg); -} - -static inline int security_sem_alloc (struct sem_array *sma) -{ - return security_ops->sem_alloc_security (sma); -} - -static inline void security_sem_free (struct sem_array *sma) -{ - security_ops->sem_free_security (sma); -} - -static inline int security_sem_associate (struct sem_array * sma, int semflg) -{ - return security_ops->sem_associate (sma, semflg); -} - -static inline int security_sem_semctl (struct sem_array * sma, int cmd) -{ - return security_ops->sem_semctl(sma, cmd); -} - -static inline int security_sem_semop (struct sem_array * sma, - struct sembuf * sops, unsigned nsops, - int alter) -{ - return security_ops->sem_semop(sma, sops, nsops, alter); -} - -static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) -{ - if (unlikely (inode && IS_PRIVATE (inode))) - return; - security_ops->d_instantiate (dentry, inode); -} - -static inline int security_getprocattr(struct task_struct *p, char *name, char **value) -{ - return security_ops->getprocattr(p, name, value); -} - -static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) -{ - return security_ops->setprocattr(p, name, value, size); -} - -static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb) -{ - return security_ops->netlink_send(sk, skb); -} - -static inline int security_netlink_recv(struct sk_buff * skb, int cap) -{ - return security_ops->netlink_recv(skb, cap); -} - -static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) -{ - return security_ops->secid_to_secctx(secid, secdata, seclen); -} - -static inline void security_release_secctx(char *secdata, u32 seclen) -{ - return security_ops->release_secctx(secdata, seclen); -} - /* prototypes */ extern int security_init (void); extern int register_security (struct security_operations *ops); -extern int unregister_security (struct security_operations *ops); extern int mod_reg_security (const char *name, struct security_operations *ops); -extern int mod_unreg_security (const char *name, struct security_operations *ops); extern struct dentry *securityfs_create_file(const char *name, mode_t mode, struct dentry *parent, void *data, const struct file_operations *fops); @@ -2158,6 +1433,158 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par extern void securityfs_remove(struct dentry *dentry); +/* Security operations */ +int security_ptrace(struct task_struct *parent, struct task_struct *child); +int security_capget(struct task_struct *target, + kernel_cap_t *effective, + kernel_cap_t *inheritable, + kernel_cap_t *permitted); +int security_capset_check(struct task_struct *target, + kernel_cap_t *effective, + kernel_cap_t *inheritable, + kernel_cap_t *permitted); +void security_capset_set(struct task_struct *target, + kernel_cap_t *effective, + kernel_cap_t *inheritable, + kernel_cap_t *permitted); +int security_capable(struct task_struct *tsk, int cap); +int security_acct(struct file *file); +int security_sysctl(struct ctl_table *table, int op); +int security_quotactl(int cmds, int type, int id, struct super_block *sb); +int security_quota_on(struct dentry *dentry); +int security_syslog(int type); +int security_settime(struct timespec *ts, struct timezone *tz); +int security_vm_enough_memory(long pages); +int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); +int security_bprm_alloc(struct linux_binprm *bprm); +void security_bprm_free(struct linux_binprm *bprm); +void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); +void security_bprm_post_apply_creds(struct linux_binprm *bprm); +int security_bprm_set(struct linux_binprm *bprm); +int security_bprm_check(struct linux_binprm *bprm); +int security_bprm_secureexec(struct linux_binprm *bprm); +int security_sb_alloc(struct super_block *sb); +void security_sb_free(struct super_block *sb); +int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy); +int security_sb_kern_mount(struct super_block *sb, void *data); +int security_sb_statfs(struct dentry *dentry); +int security_sb_mount(char *dev_name, struct nameidata *nd, + char *type, unsigned long flags, void *data); +int security_sb_check_sb(struct vfsmount *mnt, struct nameidata *nd); +int security_sb_umount(struct vfsmount *mnt, int flags); +void security_sb_umount_close(struct vfsmount *mnt); +void security_sb_umount_busy(struct vfsmount *mnt); +void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data); +void security_sb_post_mountroot(void); +void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd); +int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); +void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); +int security_inode_alloc(struct inode *inode); +void security_inode_free(struct inode *inode); +int security_inode_init_security(struct inode *inode, struct inode *dir, + char **name, void **value, size_t *len); +int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); +int security_inode_link(struct dentry *old_dentry, struct inode *dir, + struct dentry *new_dentry); +int security_inode_unlink(struct inode *dir, struct dentry *dentry); +int security_inode_symlink(struct inode *dir, struct dentry *dentry, + const char *old_name); +int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode); +int security_inode_rmdir(struct inode *dir, struct dentry *dentry); +int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev); +int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry); +int security_inode_readlink(struct dentry *dentry); +int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); +int security_inode_permission(struct inode *inode, int mask, struct nameidata *nd); +int security_inode_setattr(struct dentry *dentry, struct iattr *attr); +int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); +void security_inode_delete(struct inode *inode); +int security_inode_setxattr(struct dentry *dentry, char *name, + void *value, size_t size, int flags); +void security_inode_post_setxattr(struct dentry *dentry, char *name, + void *value, size_t size, int flags); +int security_inode_getxattr(struct dentry *dentry, char *name); +int security_inode_listxattr(struct dentry *dentry); +int security_inode_removexattr(struct dentry *dentry, char *name); +int security_inode_need_killpriv(struct dentry *dentry); +int security_inode_killpriv(struct dentry *dentry); +int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err); +int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); +int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); +int security_file_permission(struct file *file, int mask); +int security_file_alloc(struct file *file); +void security_file_free(struct file *file); +int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg); +int security_file_mmap(struct file *file, unsigned long reqprot, + unsigned long prot, unsigned long flags, + unsigned long addr, unsigned long addr_only); +int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, + unsigned long prot); +int security_file_lock(struct file *file, unsigned int cmd); +int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg); +int security_file_set_fowner(struct file *file); +int security_file_send_sigiotask(struct task_struct *tsk, + struct fown_struct *fown, int sig); +int security_file_receive(struct file *file); +int security_dentry_open(struct file *file); +int security_task_create(unsigned long clone_flags); +int security_task_alloc(struct task_struct *p); +void security_task_free(struct task_struct *p); +int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); +int security_task_post_setuid(uid_t old_ruid, uid_t old_euid, + uid_t old_suid, int flags); +int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags); +int security_task_setpgid(struct task_struct *p, pid_t pgid); +int security_task_getpgid(struct task_struct *p); +int security_task_getsid(struct task_struct *p); +void security_task_getsecid(struct task_struct *p, u32 *secid); +int security_task_setgroups(struct group_info *group_info); +int security_task_setnice(struct task_struct *p, int nice); +int security_task_setioprio(struct task_struct *p, int ioprio); +int security_task_getioprio(struct task_struct *p); +int security_task_setrlimit(unsigned int resource, struct rlimit *new_rlim); +int security_task_setscheduler(struct task_struct *p, + int policy, struct sched_param *lp); +int security_task_getscheduler(struct task_struct *p); +int security_task_movememory(struct task_struct *p); +int security_task_kill(struct task_struct *p, struct siginfo *info, + int sig, u32 secid); +int security_task_wait(struct task_struct *p); +int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5); +void security_task_reparent_to_init(struct task_struct *p); +void security_task_to_inode(struct task_struct *p, struct inode *inode); +int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag); +int security_msg_msg_alloc(struct msg_msg *msg); +void security_msg_msg_free(struct msg_msg *msg); +int security_msg_queue_alloc(struct msg_queue *msq); +void security_msg_queue_free(struct msg_queue *msq); +int security_msg_queue_associate(struct msg_queue *msq, int msqflg); +int security_msg_queue_msgctl(struct msg_queue *msq, int cmd); +int security_msg_queue_msgsnd(struct msg_queue *msq, + struct msg_msg *msg, int msqflg); +int security_msg_queue_msgrcv(struct msg_queue *msq, struct msg_msg *msg, + struct task_struct *target, long type, int mode); +int security_shm_alloc(struct shmid_kernel *shp); +void security_shm_free(struct shmid_kernel *shp); +int security_shm_associate(struct shmid_kernel *shp, int shmflg); +int security_shm_shmctl(struct shmid_kernel *shp, int cmd); +int security_shm_shmat(struct shmid_kernel *shp, char __user *shmaddr, int shmflg); +int security_sem_alloc(struct sem_array *sma); +void security_sem_free(struct sem_array *sma); +int security_sem_associate(struct sem_array *sma, int semflg); +int security_sem_semctl(struct sem_array *sma, int cmd); +int security_sem_semop(struct sem_array *sma, struct sembuf *sops, + unsigned nsops, int alter); +void security_d_instantiate (struct dentry *dentry, struct inode *inode); +int security_getprocattr(struct task_struct *p, char *name, char **value); +int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); +int security_netlink_send(struct sock *sk, struct sk_buff *skb); +int security_netlink_recv(struct sk_buff *skb, int cap); +int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); +void security_release_secctx(char *secdata, u32 seclen); + #else /* CONFIG_SECURITY */ /* @@ -2476,9 +1903,14 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name) return cap_inode_removexattr(dentry, name); } -static inline const char *security_inode_xattr_getsuffix (void) +static inline int security_inode_need_killpriv(struct dentry *dentry) { - return NULL ; + return cap_inode_need_killpriv(dentry); +} + +static inline int security_inode_killpriv(struct dentry *dentry) +{ + return cap_inode_killpriv(dentry); } static 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) static inline int security_task_setnice (struct task_struct *p, int nice) { - return 0; + return cap_task_setnice(p, nice); } static inline int security_task_setioprio (struct task_struct *p, int ioprio) { - return 0; + return cap_task_setioprio(p, ioprio); } static inline int security_task_getioprio (struct task_struct *p) @@ -2643,7 +2075,7 @@ static inline int security_task_setscheduler (struct task_struct *p, int policy, struct sched_param *lp) { - return 0; + return cap_task_setscheduler(p, policy, lp); } static inline int security_task_getscheduler (struct task_struct *p) @@ -2660,7 +2092,7 @@ static inline int security_task_kill (struct task_struct *p, struct siginfo *info, int sig, u32 secid) { - return 0; + return cap_task_kill(p, info, sig, secid); } static inline int security_task_wait (struct task_struct *p) @@ -2834,170 +2266,43 @@ static inline void security_release_secctx(char *secdata, u32 seclen) #endif /* CONFIG_SECURITY */ #ifdef CONFIG_SECURITY_NETWORK -static inline int security_unix_stream_connect(struct socket * sock, - struct socket * other, - struct sock * newsk) -{ - return security_ops->unix_stream_connect(sock, other, newsk); -} +int security_unix_stream_connect(struct socket *sock, struct socket *other, + struct sock *newsk); +int security_unix_may_send(struct socket *sock, struct socket *other); +int security_socket_create(int family, int type, int protocol, int kern); +int security_socket_post_create(struct socket *sock, int family, + int type, int protocol, int kern); +int security_socket_bind(struct socket *sock, struct sockaddr *address, int addrlen); +int security_socket_connect(struct socket *sock, struct sockaddr *address, int addrlen); +int security_socket_listen(struct socket *sock, int backlog); +int security_socket_accept(struct socket *sock, struct socket *newsock); +void security_socket_post_accept(struct socket *sock, struct socket *newsock); +int security_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size); +int security_socket_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags); +int security_socket_getsockname(struct socket *sock); +int security_socket_getpeername(struct socket *sock); +int security_socket_getsockopt(struct socket *sock, int level, int optname); +int security_socket_setsockopt(struct socket *sock, int level, int optname); +int security_socket_shutdown(struct socket *sock, int how); +int security_sock_rcv_skb(struct sock *sk, struct sk_buff *skb); +int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, + int __user *optlen, unsigned len); +int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid); +int security_sk_alloc(struct sock *sk, int family, gfp_t priority); +void security_sk_free(struct sock *sk); +void security_sk_clone(const struct sock *sk, struct sock *newsk); +void security_sk_classify_flow(struct sock *sk, struct flowi *fl); +void security_req_classify_flow(const struct request_sock *req, struct flowi *fl); +void security_sock_graft(struct sock*sk, struct socket *parent); +int security_inet_conn_request(struct sock *sk, + struct sk_buff *skb, struct request_sock *req); +void security_inet_csk_clone(struct sock *newsk, + const struct request_sock *req); +void security_inet_conn_established(struct sock *sk, + struct sk_buff *skb); -static inline int security_unix_may_send(struct socket * sock, - struct socket * other) -{ - return security_ops->unix_may_send(sock, other); -} - -static inline int security_socket_create (int family, int type, - int protocol, int kern) -{ - return security_ops->socket_create(family, type, protocol, kern); -} - -static inline int security_socket_post_create(struct socket * sock, - int family, - int type, - int protocol, int kern) -{ - return security_ops->socket_post_create(sock, family, type, - protocol, kern); -} - -static inline int security_socket_bind(struct socket * sock, - struct sockaddr * address, - int addrlen) -{ - return security_ops->socket_bind(sock, address, addrlen); -} - -static inline int security_socket_connect(struct socket * sock, - struct sockaddr * address, - int addrlen) -{ - return security_ops->socket_connect(sock, address, addrlen); -} - -static inline int security_socket_listen(struct socket * sock, int backlog) -{ - return security_ops->socket_listen(sock, backlog); -} - -static inline int security_socket_accept(struct socket * sock, - struct socket * newsock) -{ - return security_ops->socket_accept(sock, newsock); -} - -static inline void security_socket_post_accept(struct socket * sock, - struct socket * newsock) -{ - security_ops->socket_post_accept(sock, newsock); -} - -static inline int security_socket_sendmsg(struct socket * sock, - struct msghdr * msg, int size) -{ - return security_ops->socket_sendmsg(sock, msg, size); -} - -static inline int security_socket_recvmsg(struct socket * sock, - struct msghdr * msg, int size, - int flags) -{ - return security_ops->socket_recvmsg(sock, msg, size, flags); -} - -static inline int security_socket_getsockname(struct socket * sock) -{ - return security_ops->socket_getsockname(sock); -} - -static inline int security_socket_getpeername(struct socket * sock) -{ - return security_ops->socket_getpeername(sock); -} - -static inline int security_socket_getsockopt(struct socket * sock, - int level, int optname) -{ - return security_ops->socket_getsockopt(sock, level, optname); -} - -static inline int security_socket_setsockopt(struct socket * sock, - int level, int optname) -{ - return security_ops->socket_setsockopt(sock, level, optname); -} - -static inline int security_socket_shutdown(struct socket * sock, int how) -{ - return security_ops->socket_shutdown(sock, how); -} - -static inline int security_sock_rcv_skb (struct sock * sk, - struct sk_buff * skb) -{ - return security_ops->socket_sock_rcv_skb (sk, skb); -} - -static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, - int __user *optlen, unsigned len) -{ - return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); -} - -static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid) -{ - return security_ops->socket_getpeersec_dgram(sock, skb, secid); -} - -static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) -{ - return security_ops->sk_alloc_security(sk, family, priority); -} - -static inline void security_sk_free(struct sock *sk) -{ - return security_ops->sk_free_security(sk); -} - -static inline void security_sk_clone(const struct sock *sk, struct sock *newsk) -{ - return security_ops->sk_clone_security(sk, newsk); -} - -static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl) -{ - security_ops->sk_getsecid(sk, &fl->secid); -} - -static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl) -{ - security_ops->req_classify_flow(req, fl); -} - -static inline void security_sock_graft(struct sock* sk, struct socket *parent) -{ - security_ops->sock_graft(sk, parent); -} - -static inline int security_inet_conn_request(struct sock *sk, - struct sk_buff *skb, struct request_sock *req) -{ - return security_ops->inet_conn_request(sk, skb, req); -} - -static inline void security_inet_csk_clone(struct sock *newsk, - const struct request_sock *req) -{ - security_ops->inet_csk_clone(newsk, req); -} - -static inline void security_inet_conn_established(struct sock *sk, - struct sk_buff *skb) -{ - security_ops->inet_conn_established(sk, skb); -} #else /* CONFIG_SECURITY_NETWORK */ static inline int security_unix_stream_connect(struct socket * sock, struct socket * other, @@ -3155,77 +2460,24 @@ static inline void security_inet_conn_established(struct sock *sk, #endif /* CONFIG_SECURITY_NETWORK */ #ifdef CONFIG_SECURITY_NETWORK_XFRM -static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) -{ - return security_ops->xfrm_policy_alloc_security(xp, sec_ctx); -} - -static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) -{ - return security_ops->xfrm_policy_clone_security(old, new); -} - -static inline void security_xfrm_policy_free(struct xfrm_policy *xp) -{ - security_ops->xfrm_policy_free_security(xp); -} - -static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) -{ - return security_ops->xfrm_policy_delete_security(xp); -} -static inline int security_xfrm_state_alloc(struct xfrm_state *x, - struct xfrm_user_sec_ctx *sec_ctx) -{ - return security_ops->xfrm_state_alloc_security(x, sec_ctx, 0); -} - -static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, - struct xfrm_sec_ctx *polsec, u32 secid) -{ - if (!polsec) - return 0; - /* - * We want the context to be taken from secid which is usually - * from the sock. - */ - return security_ops->xfrm_state_alloc_security(x, NULL, secid); -} - -static inline int security_xfrm_state_delete(struct xfrm_state *x) -{ - return security_ops->xfrm_state_delete_security(x); -} - -static inline void security_xfrm_state_free(struct xfrm_state *x) -{ - security_ops->xfrm_state_free_security(x); -} - -static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) -{ - return security_ops->xfrm_policy_lookup(xp, fl_secid, dir); -} - -static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x, - struct xfrm_policy *xp, struct flowi *fl) -{ - return security_ops->xfrm_state_pol_flow_match(x, xp, fl); -} +int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); +int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new); +void security_xfrm_policy_free(struct xfrm_policy *xp); +int security_xfrm_policy_delete(struct xfrm_policy *xp); +int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); +int security_xfrm_state_alloc_acquire(struct xfrm_state *x, + struct xfrm_sec_ctx *polsec, u32 secid); +int security_xfrm_state_delete(struct xfrm_state *x); +void security_xfrm_state_free(struct xfrm_state *x); +int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir); +int security_xfrm_state_pol_flow_match(struct xfrm_state *x, + struct xfrm_policy *xp, struct flowi *fl); +int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid); +void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl); -static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) -{ - return security_ops->xfrm_decode_session(skb, secid, 1); -} - -static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl) -{ - int rc = security_ops->xfrm_decode_session(skb, &fl->secid, 0); - - BUG_ON(rc); -} #else /* CONFIG_SECURITY_NETWORK_XFRM */ + static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) { return 0; @@ -3290,24 +2542,11 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi #ifdef CONFIG_KEYS #ifdef CONFIG_SECURITY -static inline int security_key_alloc(struct key *key, - struct task_struct *tsk, - unsigned long flags) -{ - return security_ops->key_alloc(key, tsk, flags); -} - -static inline void security_key_free(struct key *key) -{ - security_ops->key_free(key); -} -static inline int security_key_permission(key_ref_t key_ref, - struct task_struct *context, - key_perm_t perm) -{ - return security_ops->key_permission(key_ref, context, perm); -} +int security_key_alloc(struct key *key, struct task_struct *tsk, unsigned long flags); +void security_key_free(struct key *key); +int security_key_permission(key_ref_t key_ref, + struct task_struct *context, key_perm_t perm); #else 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 { size_t from; size_t count; loff_t index; - loff_t version; + u64 version; struct mutex lock; const struct seq_operations *op; 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 @@ #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ #define SHMSEG SHMMNI /* max shared segs per process */ +#ifdef __KERNEL__ #include <asm/shmparam.h> +#endif /* Obsolete, used only for backwards compatibility and libc5 compiles */ struct 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 @@ struct signalfd_siginfo { - __u32 signo; - __s32 err; - __s32 code; - __u32 pid; - __u32 uid; - __s32 fd; - __u32 tid; - __u32 band; - __u32 overrun; - __u32 trapno; - __s32 status; - __s32 svint; - __u64 svptr; - __u64 utime; - __u64 stime; - __u64 addr; + __u32 ssi_signo; + __s32 ssi_errno; + __s32 ssi_code; + __u32 ssi_pid; + __u32 ssi_uid; + __s32 ssi_fd; + __u32 ssi_tid; + __u32 ssi_band; + __u32 ssi_overrun; + __u32 ssi_trapno; + __s32 ssi_status; + __s32 ssi_int; + __u64 ssi_ptr; + __u64 ssi_utime; + __u64 ssi_stime; + __u64 ssi_addr; /* * 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); struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, unsigned long, - void (*)(void *, struct kmem_cache *, unsigned long)); + void (*)(struct kmem_cache *, void *)); void kmem_cache_destroy(struct kmem_cache *); int kmem_cache_shrink(struct kmem_cache *); void 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 { /* Allocation and freeing of slabs */ int objects; /* Number of objects in slab */ int refcount; /* Refcount for slab cache destroy */ - void (*ctor)(void *, struct kmem_cache *, unsigned long); + void (*ctor)(struct kmem_cache *, void *); int inuse; /* Offset to metadata */ int align; /* Alignment */ 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 { /* Swap 50% full? Release swapcache more aggressively.. */ #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) -/* linux/mm/oom_kill.c */ -extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); -extern int register_oom_notifier(struct notifier_block *nb); -extern int unregister_oom_notifier(struct notifier_block *nb); - /* linux/mm/memory.c */ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 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, extern struct timespec xtime; extern struct timespec wall_to_monotonic; -extern seqlock_t xtime_lock __attribute__((weak)); +extern seqlock_t xtime_lock; extern unsigned long read_persistent_clock(void); extern 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 { int memory_used; /* Buffer space used excluding free queue */ }; /* - * The pty uses char_buf and flag_buf as a contiguous buffer - */ -#define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE - -/* * When a break, frame error, or parity error happens, these codes are * stuffed into the flags buffer. */ @@ -321,6 +316,9 @@ extern void tty_flip_buffer_push(struct tty_struct *tty); extern speed_t tty_get_baud_rate(struct tty_struct *tty); extern speed_t tty_termios_baud_rate(struct ktermios *termios); extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); +extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud); +extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud); +extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); extern 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; typedef __u16 __bitwise __fs16; #endif -#ifdef __KERNEL__ -#include <linux/ufs_fs_i.h> -#include <linux/ufs_fs_sb.h> -#endif - #define UFS_BBLOCK 0 #define UFS_BBSIZE 8192 #define UFS_SBLOCK 8192 @@ -170,8 +165,9 @@ typedef __u16 __bitwise __fs16; #define UFS_ST_MASK 0x00000700 /* mask for the following */ #define UFS_ST_OLD 0x00000000 #define UFS_ST_44BSD 0x00000100 -#define UFS_ST_SUN 0x00000200 -#define UFS_ST_SUNx86 0x00000400 +#define UFS_ST_SUN 0x00000200 /* Solaris */ +#define UFS_ST_SUNOS 0x00000300 +#define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */ /*cylinder group encoding */ #define UFS_CG_MASK 0x00003000 /* mask for the following */ #define UFS_CG_OLD 0x00000000 @@ -187,28 +183,6 @@ typedef __u16 __bitwise __fs16; #define UFS_42INODEFMT -1 #define UFS_44INODEFMT 2 -/* mount options */ -#define UFS_MOUNT_ONERROR 0x0000000F -#define UFS_MOUNT_ONERROR_PANIC 0x00000001 -#define UFS_MOUNT_ONERROR_LOCK 0x00000002 -#define UFS_MOUNT_ONERROR_UMOUNT 0x00000004 -#define UFS_MOUNT_ONERROR_REPAIR 0x00000008 - -#define UFS_MOUNT_UFSTYPE 0x0000FFF0 -#define UFS_MOUNT_UFSTYPE_OLD 0x00000010 -#define UFS_MOUNT_UFSTYPE_44BSD 0x00000020 -#define UFS_MOUNT_UFSTYPE_SUN 0x00000040 -#define UFS_MOUNT_UFSTYPE_NEXTSTEP 0x00000080 -#define UFS_MOUNT_UFSTYPE_NEXTSTEP_CD 0x00000100 -#define UFS_MOUNT_UFSTYPE_OPENSTEP 0x00000200 -#define UFS_MOUNT_UFSTYPE_SUNx86 0x00000400 -#define UFS_MOUNT_UFSTYPE_HP 0x00000800 -#define UFS_MOUNT_UFSTYPE_UFS2 0x00001000 - -#define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt -#define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt -#define ufs_test_opt(o,opt) ((o) & UFS_MOUNT_##opt) - /* * MINFREE gives the minimum acceptable percentage of file system * blocks which may be free. If the freelist drops below this level @@ -223,19 +197,6 @@ typedef __u16 __bitwise __fs16; */ #define UFS_MINFREE 5 #define UFS_DEFAULTOPT UFS_OPTTIME - -/* - * Debug code - */ -#ifdef CONFIG_UFS_DEBUG -# define UFSD(f, a...) { \ - printk ("UFSD (%s, %d): %s:", \ - __FILE__, __LINE__, __FUNCTION__); \ - printk (f, ## a); \ - } -#else -# define UFSD(f, a...) /**/ -#endif /* * Turn file system block numbers into disk block addresses. @@ -374,7 +335,14 @@ struct ufs_csum_core { * struct ufs_super_block_(first,second,third) instead. */ struct ufs_super_block { - __fs32 fs_link; /* UNUSED */ + union { + struct { + __fs32 fs_link; /* UNUSED */ + } fs_42; + struct { + __fs32 fs_state; /* file system state flag */ + } fs_sun; + } fs_u0; __fs32 fs_rlink; /* UNUSED */ __fs32 fs_sblkno; /* addr of super-block in filesys */ __fs32 fs_cblkno; /* offset of cyl-block in filesys */ @@ -545,6 +513,15 @@ struct ufs_super_block { #define CG_MAGIC 0x090255 #define ufs_cg_chkmagic(sb, ucg) \ (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) +/* + * Macros for access to old cylinder group array structures + */ +#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot) +#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno]) +#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused) +#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free) +#define ufs_ocg_chkmagic(sb, ucg) \ + (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC) /* * size of this structure is 172 B @@ -590,6 +567,28 @@ struct ufs_cylinder_group { /* actually longer */ }; +/* Historic Cylinder group info */ +struct ufs_old_cylinder_group { + __fs32 cg_link; /* linked list of cyl groups */ + __fs32 cg_rlink; /* for incore cyl groups */ + __fs32 cg_time; /* time last written */ + __fs32 cg_cgx; /* we are the cgx'th cylinder group */ + __fs16 cg_ncyl; /* number of cyl's this cg */ + __fs16 cg_niblk; /* number of inode blocks this cg */ + __fs32 cg_ndblk; /* number of data blocks this cg */ + struct ufs_csum cg_cs; /* cylinder summary information */ + __fs32 cg_rotor; /* position of last used block */ + __fs32 cg_frotor; /* position of last used frag */ + __fs32 cg_irotor; /* position of last used inode */ + __fs32 cg_frsum[8]; /* counts of available frags */ + __fs32 cg_btot[32]; /* block totals per cylinder */ + __fs16 cg_b[32][8]; /* positions of free blocks */ + __u8 cg_iused[256]; /* used inode map */ + __fs32 cg_magic; /* magic number */ + __u8 cg_free[1]; /* free block map */ +/* actually longer */ +}; + /* * structure of an on-disk inode */ @@ -796,7 +795,14 @@ struct ufs_sb_private_info { * ufs_super_block_third 356 */ struct ufs_super_block_first { - __fs32 fs_link; + union { + struct { + __fs32 fs_link; /* UNUSED */ + } fs_42; + struct { + __fs32 fs_state; /* file system state flag */ + } fs_sun; + } fs_u0; __fs32 fs_rlink; __fs32 fs_sblkno; __fs32 fs_cblkno; @@ -944,89 +950,4 @@ struct ufs_super_block_third { __u8 fs_space[1]; }; -#ifdef __KERNEL__ - -/* balloc.c */ -extern void ufs_free_fragments (struct inode *, u64, unsigned); -extern void ufs_free_blocks (struct inode *, u64, unsigned); -extern u64 ufs_new_fragments(struct inode *, void *, u64, u64, - unsigned, int *, struct page *); - -/* cylinder.c */ -extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); -extern void ufs_put_cylinder (struct super_block *, unsigned); - -/* dir.c */ -extern const struct inode_operations ufs_dir_inode_operations; -extern int ufs_add_link (struct dentry *, struct inode *); -extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); -extern int ufs_make_empty(struct inode *, struct inode *); -extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **); -extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *); -extern int ufs_empty_dir (struct inode *); -extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **); -extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, - struct page *page, struct inode *inode); - -/* file.c */ -extern const struct inode_operations ufs_file_inode_operations; -extern const struct file_operations ufs_file_operations; - -extern const struct address_space_operations ufs_aops; - -/* ialloc.c */ -extern void ufs_free_inode (struct inode *inode); -extern struct inode * ufs_new_inode (struct inode *, int); - -/* inode.c */ -extern void ufs_read_inode (struct inode *); -extern void ufs_put_inode (struct inode *); -extern int ufs_write_inode (struct inode *, int); -extern int ufs_sync_inode (struct inode *); -extern void ufs_delete_inode (struct inode *); -extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); -extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); - -/* namei.c */ -extern const struct file_operations ufs_dir_operations; - -/* super.c */ -extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); -extern void ufs_error (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); -extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); - -/* symlink.c */ -extern const struct inode_operations ufs_fast_symlink_inode_operations; - -/* truncate.c */ -extern int ufs_truncate (struct inode *, loff_t); - -static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) -{ - return sb->s_fs_info; -} - -static inline struct ufs_inode_info *UFS_I(struct inode *inode) -{ - return container_of(inode, struct ufs_inode_info, vfs_inode); -} - -/* - * Give cylinder group number for a file system block. - * Give cylinder group block number for a file system block. - */ -/* #define ufs_dtog(d) ((d) / uspi->s_fpg) */ -static inline u64 ufs_dtog(struct ufs_sb_private_info * uspi, u64 b) -{ - do_div(b, uspi->s_fpg); - return b; -} -/* #define ufs_dtogd(d) ((d) % uspi->s_fpg) */ -static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b) -{ - return do_div(b, uspi->s_fpg); -} - -#endif /* __KERNEL__ */ - #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 @@ -/* - * linux/include/linux/ufs_fs_i.h - * - * Copyright (C) 1996 - * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu) - * Laboratory for Computer Science Research Computing Facility - * Rutgers, The State University of New Jersey - * - * NeXTstep support added on February 5th 1998 by - * Niels Kristian Bech Jensen <nkbj@image.dk>. - */ - -#ifndef _LINUX_UFS_FS_I_H -#define _LINUX_UFS_FS_I_H - -struct ufs_inode_info { - union { - __fs32 i_data[15]; - __u8 i_symlink[4*15]; - __fs64 u2_i_data[15]; - } i_u1; - __u32 i_flags; - __u32 i_shadow; - __u32 i_unused1; - __u32 i_unused2; - __u32 i_oeftflag; - __u16 i_osync; - __u64 i_lastfrag; - __u32 i_dir_start_lookup; - struct inode vfs_inode; -}; - -#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 @@ -/* - * linux/include/linux/ufs_fs_sb.h - * - * Copyright (C) 1996 - * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu) - * Laboratory for Computer Science Research Computing Facility - * Rutgers, The State University of New Jersey - * - * $Id: ufs_fs_sb.h,v 1.8 1998/05/06 12:04:40 jj Exp $ - * - * Write support by Daniel Pirkl <daniel.pirkl@email.cz> - */ - -#ifndef __LINUX_UFS_FS_SB_H -#define __LINUX_UFS_FS_SB_H - - -#define UFS_MAX_GROUP_LOADED 8 -#define UFS_CGNO_EMPTY ((unsigned)-1) - -struct ufs_sb_private_info; -struct ufs_cg_private_info; -struct ufs_csum; - -struct ufs_sb_info { - struct ufs_sb_private_info * s_uspi; - struct ufs_csum * s_csp; - unsigned s_bytesex; - unsigned s_flags; - struct buffer_head ** s_ucg; - struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED]; - unsigned s_cgno[UFS_MAX_GROUP_LOADED]; - unsigned short s_cg_loaded; - unsigned s_mount_opt; -}; - -#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, extern char con_buf[CON_BUF_SIZE]; extern struct mutex con_buf_mtx; extern char vt_dont_switch; +extern int default_utf8; struct vt_spawn_console { 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 { unsigned for_reclaim:1; /* Invoked from the page allocator */ unsigned for_writepages:1; /* This is a writepages() call */ unsigned range_cyclic:1; /* range_start is cyclic */ + unsigned more_io:1; /* more io to be dispatched */ }; /* * fs/fs-writeback.c */ void writeback_inodes(struct writeback_control *wbc); -void wake_up_inode(struct inode *inode); int inode_wait(void *); void sync_inodes_sb(struct super_block *, int wait); void sync_inodes(int wait); @@ -80,6 +80,13 @@ static inline void wait_on_inode(struct inode *inode) wait_on_bit(&inode->i_state, __I_LOCK, inode_wait, TASK_UNINTERRUPTIBLE); } +static inline void inode_sync_wait(struct inode *inode) +{ + might_sleep(); + wait_on_bit(&inode->i_state, __I_SYNC, inode_wait, + TASK_UNINTERRUPTIBLE); +} + /* * mm/page-writeback.c @@ -97,6 +104,10 @@ extern int dirty_expire_interval; extern int block_dump; extern int laptop_mode; +extern int dirty_ratio_handler(struct ctl_table *table, int write, + struct file *filp, void __user *buffer, size_t *lenp, + loff_t *ppos); + struct ctl_table; struct file; int 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 @@ -header-y += scsi.h - -unifdef-y += scsi_ioctl.h -unifdef-y += sg.h |