diff options
| author | Ben Collins <bcollins@debian.org> | 2004-01-23 00:17:15 -0500 |
|---|---|---|
| committer | Ben Collins <bcollins@debian.org> | 2004-01-23 00:17:15 -0500 |
| commit | 7a272c66115f213c86f101716ecfdc8acb8d7470 (patch) | |
| tree | 0bc2853e64a2d343dbefd95913ff0091f93b9eb3 /include | |
| parent | ddcb7c122488e3f2869d7fd9a76239ff98c92a1b (diff) | |
| parent | c8609416f38fb3d89ca554a4c436c71cbd398681 (diff) | |
Merge http://linux.bkbits.net/linux-2.5
into debian.org:/usr/src/kernel/linux-2.6
Diffstat (limited to 'include')
93 files changed, 432 insertions, 360 deletions
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h index a33553278825..df5aad88a5f2 100644 --- a/include/asm-alpha/elf.h +++ b/include/asm-alpha/elf.h @@ -122,27 +122,19 @@ extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task); instruction set this CPU supports. This is trivial on Alpha, but not so on other machines. */ -#define ELF_HWCAP \ -({ \ - /* Sadly, most folks don't yet have assemblers that know about \ - amask. This is "amask v0, v0" */ \ - register long _v0 __asm("$0") = -1; \ - __asm(".long 0x47e00c20" : "=r"(_v0) : "0"(_v0)); \ - ~_v0; \ -}) +#define ELF_HWCAP (~amask(-1)) /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in - intent than poking at uname or /proc/cpuinfo. - - This might do with checking bwx simultaneously... */ + intent than poking at uname or /proc/cpuinfo. */ #define ELF_PLATFORM \ ({ \ - /* Or "implver v0" ... */ \ - register long _v0 __asm("$0"); \ - __asm(".long 0x47e03d80" : "=r"(_v0)); \ - _v0 == 0 ? "ev4" : "ev5"; \ + enum implver_enum i_ = implver(); \ + ( i_ == IMPLVER_EV4 ? "ev4" \ + : i_ == IMPLVER_EV5 \ + ? (amask(AMASK_BWX) ? "ev5" : "ev56") \ + : amask (AMASK_CIX) ? "ev6" : "ev67"); \ }) #ifdef __KERNEL__ diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h index db527586c23f..41ab32c4f04f 100644 --- a/include/asm-alpha/floppy.h +++ b/include/asm-alpha/floppy.h @@ -13,7 +13,7 @@ #include <linux/config.h> #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_enable_dma() enable_dma(FLOPPY_DMA) #define fd_disable_dma() disable_dma(FLOPPY_DMA) diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index fe03e7309686..3c750a362c44 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h @@ -78,6 +78,11 @@ unsigned long get_wchan(struct task_struct *p); #define ARCH_HAS_PREFETCHW #define ARCH_HAS_SPINLOCK_PREFETCH +#ifndef CONFIG_SMP +/* Nothing to prefetch. */ +#define spin_lock_prefetch(lock) do { } while (0) +#endif + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) extern inline void prefetch(const void *ptr) { @@ -89,10 +94,13 @@ extern inline void prefetchw(const void *ptr) __builtin_prefetch(ptr, 1, 3); } +#ifdef CONFIG_SMP extern inline void spin_lock_prefetch(const void *ptr) { __builtin_prefetch(ptr, 1, 3); } +#endif + #else extern inline void prefetch(const void *ptr) { @@ -104,10 +112,13 @@ extern inline void prefetchw(const void *ptr) __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); } +#ifdef CONFIG_SMP extern inline void spin_lock_prefetch(const void *ptr) { __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); } +#endif + #endif /* GCC 3.1 */ #endif /* __ASM_ALPHA_PROCESSOR_H */ diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h index 742b68802fd0..dbdb0d4f90e1 100644 --- a/include/asm-alpha/topology.h +++ b/include/asm-alpha/topology.h @@ -16,8 +16,7 @@ static inline int cpu_to_node(int cpu) node = alpha_mv.cpuid_to_nid(cpu); #ifdef DEBUG_NUMA - if (node < 0) - BUG(); + BUG_ON(node < 0); #endif return node; diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index aac50402bc1b..8511b2ce534f 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h @@ -27,15 +27,13 @@ static inline unsigned long ___mem_pci(unsigned long a) { - if (a <= 0xc0000000 || a >= 0xe0000000) - BUG(); + BUG_ON(a <= 0xc0000000 || a >= 0xe0000000); return a; } static inline unsigned long ___mem_isa(unsigned long a) { - if (a >= 16*1048576) - BUG(); + BUG_ON(a >= 16*1048576); return PCIMEM_BASE + a; } #define __mem_pci(a) ___mem_pci((unsigned long)(a)) diff --git a/include/asm-arm/arch-nexuspci/io.h b/include/asm-arm/arch-nexuspci/io.h index 8afa61e6acba..181bdb5988df 100644 --- a/include/asm-arm/arch-nexuspci/io.h +++ b/include/asm-arm/arch-nexuspci/io.h @@ -28,8 +28,7 @@ static inline unsigned long ___mem_pci(unsigned long a) static inline unsigned long ___mem_isa(unsigned long a) { - if (a >= 16*1048576) - BUG(); + BUG_ON(a >= 16*1048576); return PCIMEM_BASE + a; } #define __mem_pci(a) ___mem_pci((unsigned long)(a)) diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h new file mode 100644 index 000000000000..30548a30c773 --- /dev/null +++ b/include/asm-arm/arch-pxa/udc.h @@ -0,0 +1,18 @@ +/* + * linux/include/asm-arm/arch-pxa/udc.h + * + * This supports machine-specific differences in how the PXA2xx + * USB Device Controller (UDC) is wired. + * + * It is set in linux/arch/arm/mach-pxa/<machine>.c and used in + * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c + */ +struct pxa2xx_udc_mach_info { + int (*udc_is_connected)(void); /* do we see host? */ + void (*udc_command)(int cmd); +#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */ +#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */ +}; + +extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); + diff --git a/include/asm-arm/arch-sa1100/keyboard.h b/include/asm-arm/arch-sa1100/keyboard.h index e2a0c0196bfc..3dacd71d9395 100644 --- a/include/asm-arm/arch-sa1100/keyboard.h +++ b/include/asm-arm/arch-sa1100/keyboard.h @@ -11,7 +11,6 @@ extern void gc_kbd_init_hw(void); extern void smartio_kbd_init_hw(void); -extern void cerf_kbd_init_hw(void); static inline void kbd_init_hw(void) { @@ -19,10 +18,6 @@ static inline void kbd_init_hw(void) gc_kbd_init_hw(); if (machine_is_adsbitsy()) smartio_kbd_init_hw(); -#ifdef CONFIG_SA1100_CERF_CPLD - if (machine_is_cerf()) - cerf_kbd_init_hw(); -#endif } #endif /* _SA1100_KEYBOARD_H */ diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h index 5ddc14f683c2..d751faf725de 100644 --- a/include/asm-arm/mach/arch.h +++ b/include/asm-arm/mach/arch.h @@ -12,7 +12,7 @@ * The size of struct machine_desc * (for assembler code) */ -#define SIZEOF_MACHINE_DESC 48 +#define SIZEOF_MACHINE_DESC 52 #ifndef __ASSEMBLY__ @@ -45,6 +45,7 @@ struct machine_desc { struct meminfo *); void (*map_io)(void);/* IO mapping function */ void (*init_irq)(void); + void (*init_machine)(void); }; /* @@ -86,6 +87,9 @@ const struct machine_desc __mach_desc_##_type \ #define INITIRQ(_func) \ .init_irq = _func, +#define INIT_MACHINE(_func) \ + .init_machine = _func, + #define MACHINE_END \ }; diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 605f57ac56b5..8e420add7daa 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -32,7 +32,7 @@ #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") #define fd_free_dma() CSW._free_dma(FLOPPY_DMA) diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h index 76465ccbbdf8..7a165f27c880 100644 --- a/include/asm-i386/genapic.h +++ b/include/asm-i386/genapic.h @@ -45,6 +45,7 @@ struct genapic { void (*setup_portio_remap)(void); int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); void (*enable_apic_mode)(void); + u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb); /* mpparse */ void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, @@ -105,6 +106,7 @@ struct genapic { APICFUNC(send_IPI_allbutself), \ APICFUNC(send_IPI_all), \ APICFUNC(enable_apic_mode), \ + APICFUNC(phys_pkg_id), \ } extern struct genapic *genapic; diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h index ffc472ff5418..9382e160c46d 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-i386/hpet.h @@ -54,14 +54,10 @@ #define HPET_T2_CMP 0x148 #define HPET_T2_ROUTE 0x150 -#define HPET_ID_VENDOR 0xffff0000 #define HPET_ID_LEGSUP 0x00008000 #define HPET_ID_NUMBER 0x00001f00 #define HPET_ID_REV 0x000000ff -#define HPET_ID_VENDOR_SHIFT 16 -#define HPET_ID_VENDOR_8086 0x8086 - #define HPET_CFG_ENABLE 0x001 #define HPET_CFG_LEGACY 0x002 diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h index 0e9855144660..12980e389c65 100644 --- a/include/asm-i386/mach-bigsmp/mach_apic.h +++ b/include/asm-i386/mach-bigsmp/mach_apic.h @@ -173,4 +173,9 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask) return apicid; } +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return cpuid_apic >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index 1d427aadfa41..5111b015f710 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -127,4 +127,9 @@ static inline void enable_apic_mode(void) { } +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return cpuid_apic >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h index e15b73c7e113..72e87d081af6 100644 --- a/include/asm-i386/mach-es7000/mach_apic.h +++ b/include/asm-i386/mach-es7000/mach_apic.h @@ -192,4 +192,9 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask) return apicid; } +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return cpuid_apic >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h index 21f0e75f1b25..ed349c793beb 100644 --- a/include/asm-i386/mach-generic/mach_apic.h +++ b/include/asm-i386/mach-generic/mach_apic.h @@ -27,5 +27,6 @@ #define check_apicid_used (genapic->check_apicid_used) #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) #define enable_apic_mode (genapic->enable_apic_mode) +#define phys_pkg_id (genapic->phys_pkg_id) #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h index 814ee9aa2521..743bb69aa275 100644 --- a/include/asm-i386/mach-numaq/mach_apic.h +++ b/include/asm-i386/mach-numaq/mach_apic.h @@ -141,4 +141,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask) return (int) 0xF; } +/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */ +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return cpuid_apic >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h index a10b4591737e..accca8fcc970 100644 --- a/include/asm-i386/mach-summit/mach_apic.h +++ b/include/asm-i386/mach-summit/mach_apic.h @@ -173,4 +173,15 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask) return apicid; } +/* cpuid returns the value latched in the HW at reset, not the APIC ID + * register's value. For any box whose BIOS changes APIC IDs, like + * clustered APIC systems, we must use hard_smp_processor_id. + * + * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID. + */ +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return hard_smp_processor_id() >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h index 9a0208496458..3ec402a3a96a 100644 --- a/include/asm-i386/mach-visws/mach_apic.h +++ b/include/asm-i386/mach-visws/mach_apic.h @@ -88,4 +88,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask) { return cpus_coerce_const(cpumask); } + +static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) +{ + return cpuid_apic >> index_msb; +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h index 9bd9e3f0c48e..8e1feee4ea5d 100644 --- a/include/asm-ia64/uaccess.h +++ b/include/asm-ia64/uaccess.h @@ -281,6 +281,9 @@ extern unsigned long __strnlen_user (const char *, long); __su_ret; \ }) +#define ARCH_HAS_SORT_EXTABLE +#define ARCH_HAS_SEARCH_EXTABLE + struct exception_table_entry { int addr; /* gp-relative address of insn this fixup is for */ int cont; /* gp-relative continuation address; if bit 2 is set, r9 is set to 0 */ diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h index 7b6254324cc9..d72e991e4a2b 100644 --- a/include/asm-mips/dma-mapping.h +++ b/include/asm-mips/dma-mapping.h @@ -124,8 +124,7 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, for (i = 0; i < nhwentries; i++, sg++) { unsigned long addr; - if (!sg->page) - BUG(); + BUG_ON(!sg->page); addr = (unsigned long) page_address(sg->page); if (addr) @@ -139,8 +138,7 @@ dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, { unsigned long addr; - if (direction == DMA_NONE) - BUG(); + BUG_ON(direction == DMA_NONE); addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET; dma_cache_wback_inv(addr, size); @@ -153,8 +151,7 @@ dma_sync_single_range(struct device *dev, dma_addr_t dma_handle, { unsigned long addr; - if (direction == DMA_NONE) - BUG(); + BUG_ON(direction == DMA_NONE); addr = baddr_to_bus(hwdev->bus, dma_handle) + PAGE_OFFSET; dma_cache_wback_inv(addr, size); @@ -168,8 +165,7 @@ dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, int i; #endif - if (direction == DMA_NONE) - BUG(); + BUG_ON(direction == DMA_NONE); /* Make sure that gcc doesn't leave the empty loop body. */ #ifdef CONFIG_NONCOHERENT_IO diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 56e01db6f45d..cd96c958408f 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -113,8 +113,7 @@ static inline void pci_dac_dma_sync_single(struct pci_dev *pdev, { unsigned long addr; - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); addr = baddr_to_bus(pdev->bus, dma_addr) + PAGE_OFFSET; dma_cache_wback_inv(addr, len); diff --git a/include/asm-parisc/mmu_context.h b/include/asm-parisc/mmu_context.h index 6327156282f2..9c05836239a2 100644 --- a/include/asm-parisc/mmu_context.h +++ b/include/asm-parisc/mmu_context.h @@ -19,8 +19,7 @@ extern void free_sid(unsigned long); static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { - if (atomic_read(&mm->mm_users) != 1) - BUG(); + BUG_ON(atomic_read(&mm->mm_users) != 1); mm->context = alloc_sid(); return 0; @@ -64,7 +63,7 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) * already, so we should be OK. */ - if (next == &init_mm) BUG(); /* Should never happen */ + BUG_ON(next == &init_mm); /* Should never happen */ if (next->context == 0) next->context = alloc_sid(); diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index a5b731f654cb..86ba2c7ec6f3 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h @@ -27,7 +27,7 @@ extern void flush_tlb_all(void); static inline void flush_tlb_mm(struct mm_struct *mm) { - if (mm == &init_mm) BUG(); /* Should never happen */ + BUG_ON(mm == &init_mm); /* Should never happen */ #ifdef CONFIG_SMP flush_tlb_all(); diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h index 44b43dc69f08..6bc36a194816 100644 --- a/include/asm-ppc/floppy.h +++ b/include/asm-ppc/floppy.h @@ -12,7 +12,7 @@ #define __ASM_PPC_FLOPPY_H #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_enable_dma() enable_dma(FLOPPY_DMA) #define fd_disable_dma() disable_dma(FLOPPY_DMA) diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h index c13b4e495519..ca057b43a2ee 100644 --- a/include/asm-ppc/highmem.h +++ b/include/asm-ppc/highmem.h @@ -63,8 +63,7 @@ static inline void *kmap(struct page *page) static inline void kunmap(struct page *page) { - if (in_interrupt()) - BUG(); + BUG_ON(in_interrupt()); if (page < highmem_start_page) return; kunmap_high(page); @@ -89,8 +88,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE; #if HIGHMEM_DEBUG - if (!pte_none(*(kmap_pte+idx))) - BUG(); + BUG_ON(!pte_none(*(kmap_pte+idx))); #endif set_pte(kmap_pte+idx, mk_pte(page, kmap_prot)); flush_tlb_page(0, vaddr); @@ -110,8 +108,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) return; } - if (vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE) - BUG(); + BUG_ON(vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE); /* * force other mappings to Oops if they'll try to access diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 763765257bfc..5dad69a5ee61 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -105,8 +105,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) { - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); /* nothing to do */ } @@ -134,8 +133,7 @@ static inline dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, size_t size, int direction) { - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); /* Nothing to do */ } @@ -159,8 +157,7 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, { int i; - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); /* * temporary 2.4 hack diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index 9c0bf29a424c..0a1a1a86a1de 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -60,8 +60,6 @@ struct exception_table_entry unsigned long insn, fixup; }; -extern void sort_exception_table(void); - /* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type. diff --git a/include/asm-ppc64/floppy.h b/include/asm-ppc64/floppy.h index 1b8bdb728450..c25d0954b205 100644 --- a/include/asm-ppc64/floppy.h +++ b/include/asm-ppc64/floppy.h @@ -13,7 +13,7 @@ #include <linux/config.h> #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_enable_dma() enable_dma(FLOPPY_DMA) #define fd_disable_dma() disable_dma(FLOPPY_DMA) diff --git a/include/asm-ppc64/hw_irq.h b/include/asm-ppc64/hw_irq.h index 9b4ad1f7993f..8db7a1a70756 100644 --- a/include/asm-ppc64/hw_irq.h +++ b/include/asm-ppc64/hw_irq.h @@ -21,18 +21,15 @@ extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); #ifdef CONFIG_PPC_ISERIES -extern void __no_use_sti(void); -extern void __no_use_cli(void); -extern void __no_use_restore_flags(unsigned long); -extern unsigned long __no_use_save_flags(void); -extern void __no_use_set_lost(unsigned long); -extern void __no_lpq_restore_flags(unsigned long); - -#define local_irq_disable() __no_use_cli() -#define local_irq_enable() __no_use_sti() -#define local_save_flags(flags) ((flags) = __no_use_save_flags()) -#define local_irq_restore(flags) __no_use_restore_flags((unsigned long)flags) -#define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();}) +extern unsigned long local_get_flags(void); +extern unsigned long local_irq_disable(void); +extern void local_irq_restore(unsigned long); + +#define local_irq_enable() local_irq_restore(1) +#define local_save_flags(flags) ((flags) = local_get_flags()) +#define local_irq_save(flags) ((flags) = local_irq_disable()) + +#define irqs_disabled() (local_get_flags() == 0) #else @@ -69,6 +66,13 @@ static inline void __do_save_and_cli(unsigned long *flags) #define local_irq_save(flags) __do_save_and_cli(&flags) +#define irqs_disabled() \ +({ \ + unsigned long flags; \ + local_save_flags(flags); \ + !(flags & MSR_EE); \ +}) + #endif /* CONFIG_PPC_ISERIES */ #define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);}) diff --git a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h index e43cdf5f7200..11a399c33086 100644 --- a/include/asm-ppc64/mmu_context.h +++ b/include/asm-ppc64/mmu_context.h @@ -81,6 +81,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) { long head; unsigned long flags; + /* This does the right thing across a fork (I hope) */ + unsigned long low_hpages = mm->context & CONTEXT_LOW_HPAGES; spin_lock_irqsave(&mmu_context_queue.lock, flags); @@ -91,6 +93,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) head = mmu_context_queue.head; mm->context = mmu_context_queue.elements[head]; + mm->context |= low_hpages; head = (head < LAST_USER_CONTEXT-1) ? head+1 : 0; mmu_context_queue.head = head; diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 5c3515a500a9..305ca8cd8235 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h @@ -65,8 +65,7 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); /* nothing to do */ } @@ -74,8 +73,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { - if (direction == PCI_DMA_NONE) - BUG(); + BUG_ON(direction == PCI_DMA_NONE); /* nothing to do */ } diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h index cdf80cf206f5..2a88765fd600 100644 --- a/include/asm-ppc64/system.h +++ b/include/asm-ppc64/system.h @@ -104,13 +104,6 @@ extern struct task_struct * _switch(struct thread_struct *prev, struct pt_regs; extern void dump_regs(struct pt_regs *); -#define irqs_disabled() \ -({ \ - unsigned long flags; \ - local_save_flags(flags); \ - !(flags & MSR_EE); \ -}) - static inline int __is_processor(unsigned long pv) { unsigned long pvr; diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h index 9be503f666f9..a41ca6cba882 100644 --- a/include/asm-ppc64/topology.h +++ b/include/asm-ppc64/topology.h @@ -13,8 +13,7 @@ static inline int cpu_to_node(int cpu) node = numa_cpu_lookup_table[cpu]; #ifdef DEBUG_NUMA - if (node == -1) - BUG(); + BUG_ON(node == -1); #endif return node; diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h index 2c18c8ada2c9..8c673fd008da 100644 --- a/include/asm-ppc64/uaccess.h +++ b/include/asm-ppc64/uaccess.h @@ -82,7 +82,6 @@ struct exception_table_entry /* Returns 0 if exception not found and fixup otherwise. */ extern unsigned long search_exception_table(unsigned long); -extern void sort_exception_table(void); /* * These are the main single-value transfer routines. They automatically diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h index 64c783f9b7f2..890bc145f9dd 100644 --- a/include/asm-s390/idals.h +++ b/include/asm-s390/idals.h @@ -223,8 +223,7 @@ idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count) size_t left; int i; - if (count > ib->size) - BUG(); + BUG_ON(count > ib->size); for (i = 0; count > IDA_BLOCK_SIZE; i++) { left = copy_to_user(to, ib->data[i], IDA_BLOCK_SIZE); if (left) @@ -244,8 +243,7 @@ idal_buffer_from_user(struct idal_buffer *ib, const void *from, size_t count) size_t left; int i; - if (count > ib->size) - BUG(); + BUG_ON(count > ib->size); for (i = 0; count > IDA_BLOCK_SIZE; i++) { left = copy_from_user(ib->data[i], from, IDA_BLOCK_SIZE); if (left) diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h index 2b7eba3789b4..f030ca08052b 100644 --- a/include/asm-sh/floppy.h +++ b/include/asm-sh/floppy.h @@ -33,7 +33,7 @@ #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") #define fd_free_dma() CSW._free_dma(FLOPPY_DMA) diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h index c0adea380ac7..9930f93b1f14 100644 --- a/include/asm-sh/spinlock.h +++ b/include/asm-sh/spinlock.h @@ -48,8 +48,7 @@ static inline void _raw_spin_lock(spinlock_t *lock) static inline void _raw_spin_unlock(spinlock_t *lock) { #ifdef CONFIG_DEBUG_SPINLOCK - if (!spin_is_locked(lock)) - BUG(); + BUG_ON(!spin_is_locked(lock)); #endif lock->lock = 0; diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index 8beed5df56b3..1bc43aaa49eb 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -320,10 +320,9 @@ static void sun_pci_fd_lde_broken_outb(unsigned char val, unsigned long port) static void sun_pci_fd_enable_dma(void) { - if ((NULL == sun_pci_dma_pending.buf) || + BUG_ON((NULL == sun_pci_dma_pending.buf) || (0 == sun_pci_dma_pending.len) || - (0 == sun_pci_dma_pending.direction)) - BUG(); + (0 == sun_pci_dma_pending.direction)); sun_pci_dma_current.buf = sun_pci_dma_pending.buf; sun_pci_dma_current.len = sun_pci_dma_pending.len; diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h index 982829f3dc16..8c70fdd037b6 100644 --- a/include/asm-sparc64/tlbflush.h +++ b/include/asm-sparc64/tlbflush.h @@ -90,10 +90,9 @@ static __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long st { /* Note the signed type. */ long s = start, e = end, vpte_base; - if (s > e) /* Nobody should call us with start below VM hole and end above. See if it is really true. */ - BUG(); + BUG_ON(s > e); #if 0 /* Currently free_pgtables guarantees this. */ s &= PMD_MASK; diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h index 99eaae0f6686..2f2df23b68ac 100644 --- a/include/asm-x86_64/floppy.h +++ b/include/asm-x86_64/floppy.h @@ -32,7 +32,7 @@ #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") #define fd_free_dma() CSW._free_dma(FLOPPY_DMA) diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h index e15895c99a4e..bebcaab3375c 100644 --- a/include/asm-x86_64/pgalloc.h +++ b/include/asm-x86_64/pgalloc.h @@ -24,8 +24,7 @@ extern __inline__ pmd_t *get_pmd(void) extern __inline__ void pmd_free(pmd_t *pmd) { - if ((unsigned long)pmd & (PAGE_SIZE-1)) - BUG(); + BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); free_page((unsigned long)pmd); } @@ -41,8 +40,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm) static inline void pgd_free (pgd_t *pgd) { - if ((unsigned long)pgd & (PAGE_SIZE-1)) - BUG(); + BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); free_page((unsigned long)pgd); } @@ -64,8 +62,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add extern __inline__ void pte_free_kernel(pte_t *pte) { - if ((unsigned long)pte & (PAGE_SIZE-1)) - BUG(); + BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); free_page((unsigned long)pte); } diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h index ae3615feecdb..c341097c7106 100644 --- a/include/asm-x86_64/spinlock.h +++ b/include/asm-x86_64/spinlock.h @@ -70,10 +70,8 @@ typedef struct { static inline void _raw_spin_unlock(spinlock_t *lock) { #ifdef CONFIG_DEBUG_SPINLOCK - if (lock->magic != SPINLOCK_MAGIC) - BUG(); - if (!spin_is_locked(lock)) - BUG(); + BUG_ON(lock->magic != SPINLOCK_MAGIC); + BUG_ON(!spin_is_locked(lock)); #endif __asm__ __volatile__( spin_unlock_string @@ -91,10 +89,8 @@ static inline void _raw_spin_unlock(spinlock_t *lock) { char oldval = 1; #ifdef CONFIG_DEBUG_SPINLOCK - if (lock->magic != SPINLOCK_MAGIC) - BUG(); - if (!spin_is_locked(lock)) - BUG(); + BUG_ON(lock->magic != SPINLOCK_MAGIC); + BUG_ON(!spin_is_locked(lock)); #endif __asm__ __volatile__( spin_unlock_string @@ -174,8 +170,7 @@ typedef struct { static inline void _raw_read_lock(rwlock_t *rw) { #ifdef CONFIG_DEBUG_SPINLOCK - if (rw->magic != RWLOCK_MAGIC) - BUG(); + BUG_ON(rw->magic != RWLOCK_MAGIC); #endif __build_read_lock(rw, "__read_lock_failed"); } @@ -183,8 +178,7 @@ static inline void _raw_read_lock(rwlock_t *rw) static inline void _raw_write_lock(rwlock_t *rw) { #ifdef CONFIG_DEBUG_SPINLOCK - if (rw->magic != RWLOCK_MAGIC) - BUG(); + BUG_ON(rw->magic != RWLOCK_MAGIC); #endif __build_write_lock(rw, "__write_lock_failed"); } diff --git a/include/linux/bio.h b/include/linux/bio.h index 4f090059372e..d3b4e9ed4052 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -266,8 +266,7 @@ extern inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) local_irq_save(*flags); addr = (unsigned long) kmap_atomic(bvec->bv_page, KM_BIO_SRC_IRQ); - if (addr & ~PAGE_MASK) - BUG(); + BUG_ON(addr & ~PAGE_MASK); return (char *) addr + bvec->bv_offset; } diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 74b89ea0aae5..b84caaebed87 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -10,57 +10,11 @@ #include <linux/bitops.h> #include <linux/string.h> -static inline int bitmap_empty(const unsigned long *bitmap, int bits) -{ - int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline int bitmap_full(const unsigned long *bitmap, int bits) -{ - int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (~bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline int bitmap_equal(const unsigned long *bitmap1, - unsigned long *bitmap2, int bits) -{ - int k, lim = bits/BITS_PER_LONG;; - for (k = 0; k < lim; ++k) - if (bitmap1[k] != bitmap2[k]) - return 0; - - if (bits % BITS_PER_LONG) - if ((bitmap1[k] ^ bitmap2[k]) & - ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline void bitmap_complement(unsigned long *bitmap, int bits) -{ - int k; - - for (k = 0; k < BITS_TO_LONGS(bits); ++k) - bitmap[k] = ~bitmap[k]; -} +int bitmap_empty(const unsigned long *bitmap, int bits); +int bitmap_full(const unsigned long *bitmap, int bits); +int bitmap_equal(const unsigned long *bitmap1, + unsigned long *bitmap2, int bits); +void bitmap_complement(unsigned long *bitmap, int bits); static inline void bitmap_clear(unsigned long *bitmap, int bits) { @@ -78,81 +32,15 @@ static inline void bitmap_copy(unsigned long *dst, memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long)); } -static inline void bitmap_shift_right(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k; - DECLARE_BITMAP(__shr_tmp, bits); - - bitmap_clear(__shr_tmp, bits); - for (k = 0; k < bits - shift; ++k) - if (test_bit(k + shift, src)) - set_bit(k, __shr_tmp); - bitmap_copy(dst, __shr_tmp, bits); -} - -static inline void bitmap_shift_left(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k; - DECLARE_BITMAP(__shl_tmp, bits); - - bitmap_clear(__shl_tmp, bits); - for (k = bits; k >= shift; --k) - if (test_bit(k - shift, src)) - set_bit(k, __shl_tmp); - bitmap_copy(dst, __shl_tmp, bits); -} - -static inline void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits) -{ - int k; - int nr = BITS_TO_LONGS(bits); - - for (k = 0; k < nr; k++) - dst[k] = bitmap1[k] & bitmap2[k]; -} - -static inline void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits) -{ - int k; - int nr = BITS_TO_LONGS(bits); - - for (k = 0; k < nr; k++) - dst[k] = bitmap1[k] | bitmap2[k]; -} - -#if BITS_PER_LONG == 32 -static inline int bitmap_weight(const unsigned long *bitmap, int bits) -{ - int k, w = 0, lim = bits/BITS_PER_LONG; - - for (k = 0; k < lim; k++) - w += hweight32(bitmap[k]); - - if (bits % BITS_PER_LONG) - w += hweight32(bitmap[k] & - ((1UL << (bits % BITS_PER_LONG)) - 1)); - - return w; -} -#else -static inline int bitmap_weight(const unsigned long *bitmap, int bits) -{ - int k, w = 0, lim = bits/BITS_PER_LONG; - - for (k = 0; k < lim; k++) - w += hweight64(bitmap[k]); - - if (bits % BITS_PER_LONG) - w += hweight64(bitmap[k] & - ((1UL << (bits % BITS_PER_LONG)) - 1)); - - return w; -} -#endif +void bitmap_shift_right(unsigned long *dst, + const unsigned long *src, int shift, int bits); +void bitmap_shift_left(unsigned long *dst, + const unsigned long *src, int shift, int bits); +void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, + const unsigned long *bitmap2, int bits); +void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, + const unsigned long *bitmap2, int bits); +int bitmap_weight(const unsigned long *bitmap, int bits); #endif /* __ASSEMBLY__ */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a1c5cd076331..80b4c47842b8 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -483,9 +483,9 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) } #endif /* CONFIG_MMU */ -#define rq_for_each_bio(bio, rq) \ +#define rq_for_each_bio(_bio, rq) \ if ((rq->bio)) \ - for (bio = (rq)->bio; bio; bio = bio->bi_next) + for (_bio = (rq)->bio; _bio; _bio = bio->bi_next) struct sec_size { unsigned block_size; diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5f4b675a7bb4..110584f07883 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -125,8 +125,7 @@ BUFFER_FNS(Write_EIO,write_io_error) /* If we *know* page->private refers to buffer_heads */ #define page_buffers(page) \ ({ \ - if (!PagePrivate(page)) \ - BUG(); \ + BUG_ON(!PagePrivate(page)); \ ((struct buffer_head *)(page)->private); \ }) #define page_has_buffers(page) PagePrivate(page) diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6bd0570d3a1c..6b2ea8fecf06 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -270,8 +270,7 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int); static inline struct dentry *dget(struct dentry *dentry) { if (dentry) { - if (!atomic_read(&dentry->d_count)) - BUG(); + BUG_ON(!atomic_read(&dentry->d_count)); atomic_inc(&dentry->d_count); } return dentry; diff --git a/include/linux/device.h b/include/linux/device.h index 8f008e19b83f..367b21888ad4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -46,6 +46,7 @@ struct device; struct device_driver; struct class; struct class_device; +struct class_simple; struct bus_type { char * name; @@ -155,6 +156,7 @@ struct class { int num_envp, char *buffer, int buffer_size); void (*release)(struct class_device *dev); + void (*class_release)(struct class *class); }; extern int class_register(struct class *); @@ -246,6 +248,13 @@ struct class_interface { extern int class_interface_register(struct class_interface *); extern void class_interface_unregister(struct class_interface *); +/* interface for class simple stuff */ +extern struct class_simple *class_simple_create(struct module *owner, char *name); +extern void class_simple_destroy(struct class_simple *cs); +extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...) + __attribute__((format(printf,4,5))); +extern void class_simple_device_remove(dev_t dev); + struct device { struct list_head node; /* node in sibling list */ @@ -354,6 +363,7 @@ extern int (*platform_notify_remove)(struct device * dev); */ extern struct device * get_device(struct device * dev); extern void put_device(struct device * dev); +extern struct device *device_find(const char *name, struct bus_type *bus); /* drivers/base/platform.c */ diff --git a/include/linux/efi.h b/include/linux/efi.h index 86e9d2ebb5eb..a1764b1fb106 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -297,14 +297,22 @@ extern u64 efi_mem_attributes (unsigned long phys_addr); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc); -extern unsigned long inline __init efi_get_time(void); -extern int inline __init efi_set_rtc_mmss(unsigned long nowtime); +extern inline unsigned long __init efi_get_time(void); +extern inline int __init efi_set_rtc_mmss(unsigned long nowtime); extern struct efi_memory_map memmap; +/* + * We play games with efi_enabled so that the compiler will, if possible, remove + * EFI-related code altogether. + */ #ifdef CONFIG_EFI -extern int efi_enabled; +# ifdef CONFIG_X86 + extern int efi_enabled; +# else +# define efi_enabled 1 +# endif #else -#define efi_enabled 0 +# define efi_enabled 0 #endif /* diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1ece9f119220..136c6315e6af 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h @@ -22,6 +22,9 @@ #define EPOLL_CTL_DEL 2 #define EPOLL_CTL_MOD 3 +/* Set the One Shot behaviour for the target file descriptor */ +#define EPOLLONESHOT (1 << 30) + /* Set the Edge Triggered behaviour for the target file descriptor */ #define EPOLLET (1 << 31) diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 13178c16c7ea..4eda0ed76a48 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h @@ -45,6 +45,7 @@ struct ext2_sb_info { int s_desc_per_block_bits; int s_inode_size; int s_first_ino; + spinlock_t s_next_gen_lock; u32 s_next_generation; unsigned long s_dir_count; u8 *s_debts; diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index e9b4012cc776..590fd69ec045 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h @@ -49,6 +49,7 @@ struct ext3_sb_info { int s_desc_per_block_bits; int s_inode_size; int s_first_ino; + spinlock_t s_next_gen_lock; u32 s_next_generation; u32 s_hash_seed[4]; int s_def_hash_version; diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 50caf6875ba4..a3555b48cccb 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -221,13 +221,24 @@ static inline int ext3_should_journal_data(struct inode *inode) static inline int ext3_should_order_data(struct inode *inode) { - return (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA); + if (!S_ISREG(inode->i_mode)) + return 0; + if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL) + return 0; + if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA) + return 1; + return 0; } static inline int ext3_should_writeback_data(struct inode *inode) { - return !ext3_should_journal_data(inode) && - !ext3_should_order_data(inode); + if (!S_ISREG(inode->i_mode)) + return 0; + if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL) + return 0; + if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA) + return 1; + return 0; } #endif /* _LINUX_EXT3_JBD_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index fd3c87c86d6f..7d9154665d9b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -353,6 +353,13 @@ struct block_device { int bd_invalidated; struct gendisk * bd_disk; struct list_head bd_list; + /* + * Private data. You must have bd_claim'ed the block_device + * to use this. NOTE: bd_claim allows an owner to claim + * the same device multiple times, the owner must take special + * care to not mess up bd_private for that case. + */ + unsigned long bd_private; }; /* diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 2c9139a94f8f..232d8fdb557c 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -56,8 +56,7 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse { void *kaddr; - if (offset + size > PAGE_SIZE) - BUG(); + BUG_ON(offset + size > PAGE_SIZE); kaddr = kmap_atomic(page, KM_USER0); memset((char *)kaddr + offset, 0, size); diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 74a7286240ba..d4dcd2126ce1 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -154,6 +154,9 @@ #define I2C_DRIVERID_W83627HF 1038 #define I2C_DRIVERID_LM85 1039 #define I2C_DRIVERID_LM83 1040 +#define I2C_DRIVERID_LM90 1042 +#define I2C_DRIVERID_ASB100 1043 +#define I2C_DRIVERID_W83L785TS 1047 /* * ---- Adapter types ---------------------------------------------------- diff --git a/include/linux/input.h b/include/linux/input.h index eff36f445c25..3beb4078a2da 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -189,18 +189,18 @@ struct input_absinfo { #define KEY_KP3 81 #define KEY_KP0 82 #define KEY_KPDOT 83 -#define KEY_103RD 84 -#define KEY_F13 85 + +#define KEY_ZENKAKUHANKAKU 85 #define KEY_102ND 86 #define KEY_F11 87 #define KEY_F12 88 -#define KEY_F14 89 -#define KEY_F15 90 -#define KEY_F16 91 -#define KEY_F17 92 -#define KEY_F18 93 -#define KEY_F19 94 -#define KEY_F20 95 +#define KEY_RO 89 +#define KEY_KATAKANA 90 +#define KEY_HIRAGANA 91 +#define KEY_HENKAN 92 +#define KEY_KATAKANAHIRAGANA 93 +#define KEY_MUHENKAN 94 +#define KEY_KPJPCOMMA 95 #define KEY_KPENTER 96 #define KEY_RIGHTCTRL 97 #define KEY_KPSLASH 98 @@ -225,11 +225,11 @@ struct input_absinfo { #define KEY_KPEQUAL 117 #define KEY_KPPLUSMINUS 118 #define KEY_PAUSE 119 -#define KEY_F21 120 -#define KEY_F22 121 -#define KEY_F23 122 -#define KEY_F24 123 -#define KEY_KPCOMMA 124 + +#define KEY_KPCOMMA 121 +#define KEY_HANGUEL 122 +#define KEY_HANJA 123 +#define KEY_YEN 124 #define KEY_LEFTMETA 125 #define KEY_RIGHTMETA 126 #define KEY_COMPOSE 127 @@ -288,24 +288,18 @@ struct input_absinfo { #define KEY_KPLEFTPAREN 179 #define KEY_KPRIGHTPAREN 180 -#define KEY_INTL1 181 -#define KEY_INTL2 182 -#define KEY_INTL3 183 -#define KEY_INTL4 184 -#define KEY_INTL5 185 -#define KEY_INTL6 186 -#define KEY_INTL7 187 -#define KEY_INTL8 188 -#define KEY_INTL9 189 -#define KEY_LANG1 190 -#define KEY_LANG2 191 -#define KEY_LANG3 192 -#define KEY_LANG4 193 -#define KEY_LANG5 194 -#define KEY_LANG6 195 -#define KEY_LANG7 196 -#define KEY_LANG8 197 -#define KEY_LANG9 198 +#define KEY_F13 183 +#define KEY_F14 184 +#define KEY_F15 185 +#define KEY_F16 186 +#define KEY_F17 187 +#define KEY_F18 188 +#define KEY_F19 189 +#define KEY_F20 190 +#define KEY_F21 191 +#define KEY_F22 192 +#define KEY_F23 193 +#define KEY_F24 194 #define KEY_PLAYCD 200 #define KEY_PAUSECD 201 @@ -580,6 +574,7 @@ struct input_absinfo { #define BUS_ISAPNP 0x02 #define BUS_USB 0x03 #define BUS_HIL 0x04 +#define BUS_BLUETOOTH 0x05 #define BUS_ISA 0x10 #define BUS_I8042 0x11 @@ -809,6 +804,7 @@ struct input_dev { int (*erase_effect)(struct input_dev *dev, int effect_id); struct input_handle *grab; + struct device *dev; struct list_head h_list; struct list_head node; @@ -921,7 +917,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in #define input_regs(a,b) do { (a)->regs = (b); } while (0) #define input_sync(a) do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0) -extern struct class input_class; +extern struct class_simple *input_class; #endif #endif diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 42174b623637..2b127488d33e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -56,6 +56,7 @@ extern void kobject_unregister(struct kobject *); extern struct kobject * kobject_get(struct kobject *); extern void kobject_put(struct kobject *); +extern void kobject_hotplug(const char *action, struct kobject *); struct kobj_type { void (*release)(struct kobject *); diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 6b7f9c1fa5cd..98f61665d4c2 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -36,12 +36,15 @@ #define TUN_MINOR 200 +struct device; + struct miscdevice { int minor; const char *name; struct file_operations *fops; struct list_head list; + struct device *dev; char devfs_name[64]; }; diff --git a/include/linux/mm.h b/include/linux/mm.h index 881091514f01..3ecd3d633c5f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -223,7 +223,6 @@ struct page { atomic_dec_and_test(&(p)->count); \ }) -#define page_count(p) atomic_read(&(p)->count) #define set_page_count(p,v) atomic_set(&(p)->count, v) #define __put_page(p) atomic_dec(&(p)->count) @@ -231,6 +230,13 @@ extern void FASTCALL(__page_cache_release(struct page *)); #ifdef CONFIG_HUGETLB_PAGE +static inline int page_count(struct page *p) +{ + if (PageCompound(p)) + p = (struct page *)p->lru.next; + return atomic_read(&(p)->count); +} + static inline void get_page(struct page *page) { if (PageCompound(page)) @@ -257,6 +263,8 @@ static inline void put_page(struct page *page) #else /* CONFIG_HUGETLB_PAGE */ +#define page_count(p) atomic_read(&(p)->count) + static inline void get_page(struct page *page) { atomic_inc(&page->count); @@ -322,23 +330,33 @@ static inline void put_page(struct page *page) /* * The zone field is never updated after free_area_init_core() * sets it, so none of the operations on it need to be atomic. - * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones - * total, so we use NODES_SHIFT here to get enough bits. + * We'll have up to (MAX_NUMNODES * MAX_NR_ZONES) zones total, + * so we use (MAX_NODES_SHIFT + MAX_ZONES_SHIFT) here to get enough bits. */ -#define ZONE_SHIFT (BITS_PER_LONG - NODES_SHIFT - MAX_NR_ZONES_SHIFT) +#define NODEZONE_SHIFT (BITS_PER_LONG - MAX_NODES_SHIFT - MAX_ZONES_SHIFT) +#define NODEZONE(node, zone) ((node << ZONES_SHIFT) | zone) + +static inline unsigned long page_zonenum(struct page *page) +{ + return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT)); +} +static inline unsigned long page_nodenum(struct page *page) +{ + return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT)); +} struct zone; extern struct zone *zone_table[]; static inline struct zone *page_zone(struct page *page) { - return zone_table[page->flags >> ZONE_SHIFT]; + return zone_table[page->flags >> NODEZONE_SHIFT]; } -static inline void set_page_zone(struct page *page, unsigned long zone_num) +static inline void set_page_zone(struct page *page, unsigned long nodezone_num) { - page->flags &= ~(~0UL << ZONE_SHIFT); - page->flags |= zone_num << ZONE_SHIFT; + page->flags &= ~(~0UL << NODEZONE_SHIFT); + page->flags |= nodezone_num << NODEZONE_SHIFT; } #ifndef CONFIG_DISCONTIGMEM @@ -624,5 +642,33 @@ kernel_map_pages(struct page *page, int numpages, int enable) } #endif +#ifndef CONFIG_ARCH_GATE_AREA +#ifdef AT_SYSINFO_EHDR +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) + return 1; + else + return 0; +} + +extern struct vm_area_struct gate_vma; +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return &gate_vma; +} +#else +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + return 0; +} + +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return NULL; +} +#endif +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a089e01dad03..66cbaa36d878 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -160,12 +160,19 @@ struct zone { #define ZONE_NORMAL 1 #define ZONE_HIGHMEM 2 -#define MAX_NR_ZONES 3 /* Sync this with MAX_NR_ZONES_SHIFT */ -#define MAX_NR_ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ +#define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */ +#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ #define GFP_ZONEMASK 0x03 /* + * 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 + * queues ("queue_length >> 12") during an aging round. + */ +#define DEF_PRIORITY 12 + +/* * One allocation request operates on a zonelist. A zonelist * is a list of zones, the first one is the 'goal' of the * allocation, the other zones are fallback zones, in decreasing @@ -303,7 +310,7 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, extern struct pglist_data contig_page_data; #define NODE_DATA(nid) (&contig_page_data) #define NODE_MEM_MAP(nid) mem_map -#define MAX_NODES_SHIFT 0 +#define MAX_NODES_SHIFT 1 #else /* CONFIG_DISCONTIGMEM */ @@ -311,7 +318,7 @@ extern struct pglist_data contig_page_data; #if BITS_PER_LONG == 32 /* - * with 32 bit flags field, page->zone is currently 8 bits. + * with 32 bit page->flags field, we reserve 8 bits for node/zone info. * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. */ #define MAX_NODES_SHIFT 6 @@ -328,6 +335,13 @@ extern struct pglist_data contig_page_data; #error NODES_SHIFT > MAX_NODES_SHIFT #endif +/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */ +#define MAX_ZONES_SHIFT 2 + +#if ZONES_SHIFT > MAX_ZONES_SHIFT +#error ZONES_SHIFT > MAX_ZONES_SHIFT +#endif + extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES); extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS); diff --git a/include/linux/module.h b/include/linux/module.h index 13ff244afdbf..95cbc9b4936f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -54,12 +54,16 @@ const struct exception_table_entry * search_extable(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value); +void sort_extable(struct exception_table_entry *start, + struct exception_table_entry *finish); +void sort_main_extable(void); #ifdef MODULE #define ___module_cat(a,b) __mod_ ## a ## b #define __module_cat(a,b) ___module_cat(a,b) #define __MODULE_INFO(tag, name, info) \ static const char __module_cat(name,__LINE__)[] \ + __attribute_used__ \ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info #define MODULE_GENERIC_TABLE(gtype,name) \ @@ -142,6 +146,7 @@ void *__symbol_get_gpl(const char *symbol); #define __CRC_SYMBOL(sym, sec) \ extern void *__crc_##sym __attribute__((weak)); \ static const unsigned long __kcrctab_##sym \ + __attribute_used__ \ __attribute__((section("__kcrctab" sec), unused)) \ = (unsigned long) &__crc_##sym; #else @@ -155,6 +160,7 @@ void *__symbol_get_gpl(const char *symbol); __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #sym; \ static const struct kernel_symbol __ksymtab_##sym \ + __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym } diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 0a5becbed774..cbca00722b5c 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -52,6 +52,7 @@ struct kparam_array #define __module_param_call(prefix, name, set, get, arg, perm) \ static char __param_str_##name[] __initdata = 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 } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 666d89f875f5..cfdeaaad2b7e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -831,7 +831,7 @@ static inline void netif_rx_complete(struct net_device *dev) unsigned long flags; local_irq_save(flags); - if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); list_del(&dev->poll_list); smp_mb__before_clear_bit(); clear_bit(__LINK_STATE_RX_SCHED, &dev->state); @@ -857,7 +857,7 @@ static inline void netif_poll_enable(struct net_device *dev) */ static inline void __netif_rx_complete(struct net_device *dev) { - if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); list_del(&dev->poll_list); smp_mb__before_clear_bit(); clear_bit(__LINK_STATE_RX_SCHED, &dev->state); diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 93edc5a5ad98..5ae592b26d63 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -255,8 +255,7 @@ nfs_file_cred(struct file *file) if (file) cred = (struct rpc_cred *)file->private_data; #ifdef RPC_DEBUG - if (cred && cred->cr_magic != RPCAUTH_CRED_MAGIC) - BUG(); + BUG_ON(cred && cred->cr_magic != RPCAUTH_CRED_MAGIC); #endif return cred; } diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 86d2bbccd9ea..4dba6ec06e3a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -291,6 +291,7 @@ #define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 /* Radeon RV280 (9200) */ #define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960 +#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 /* Radeon R300 (9500) */ #define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144 /* Radeon R300 (9700) */ diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index ad88acfd7b70..155c9a2af016 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -44,8 +44,7 @@ extern struct quotactl_ops vfs_quotactl_ops; static __inline__ void DQUOT_INIT(struct inode *inode) { - if (!inode->i_sb) - BUG(); + BUG_ON(!inode->i_sb); if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) inode->i_sb->dq_op->initialize(inode, -1); } @@ -53,8 +52,7 @@ static __inline__ void DQUOT_INIT(struct inode *inode) static __inline__ void DQUOT_DROP(struct inode *inode) { if (IS_QUOTAINIT(inode)) { - if (!inode->i_sb) - BUG(); + BUG_ON(!inode->i_sb); inode->i_sb->dq_op->drop(inode); /* Ops must be set when there's any quota... */ } } diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9466321a2b2..7b6e12c45dc9 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -23,7 +23,8 @@ #define TRANSLUCENT 5UL #define HSM 6UL #define MULTIPATH 7UL -#define MAX_PERSONALITY 8UL +#define RAID6 8UL +#define MAX_PERSONALITY 9UL #define LEVEL_MULTIPATH (-4) #define LEVEL_LINEAR (-1) @@ -41,6 +42,7 @@ static inline int pers_to_level (int pers) case RAID0: return 0; case RAID1: return 1; case RAID5: return 5; + case RAID6: return 6; } BUG(); return MD_RESERVED; @@ -57,6 +59,7 @@ static inline int level_to_pers (int level) case 1: return RAID1; case 4: case 5: return RAID5; + case 6: return RAID6; } return MD_RESERVED; } @@ -188,6 +191,8 @@ struct mddev_s int sb_dirty; int ro; + struct gendisk *gendisk; + /* Superblock information */ int major_version, minor_version, diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index fb61a8967408..1cabc4d80e6a 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -70,7 +70,7 @@ * that the Uptodate bit is set. Once they have checked that they may * take buffers off the read queue. * - * When a buffer on the write list is committed for write is it copied + * When a buffer on the write list is committed for write it is copied * into the cache buffer, which is then marked dirty, and moved onto a * third list, the written list (bh_written). Once both the parity * block and the cached buffer are successfully written, any buffer on diff --git a/include/linux/sched.h b/include/linux/sched.h index dba09fa98441..f5f84aedbaec 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -50,7 +50,7 @@ struct exec_domain; #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ -#define CLONE_DETACHED 0x00400000 /* Not used - CLONE_THREAD implies detached uniquely */ +#define CLONE_DETACHED 0x00400000 /* Unused, ignored */ #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ diff --git a/include/linux/sctp.h b/include/linux/sctp.h index a022f9f629f6..9ddc3bd5cd81 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -439,12 +439,13 @@ typedef enum { * 0x0101 Operation Refused Due to Resource Shortage. * 0x0102 Request to Delete Source IP Address. * 0x0103 Association Aborted due to illegal ASCONF-ACK + * 0x0104 Request refused - no authorization. */ SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), - + SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104) } sctp_error_t; diff --git a/include/linux/security.h b/include/linux/security.h index 06b2c60a48f8..92786e0700c3 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -46,6 +46,8 @@ extern void cap_capset_set (struct task_struct *target, kernel_cap_t *effective, extern int cap_bprm_set_security (struct linux_binprm *bprm); extern void cap_bprm_compute_creds (struct linux_binprm *bprm); 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_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_syslog (int type); @@ -2155,7 +2157,7 @@ static inline void security_inode_delete (struct inode *inode) static inline int security_inode_setxattr (struct dentry *dentry, char *name, void *value, size_t size, int flags) { - return 0; + return cap_inode_setxattr(dentry, name, value, size, flags); } static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, @@ -2174,7 +2176,7 @@ static inline int security_inode_listxattr (struct dentry *dentry) static inline int security_inode_removexattr (struct dentry *dentry, char *name) { - return 0; + return cap_inode_removexattr(dentry, name); } static inline int security_inode_getsecurity(struct dentry *dentry, const char *name, void *buffer, size_t size) diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 80fbd56eb3e4..9a20995c531a 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h @@ -49,8 +49,7 @@ static inline void lock_kernel(void) static inline void unlock_kernel(void) { - if (unlikely(current->lock_depth < 0)) - BUG(); + BUG_ON(current->lock_depth < 0); if (likely(--current->lock_depth < 0)) put_kernel_lock(); } diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index a9575c349cfe..299b31438ffc 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -94,6 +94,8 @@ struct cache_detail { /* fields for communication over channel */ struct list_head queue; struct proc_dir_entry *proc_ent; + struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; + atomic_t readers; /* how many time is /chennel open */ time_t last_close; /* it no readers, when did last close */ }; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b8be51acff95..0d5b121f54a0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -580,6 +580,7 @@ enum { NET_SCTP_HB_INTERVAL = 10, NET_SCTP_PRESERVE_ENABLE = 11, NET_SCTP_MAX_BURST = 12, + NET_SCTP_ADDIP_ENABLE = 13, }; /* /proc/sys/net/bridge */ @@ -737,6 +738,8 @@ extern int proc_dointvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, void __user *, size_t *); +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, + void __user *, size_t *); extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 9e967b58ee2e..d9c5d5c83d49 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -12,4 +12,6 @@ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#define XATTR_SECURITY_PREFIX "security." + #endif /* _LINUX_XATTR_H */ diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 5e6b16299b05..5e9f64e67bc8 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h @@ -67,6 +67,8 @@ struct saa7146_pgtable { dma_addr_t dma; /* used for offsets for u,v planes for planar capture modes */ unsigned long offset; + /* used for custom pagetables (used for example by budget dvb cards) */ + struct scatterlist *slist; }; struct saa7146_pci_extension_data { diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 83d8b9d66830..50ab25907eec 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h @@ -26,12 +26,15 @@ struct saa7146_video_dma { u32 num_line_byte; }; +#define FORMAT_BYTE_SWAP 0x1 +#define FORMAT_IS_PLANAR 0x2 + struct saa7146_format { char *name; - int pixelformat; + u32 pixelformat; u32 trans; u8 depth; - int swap; + u8 flags; }; struct saa7146_standard @@ -97,6 +100,8 @@ struct saa7146_fh { struct videobuf_queue vbi_q; struct v4l2_vbi_format vbi_fmt; struct timer_list vbi_read_timeout; + + unsigned int resources; /* resource management for device open */ }; struct saa7146_vv @@ -136,6 +141,8 @@ struct saa7146_vv int current_hps_sync; struct saa7146_dma d_clipping; /* pointer to clipping memory */ + + unsigned int resources; /* resource management for device */ }; #define SAA7146_EXCLUSIVE 0x1 @@ -149,7 +156,6 @@ struct saa7146_extension_ioctls }; /* flags */ -// #define SAA7146_EXT_SWAP_ODD_EVEN 0x1 /* needs odd/even fields swapped */ #define SAA7146_USE_PORT_B_FOR_VBI 0x2 /* use input port b for vbi hardware bug workaround */ struct saa7146_ext_vv @@ -171,7 +177,7 @@ struct saa7146_ext_vv struct saa7146_use_ops { void (*init)(struct saa7146_dev *, struct saa7146_vv *); - void(*open)(struct saa7146_dev *, struct file *); + int(*open)(struct saa7146_dev *, struct file *); void (*release)(struct saa7146_dev *, struct file *); void (*irq_done)(struct saa7146_dev *, unsigned long status); ssize_t (*read)(struct file *, char *, size_t, loff_t *); @@ -189,9 +195,10 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf); int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); int saa7146_vv_release(struct saa7146_dev* dev); - /* from saa7146_hlp.c */ -void saa7146_set_overlay(struct saa7146_dev *dev, struct saa7146_fh *fh, int v); +int saa7146_enable_overlay(struct saa7146_fh *fh); +void saa7146_disable_overlay(struct saa7146_fh *fh); + void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next); void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) ; void saa7146_set_hps_source_and_sync(struct saa7146_dev *saa, int source, int sync); @@ -205,6 +212,16 @@ int saa7146_stop_preview(struct saa7146_fh *fh); /* from saa7146_vbi.c */ extern struct saa7146_use_ops saa7146_vbi_uops; +/* resource management functions */ +int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit); +int saa7146_res_check(struct saa7146_fh *fh, unsigned int bit); +int saa7146_res_locked(struct saa7146_dev *dev, unsigned int bit); +void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits); + +#define RESOURCE_DMA1_HPS 0x1 +#define RESOURCE_DMA2_CLP 0x2 +#define RESOURCE_DMA3_BRS 0x4 + /* saa7146 source inputs */ #define SAA7146_HPS_SOURCE_PORT_A 0x00 #define SAA7146_HPS_SOURCE_PORT_B 0x01 diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 92cbb7794cac..bdc0973b0070 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -57,9 +57,11 @@ extern int addrconf_del_ifaddr(void *arg); extern int addrconf_set_dstaddr(void *arg); extern int ipv6_chk_addr(struct in6_addr *addr, - struct net_device *dev); + struct net_device *dev, + int strict); extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, - struct net_device *dev); + struct net_device *dev, + int strict); extern int ipv6_get_saddr(struct dst_entry *dst, struct in6_addr *daddr, struct in6_addr *saddr); diff --git a/include/net/neighbour.h b/include/net/neighbour.h index e016389694a8..857f03acaffd 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -47,9 +47,7 @@ #include <linux/skbuff.h> #include <linux/err.h> -#ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -#endif #define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE) #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY) diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 5e17983fffdc..f031313bb3ef 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -1,8 +1,8 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. - * Copyright (c) 2001-2002 International Business Machines Corp. * * This file is part of the SCTP kernel reference Implementation * @@ -75,8 +75,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) #define SCTP_NUM_CHUNK_TYPES (SCTP_NUM_BASE_CHUNKTYPES + 2) -#define SCTP_CID_ADDIP_MIN SCTP_CID_ASCONF -#define SCTP_CID_ADDIP_MAX SCTP_CID_ASCONF_ACK #define SCTP_NUM_ADDIP_CHUNK_TYPES 2 /* These are the different flavours of event. */ diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 7edb15d6561a..3fa80e611ba1 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -115,8 +115,10 @@ #define SCTP_STATIC static #endif -#define MSECS_TO_JIFFIES(msec) (msec * HZ / 1000) -#define JIFFIES_TO_MSECS(jiff) (jiff * 1000 / HZ) +#define MSECS_TO_JIFFIES(msec) \ + (((msec / 1000) * HZ) + ((msec % 1000) * HZ) / 1000) +#define JIFFIES_TO_MSECS(jiff) \ + (((jiff / HZ) * 1000) + ((jiff % HZ) * 1000) / HZ) /* * Function declarations. diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 2b62b1afef2a..60dea46dec21 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -268,15 +268,15 @@ struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc, struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, union sctp_addr *, struct sockaddr *, - int, int); + int, __u16); struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, union sctp_addr *addr); -struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association *asoc, - int serial, int vparam_len); - +struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc, + __u32 serial, int vparam_len); struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, - struct sctp_chunk *asconf, - int vparam_len); + struct sctp_chunk *asconf); +int sctp_process_asconf_ack(struct sctp_association *asoc, + struct sctp_chunk *asconf_ack); void sctp_chunk_assign_tsn(struct sctp_chunk *); void sctp_chunk_assign_ssn(struct sctp_chunk *); @@ -431,6 +431,21 @@ static inline int SSN_lte(__u16 s, __u16 t) return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); } +/* + * ADDIP 3.1.1 + * The valid range of Serial Number is from 0 to 4294967295 (2**32 - 1). Serial + * Numbers wrap back to 0 after reaching 4294967295. + */ +enum { + ADDIP_SERIAL_SIGN_BIT = (1<<31) +}; + +static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) +{ + return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); +} + + /* Run sctp_add_cmd() generating a BUG() if there is a failure. */ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) { diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index bf2745654d7a..92394f3de76a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -190,6 +190,9 @@ extern struct sctp_globals { */ struct list_head local_addr_list; spinlock_t local_addr_lock; + + /* Flag to indicate if addip is enabled. */ + int addip_enable; } sctp_globals; #define sctp_rto_initial (sctp_globals.rto_initial) @@ -217,6 +220,7 @@ extern struct sctp_globals { #define sctp_port_hashtable (sctp_globals.port_hashtable) #define sctp_local_addr_list (sctp_globals.local_addr_list) #define sctp_local_addr_lock (sctp_globals.local_addr_lock) +#define sctp_addip_enable (sctp_globals.addip_enable) /* SCTP Socket type: UDP or TCP style. */ typedef enum { @@ -1397,6 +1401,11 @@ struct sctp_association { /* Does peer support ADDIP? */ __u8 asconf_capable; + /* This mask is used to disable sending the ASCONF chunk + * with specified parameter to peer. + */ + __u16 addip_disabled_mask; + struct sctp_inithdr i; int cookie_len; void *cookie; @@ -1708,6 +1717,8 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, const union sctp_addr *address, const int gfp); +void sctp_assoc_del_peer(struct sctp_association *asoc, + const union sctp_addr *addr); void sctp_assoc_control_transport(struct sctp_association *, struct sctp_transport *, sctp_transport_cmd_t, sctp_sn_error_t); diff --git a/include/net/sock.h b/include/net/sock.h index 16e129f90426..115ace226a2a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -473,8 +473,8 @@ static __inline__ void sk_set_owner(struct sock *sk, struct module *owner) * change the ownership of this struct sock, with one not needed * transient sk_set_owner call. */ - if (unlikely(sk->sk_owner != NULL)) - BUG(); + BUG_ON(sk->sk_owner != NULL); + sk->sk_owner = owner; __module_get(owner); } diff --git a/include/net/tcp.h b/include/net/tcp.h index aeea9b268f80..4ef3b80fe541 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1457,7 +1457,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb) if (tp->ucopy.memory > sk->sk_rcvbuf) { struct sk_buff *skb1; - if (sock_owned_by_user(sk)) BUG(); + BUG_ON(sock_owned_by_user(sk)); while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { sk->sk_backlog_rcv(sk, skb1); diff --git a/include/rxrpc/call.h b/include/rxrpc/call.h index 6ac1df7012e9..9f0ce416a13e 100644 --- a/include/rxrpc/call.h +++ b/include/rxrpc/call.h @@ -187,8 +187,7 @@ extern int rxrpc_incoming_call(struct rxrpc_connection *conn, static inline void rxrpc_get_call(struct rxrpc_call *call) { - if (atomic_read(&call->usage)<=0) - BUG(); + BUG_ON(atomic_read(&call->usage)<=0); atomic_inc(&call->usage); /*printk("rxrpc_get_call(%p{u=%d})\n",(C),atomic_read(&(C)->usage));*/ } diff --git a/include/rxrpc/connection.h b/include/rxrpc/connection.h index 14de354724f9..f22e71097952 100644 --- a/include/rxrpc/connection.h +++ b/include/rxrpc/connection.h @@ -67,8 +67,7 @@ extern int rxrpc_connection_lookup(struct rxrpc_peer *peer, static inline void rxrpc_get_connection(struct rxrpc_connection *conn) { - if (atomic_read(&conn->usage)<0) - BUG(); + BUG_ON(atomic_read(&conn->usage)<0); atomic_inc(&conn->usage); //printk("rxrpc_get_conn(%p{u=%d})\n",conn,atomic_read(&conn->usage)); } diff --git a/include/rxrpc/message.h b/include/rxrpc/message.h index 9be208ab079e..d5755c6db3a8 100644 --- a/include/rxrpc/message.h +++ b/include/rxrpc/message.h @@ -53,8 +53,7 @@ struct rxrpc_message extern void __rxrpc_put_message(struct rxrpc_message *msg); static inline void rxrpc_put_message(struct rxrpc_message *msg) { - if (atomic_read(&msg->usage)<=0) - BUG(); + BUG_ON(atomic_read(&msg->usage)<=0); if (atomic_dec_and_test(&msg->usage)) __rxrpc_put_message(msg); } diff --git a/include/rxrpc/peer.h b/include/rxrpc/peer.h index 07e3a51b60b6..da4832fccd6a 100644 --- a/include/rxrpc/peer.h +++ b/include/rxrpc/peer.h @@ -72,8 +72,7 @@ extern int rxrpc_peer_lookup(struct rxrpc_transport *trans, static inline void rxrpc_get_peer(struct rxrpc_peer *peer) { - if (atomic_read(&peer->usage)<0) - BUG(); + BUG_ON(atomic_read(&peer->usage)<0); atomic_inc(&peer->usage); //printk("rxrpc_get_peer(%p{u=%d})\n",peer,atomic_read(&peer->usage)); } diff --git a/include/rxrpc/transport.h b/include/rxrpc/transport.h index 92fb49c7d4b9..6aa88691186c 100644 --- a/include/rxrpc/transport.h +++ b/include/rxrpc/transport.h @@ -85,8 +85,7 @@ extern int rxrpc_create_transport(unsigned short port, static inline void rxrpc_get_transport(struct rxrpc_transport *trans) { - if (atomic_read(&trans->usage) <= 0) - BUG(); + BUG_ON(atomic_read(&trans->usage) <= 0); atomic_inc(&trans->usage); //printk("rxrpc_get_transport(%p{u=%d})\n", // trans, atomic_read(&trans->usage)); diff --git a/include/sound/core.h b/include/sound/core.h index cbf5a1318769..00716c17d842 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -160,6 +160,7 @@ struct _snd_card { int shutdown; /* this card is going down */ wait_queue_head_t shutdown_sleep; struct work_struct free_workq; /* for free in workqueue */ + struct device *dev; #ifdef CONFIG_PM int (*set_power_state) (snd_card_t *card, unsigned int state); |
