diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-04-29 22:56:05 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-04-29 22:56:05 -0700 |
| commit | 7d5ab07dc7972ef5eb257864c422430c8b3df0bc (patch) | |
| tree | a0d36078e981cef69e789aac045b94fffd13174f /include | |
| parent | 25da53aa4497ccf38d2f17c9c28ca02583ddbe37 (diff) | |
| parent | 4ede0350ba7bc8682ceae0d256d8d8d5d244aecf (diff) | |
Merge kroah.com:/home/linux/linux/BK/bleed-2.5
into kroah.com:/home/linux/linux/BK/gregkh-2.5
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/cpufeature.h | 5 | ||||
| -rw-r--r-- | include/asm-i386/processor.h | 88 | ||||
| -rw-r--r-- | include/asm-i386/system.h | 40 | ||||
| -rw-r--r-- | include/asm-ppc/bug.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/cputable.h | 1 | ||||
| -rw-r--r-- | include/asm-ppc/delay.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/processor.h | 33 | ||||
| -rw-r--r-- | include/asm-ppc/system.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/xmon.h | 17 | ||||
| -rw-r--r-- | include/asm-sparc/bitext.h | 24 | ||||
| -rw-r--r-- | include/asm-sparc/iommu.h | 9 | ||||
| -rw-r--r-- | include/asm-sparc/pgtable.h | 28 | ||||
| -rw-r--r-- | include/asm-sparc/sbus.h | 2 | ||||
| -rw-r--r-- | include/linux/fs.h | 5 | ||||
| -rw-r--r-- | include/linux/gfp.h | 1 | ||||
| -rw-r--r-- | include/linux/ide.h | 2 | ||||
| -rw-r--r-- | include/linux/initrd.h | 2 | ||||
| -rw-r--r-- | include/linux/ioctl32.h | 7 | ||||
| -rw-r--r-- | include/linux/list.h | 4 | ||||
| -rw-r--r-- | include/linux/module.h | 63 | ||||
| -rw-r--r-- | include/linux/percpu_counter.h | 2 | ||||
| -rw-r--r-- | include/linux/slab.h | 7 | ||||
| -rw-r--r-- | include/net/irda/irport.h | 2 | ||||
| -rw-r--r-- | include/pcmcia/ds.h | 16 |
24 files changed, 303 insertions, 61 deletions
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index 46a85b395db8..040e1f66ea48 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h @@ -63,6 +63,11 @@ #define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ +/* cpu types for specific tunings: */ +#define X86_FEATURE_K8 (3*32+ 4) /* Opteron, Athlon64 */ +#define X86_FEATURE_K7 (3*32+ 5) /* Athlon */ +#define X86_FEATURE_P3 (3*32+ 6) /* P3 */ +#define X86_FEATURE_P4 (3*32+ 7) /* P4 */ /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index bc47e152108d..d69cc46d5866 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -15,6 +15,7 @@ #include <asm/sigcontext.h> #include <asm/cpufeature.h> #include <asm/msr.h> +#include <asm/system.h> #include <linux/cache.h> #include <linux/config.h> #include <linux/threads.h> @@ -495,32 +496,93 @@ static inline void rep_nop(void) #define cpu_relax() rep_nop() -/* Prefetch instructions for Pentium III and AMD Athlon */ -#ifdef CONFIG_X86_PREFETCH +/* generic versions from gas */ +#define GENERIC_NOP1 ".byte 0x90\n" +#define GENERIC_NOP2 ".byte 0x89,0xf6\n" +#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n" +#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n" +#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4 +#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n" +#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n" +#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7 + +/* Opteron nops */ +#define K8_NOP1 GENERIC_NOP1 +#define K8_NOP2 ".byte 0x66,0x90\n" +#define K8_NOP3 ".byte 0x66,0x66,0x90\n" +#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" +#define K8_NOP5 K8_NOP3 K8_NOP2 +#define K8_NOP6 K8_NOP3 K8_NOP3 +#define K8_NOP7 K8_NOP4 K8_NOP3 +#define K8_NOP8 K8_NOP4 K8_NOP4 + +/* K7 nops */ +/* uses eax dependencies (arbitary choice) */ +#define K7_NOP1 GENERIC_NOP1 +#define K7_NOP2 ".byte 0x8b,0xc0\n" +#define K7_NOP3 ".byte 0x8d,0x04,0x20\n" +#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n" +#define K7_NOP5 K7_NOP4 ASM_NOP1 +#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n" +#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" +#define K7_NOP8 K7_NOP7 ASM_NOP1 + +#ifdef CONFIG_MK8 +#define ASM_NOP1 K8_NOP1 +#define ASM_NOP2 K8_NOP2 +#define ASM_NOP3 K8_NOP3 +#define ASM_NOP4 K8_NOP4 +#define ASM_NOP5 K8_NOP5 +#define ASM_NOP6 K8_NOP6 +#define ASM_NOP7 K8_NOP7 +#define ASM_NOP8 K8_NOP8 +#elif CONFIG_MK7 +#define ASM_NOP1 K7_NOP1 +#define ASM_NOP2 K7_NOP2 +#define ASM_NOP3 K7_NOP3 +#define ASM_NOP4 K7_NOP4 +#define ASM_NOP5 K7_NOP5 +#define ASM_NOP6 K7_NOP6 +#define ASM_NOP7 K7_NOP7 +#define ASM_NOP8 K7_NOP8 +#else +#define ASM_NOP1 GENERIC_NOP1 +#define ASM_NOP2 GENERIC_NOP2 +#define ASM_NOP3 GENERIC_NOP3 +#define ASM_NOP4 GENERIC_NOP4 +#define ASM_NOP5 GENERIC_NOP5 +#define ASM_NOP6 GENERIC_NOP6 +#define ASM_NOP7 GENERIC_NOP7 +#define ASM_NOP8 GENERIC_NOP8 +#endif +#define ASM_NOP_MAX 8 + +/* Prefetch instructions for Pentium III and AMD Athlon */ +/* It's not worth to care about 3dnow! prefetches for the K6 + because they are microcoded there and very slow. */ #define ARCH_HAS_PREFETCH extern inline void prefetch(const void *x) { - __asm__ __volatile__ ("prefetchnta (%0)" : : "r"(x)); + alternative_input(ASM_NOP3, + "prefetchnta (%1)", + X86_FEATURE_XMM, + "r" (x)); } -#elif defined CONFIG_X86_USE_3DNOW - #define ARCH_HAS_PREFETCH #define ARCH_HAS_PREFETCHW #define ARCH_HAS_SPINLOCK_PREFETCH -extern inline void prefetch(const void *x) -{ - __asm__ __volatile__ ("prefetch (%0)" : : "r"(x)); -} - +/* 3dnow! prefetch to get an exclusive cache line. Useful for + spinlocks to avoid one state transition in the cache coherency protocol. */ extern inline void prefetchw(const void *x) { - __asm__ __volatile__ ("prefetchw (%0)" : : "r"(x)); + alternative_input(ASM_NOP3, + "prefetchw (%1)", + X86_FEATURE_3DNOW, + "r" (x)); } #define spin_lock_prefetch(x) prefetchw(x) -#endif - #endif /* __ASM_I386_PROCESSOR_H */ diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 5831f6d34ad7..71b9dd77ed04 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -277,13 +277,16 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, /* Compiling for a 386 proper. Is it worth implementing via cli/sti? */ #endif +#ifdef __KERNEL__ struct alt_instr { - u8 *instr; /* original instruction */ - u8 cpuid; /* cpuid bit set for replacement */ - u8 instrlen; /* length of original instruction */ - u8 replacementlen; /* length of new instruction, <= instrlen */ - u8 replacement[0]; /* new instruction */ + __u8 *instr; /* original instruction */ + __u8 *replacement; + __u8 cpuid; /* cpuid bit set for replacement */ + __u8 instrlen; /* length of original instruction */ + __u8 replacementlen; /* length of new instruction, <= instrlen */ + __u8 pad; }; +#endif /* * Alternative instructions for different CPU types or capabilities. @@ -302,13 +305,40 @@ struct alt_instr { ".section .altinstructions,\"a\"\n" \ " .align 4\n" \ " .long 661b\n" /* label */ \ + " .long 663f\n" /* new instruction */ \ " .byte %c0\n" /* feature bit */ \ " .byte 662b-661b\n" /* sourcelen */ \ " .byte 664f-663f\n" /* replacementlen */ \ + ".previous\n" \ + ".section .altinstr_replacement,\"ax\"\n" \ "663:\n\t" newinstr "\n664:\n" /* replacement */ \ ".previous" :: "i" (feature) : "memory") /* + * Alternative inline assembly with input. + * + * Pecularities: + * No memory clobber here. + * Argument numbers start with 1. + * Best is to use constraints that are fixed size (like (%1) ... "r") + * If you use variable sized constraints like "m" or "g" in the + * replacement maake sure to pad to the worst case length. + */ +#define alternative_input(oldinstr, newinstr, feature, input) \ + asm volatile ("661:\n\t" oldinstr "\n662:\n" \ + ".section .altinstructions,\"a\"\n" \ + " .align 4\n" \ + " .long 661b\n" /* label */ \ + " .long 663f\n" /* new instruction */ \ + " .byte %c0\n" /* feature bit */ \ + " .byte 662b-661b\n" /* sourcelen */ \ + " .byte 664f-663f\n" /* replacementlen */ \ + ".previous\n" \ + ".section .altinstr_replacement,\"ax\"\n" \ + "663:\n\t" newinstr "\n664:\n" /* replacement */ \ + ".previous" :: "i" (feature), input) + +/* * Force strict CPU ordering. * And yes, this is required on UP too when we're talking * to devices. diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h index 848c69a703b5..be916f56f9f2 100644 --- a/include/asm-ppc/bug.h +++ b/include/asm-ppc/bug.h @@ -2,7 +2,7 @@ #define _PPC_BUG_H #include <linux/config.h> -#include <asm/system.h> /* for xmon definition */ +#include <asm/xmon.h> #ifdef CONFIG_XMON extern void xmon(struct pt_regs *); diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h index 0818267600b1..4f82095103b9 100644 --- a/include/asm-ppc/cputable.h +++ b/include/asm-ppc/cputable.h @@ -74,6 +74,7 @@ extern struct cpu_spec *cur_cpu_spec[]; #define CPU_FTR_NAP_DISABLE_L2_PR 0x00002000 #define CPU_FTR_DUAL_PLL_750FX 0x00004000 #define CPU_FTR_NO_DPM 0x00008000 +#define CPU_FTR_HAS_HIGH_BATS 0x00010000 #ifdef __ASSEMBLY__ diff --git a/include/asm-ppc/delay.h b/include/asm-ppc/delay.h index 8660a9b79361..dc3715bfeff8 100644 --- a/include/asm-ppc/delay.h +++ b/include/asm-ppc/delay.h @@ -31,7 +31,7 @@ extern void __delay(unsigned int loops); * -- paulus */ #define __MAX_UDELAY (226050910/HZ) /* maximum udelay argument */ -#define __MAX_NDELAY (4294967295/HZ) /* maximum ndelay argument */ +#define __MAX_NDELAY (2147483647/HZ) /* maximum ndelay argument */ extern __inline__ void __udelay(unsigned int x) { diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index da0dff483ba7..c40d33d55f80 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -104,6 +104,15 @@ #define SPRN_DBAT2U 0x21C /* Data BAT 2 Upper Register */ #define SPRN_DBAT3L 0x21F /* Data BAT 3 Lower Register */ #define SPRN_DBAT3U 0x21E /* Data BAT 3 Upper Register */ +#define SPRN_DBAT4L 0x239 /* Data BAT 4 Lower Register */ +#define SPRN_DBAT4U 0x238 /* Data BAT 4 Upper Register */ +#define SPRN_DBAT5L 0x23B /* Data BAT 5 Lower Register */ +#define SPRN_DBAT5U 0x23A /* Data BAT 5 Upper Register */ +#define SPRN_DBAT6L 0x23D /* Data BAT 6 Lower Register */ +#define SPRN_DBAT6U 0x23C /* Data BAT 6 Upper Register */ +#define SPRN_DBAT7L 0x23F /* Data BAT 7 Lower Register */ +#define SPRN_DBAT7U 0x23E /* Data BAT 7 Upper Register */ + #define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */ #define DBCR_EDM 0x80000000 #define DBCR_IDM 0x40000000 @@ -267,6 +276,14 @@ #define SPRN_IBAT2U 0x214 /* Instruction BAT 2 Upper Register */ #define SPRN_IBAT3L 0x217 /* Instruction BAT 3 Lower Register */ #define SPRN_IBAT3U 0x216 /* Instruction BAT 3 Upper Register */ +#define SPRN_IBAT4L 0x231 /* Instruction BAT 4 Lower Register */ +#define SPRN_IBAT4U 0x230 /* Instruction BAT 4 Upper Register */ +#define SPRN_IBAT5L 0x233 /* Instruction BAT 5 Lower Register */ +#define SPRN_IBAT5U 0x232 /* Instruction BAT 5 Upper Register */ +#define SPRN_IBAT6L 0x235 /* Instruction BAT 6 Lower Register */ +#define SPRN_IBAT6U 0x234 /* Instruction BAT 6 Upper Register */ +#define SPRN_IBAT7L 0x237 /* Instruction BAT 7 Lower Register */ +#define SPRN_IBAT7U 0x236 /* Instruction BAT 7 Upper Register */ #define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */ #define ICCR_NOCACHE 0 /* Noncacheable */ #define ICCR_CACHE 1 /* Cacheable */ @@ -448,6 +465,14 @@ #define DBAT2U SPRN_DBAT2U /* Data BAT 2 Upper Register */ #define DBAT3L SPRN_DBAT3L /* Data BAT 3 Lower Register */ #define DBAT3U SPRN_DBAT3U /* Data BAT 3 Upper Register */ +#define DBAT4L SPRN_DBAT4L /* Data BAT 4 Lower Register */ +#define DBAT4U SPRN_DBAT4U /* Data BAT 4 Upper Register */ +#define DBAT5L SPRN_DBAT5L /* Data BAT 5 Lower Register */ +#define DBAT5U SPRN_DBAT5U /* Data BAT 5 Upper Register */ +#define DBAT6L SPRN_DBAT6L /* Data BAT 6 Lower Register */ +#define DBAT6U SPRN_DBAT6U /* Data BAT 6 Upper Register */ +#define DBAT7L SPRN_DBAT7L /* Data BAT 7 Lower Register */ +#define DBAT7U SPRN_DBAT7U /* Data BAT 7 Upper Register */ #define DCMP SPRN_DCMP /* Data TLB Compare Register */ #define DEC SPRN_DEC /* Decrement Register */ #define DMISS SPRN_DMISS /* Data TLB Miss Register */ @@ -466,6 +491,14 @@ #define IBAT2U SPRN_IBAT2U /* Instruction BAT 2 Upper Register */ #define IBAT3L SPRN_IBAT3L /* Instruction BAT 3 Lower Register */ #define IBAT3U SPRN_IBAT3U /* Instruction BAT 3 Upper Register */ +#define IBAT4L SPRN_IBAT4L /* Instruction BAT 4 Lower Register */ +#define IBAT4U SPRN_IBAT4U /* Instruction BAT 4 Upper Register */ +#define IBAT5L SPRN_IBAT5L /* Instruction BAT 5 Lower Register */ +#define IBAT5U SPRN_IBAT5U /* Instruction BAT 5 Upper Register */ +#define IBAT6L SPRN_IBAT6L /* Instruction BAT 6 Lower Register */ +#define IBAT6U SPRN_IBAT6U /* Instruction BAT 6 Upper Register */ +#define IBAT7L SPRN_IBAT7L /* Instruction BAT 7 Lower Register */ +#define IBAT7U SPRN_IBAT7U /* Instruction BAT 7 Upper Register */ #define ICMP SPRN_ICMP /* Instruction TLB Compare Register */ #define IMISS SPRN_IMISS /* Instruction TLB Miss Register */ #define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */ diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index baf8f1567836..ab113434de58 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -50,8 +50,6 @@ #endif /* CONFIG_SMP */ #ifdef __KERNEL__ -extern void xmon_irq(int, void *, struct pt_regs *); -extern void xmon(struct pt_regs *excp); extern void print_backtrace(unsigned long *); extern void show_regs(struct pt_regs * regs); extern void flush_instruction_cache(void); diff --git a/include/asm-ppc/xmon.h b/include/asm-ppc/xmon.h new file mode 100644 index 000000000000..042b83e6680d --- /dev/null +++ b/include/asm-ppc/xmon.h @@ -0,0 +1,17 @@ +#ifndef __PPC_XMON_H +#define __PPC_XMON_H +#ifdef __KERNEL__ + +struct pt_regs; + +extern void xmon(struct pt_regs *excp); +extern void xmon_printf(const char *fmt, ...); +extern void xmon_map_scc(void); +extern int xmon_bpt(struct pt_regs *regs); +extern int xmon_sstep(struct pt_regs *regs); +extern int xmon_iabr_match(struct pt_regs *regs); +extern int xmon_dabr_match(struct pt_regs *regs); +extern void (*xmon_fault_handler)(struct pt_regs *regs); + +#endif +#endif diff --git a/include/asm-sparc/bitext.h b/include/asm-sparc/bitext.h new file mode 100644 index 000000000000..88b1518834a8 --- /dev/null +++ b/include/asm-sparc/bitext.h @@ -0,0 +1,24 @@ +/* + * bitext.h: Bit string operations on the sparc, specific to architecture. + * + * Copyright 2002 Pete Zaitcev <zaitcev@yahoo.com> + */ + +#ifndef _SPARC_BITEXT_H +#define _SPARC_BITEXT_H + +#include <linux/smp_lock.h> + +struct bit_map { + spinlock_t lock; + unsigned long *map; + int size; + int used; + int last_off; +}; + +extern int bit_map_string_get(struct bit_map *t, int len, int align); +extern void bit_map_clear(struct bit_map *t, int offset, int len); +extern void bit_map_init(struct bit_map *t, unsigned long *map, int size); + +#endif /* defined(_SPARC_BITEXT_H) */ diff --git a/include/asm-sparc/iommu.h b/include/asm-sparc/iommu.h index cf1d5b794833..8171362d56b9 100644 --- a/include/asm-sparc/iommu.h +++ b/include/asm-sparc/iommu.h @@ -6,6 +6,7 @@ #define _SPARC_IOMMU_H #include <asm/page.h> +#include <asm/bitext.h> /* The iommu handles all virtual to physical address translations * that occur between the SBUS and physical memory. Access by @@ -100,11 +101,11 @@ struct iommu_regs { struct iommu_struct { struct iommu_regs *regs; iopte_t *page_table; - iopte_t *lowest; /* to speed up searches... */ - unsigned long plow; /* For convenience */ unsigned long start; /* First managed virtual address */ unsigned long end; /* Last managed virtual address */ + + struct bit_map usemap; }; extern __inline__ void iommu_invalidate(struct iommu_regs *regs) @@ -112,9 +113,9 @@ extern __inline__ void iommu_invalidate(struct iommu_regs *regs) regs->tlbflush = 0; } -extern __inline__ void iommu_invalidate_page(struct iommu_regs *regs, unsigned long page) +extern __inline__ void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba) { - regs->pageflush = (page & PAGE_MASK); + regs->pageflush = (ba & PAGE_MASK); } #endif /* !(_SPARC_IOMMU_H) */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index c25c0d4f7461..137421b5bdc4 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -27,6 +27,7 @@ #ifndef __ASSEMBLY__ struct vm_area_struct; +struct page; extern void load_mmu(void); extern unsigned long calc_highpages(void); @@ -51,15 +52,30 @@ BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct scatterlist *, int, struct s /* * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep. + * + * The mmu_map_dma_area establishes two mappings in one go. + * These mappings point to pages normally mapped at 'va' (linear address). + * First mapping is for CPU visible address at 'a', uncached. + * This is an alias, but it works because it is an uncached mapping. + * Second mapping is for device visible address, or "bus" address. + * The bus address is returned at '*pba'. + * + * These functions seem distinct, but are hard to split. On sun4c, + * at least for now, 'a' is equal to bus address, and retured in *pba. + * On sun4m, page attributes depend on the CPU type, so we have to + * know if we are mapping RAM or I/O, so it has to be an additional argument + * to a separate mapping function for CPU visible mappings. */ -BTFIXUPDEF_CALL(void, mmu_map_dma_area, unsigned long va, __u32 addr, int len) -BTFIXUPDEF_CALL(unsigned long /*phys*/, mmu_translate_dvma, unsigned long busa) +BTFIXUPDEF_CALL(int, mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len) +BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa) BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, unsigned long busa, int len) -#define mmu_map_dma_area(va, ba,len) BTFIXUP_CALL(mmu_map_dma_area)(va,ba,len) +#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len) #define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len) #define mmu_translate_dvma(ba) BTFIXUP_CALL(mmu_translate_dvma)(ba) +/* + */ BTFIXUPDEF_SIMM13(pmd_shift) BTFIXUPDEF_SETHI(pmd_size) BTFIXUPDEF_SETHI(pmd_mask) @@ -377,6 +393,12 @@ BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, #define update_mmu_cache(vma,addr,pte) BTFIXUP_CALL(update_mmu_cache)(vma,addr,pte) +BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long, + unsigned long, unsigned int) +BTFIXUPDEF_CALL(void, sparc_unmapiorange, unsigned long, unsigned int) +#define sparc_mapiorange(bus,pa,va,len) BTFIXUP_CALL(sparc_mapiorange)(bus,pa,va,len) +#define sparc_unmapiorange(va,len) BTFIXUP_CALL(sparc_unmapiorange)(va,len) + extern int invalid_segment; /* Encode and de-code a swap entry */ diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h index bf09706e88ea..075c98e2bc56 100644 --- a/include/asm-sparc/sbus.h +++ b/include/asm-sparc/sbus.h @@ -10,7 +10,7 @@ #include <linux/ioport.h> #include <asm/oplib.h> -#include <asm/iommu.h> +/* #include <asm/iommu.h> */ /* Unused since we use opaque iommu (|io-unit) */ #include <asm/scatterlist.h> /* We scan which devices are on the SBus using the PROM node device diff --git a/include/linux/fs.h b/include/linux/fs.h index 572b92e6f443..b9b2cf5b69e8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *); /* fs/block_dev.c */ #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ extern const char *__bdevname(dev_t, char *buffer); -extern inline const char *bdevname(struct block_device *bdev, char *buffer) -{ - return __bdevname(bdev->bd_dev, buffer); -} +extern const char *bdevname(struct block_device *bdev, char *buffer); extern struct block_device *lookup_bdev(const char *); extern struct block_device *open_bdev_excl(const char *, int, int, void *); extern void close_bdev_excl(struct block_device *, int); diff --git a/include/linux/gfp.h b/include/linux/gfp.h index ade6d9e97475..be82baa340fa 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -31,6 +31,7 @@ #define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */ #define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */ #define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */ +#define __GFP_NO_GROW 0x2000 /* Slab internal usage */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) diff --git a/include/linux/ide.h b/include/linux/ide.h index 082fd9b7687b..f773ff4268a9 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1408,6 +1408,8 @@ typedef struct pkt_task_s { void *special; } pkt_task_t; +extern inline u32 ide_read_24(ide_drive_t *); + extern inline void SELECT_DRIVE(ide_drive_t *); extern inline void SELECT_INTERRUPT(ide_drive_t *); extern inline void SELECT_MASK(ide_drive_t *, int); diff --git a/include/linux/initrd.h b/include/linux/initrd.h index d1978c358b12..32452d53dac3 100644 --- a/include/linux/initrd.h +++ b/include/linux/initrd.h @@ -13,4 +13,6 @@ extern int rd_image_start; /* 1 if it is not an error if initrd_start < memory_start */ extern int initrd_below_start_ok; +/* free_initrd_mem always gets called with the next two as arguments.. */ extern unsigned long initrd_start, initrd_end; +extern void free_initrd_mem(unsigned long, unsigned long); diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h index 456494591a51..d03489f00793 100644 --- a/include/linux/ioctl32.h +++ b/include/linux/ioctl32.h @@ -19,5 +19,12 @@ extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned extern int unregister_ioctl32_conversion(unsigned int cmd); +typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *); + +struct ioctl_trans { + unsigned long cmd; + ioctl_trans_handler_t handler; + struct ioctl_trans *next; +}; #endif diff --git a/include/linux/list.h b/include/linux/list.h index a724f9bcbe4d..11b8674c14ff 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -437,6 +437,10 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node for (pos = (head)->first; pos; \ pos = pos->next) +#define hlist_for_each_safe(pos, n, head) \ + for (pos = (head)->first; n = pos ? pos->next : 0, pos; \ + pos = n) + #else #warning "don't include kernel headers in userspace" #endif /* __KERNEL__ */ diff --git a/include/linux/module.h b/include/linux/module.h index 657802c8af75..4ddc5edcd22f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -20,10 +20,7 @@ #include <asm/module.h> /* Not Yet Implemented */ -#define MODULE_AUTHOR(name) -#define MODULE_DESCRIPTION(desc) #define MODULE_SUPPORTED_DEVICE(name) -#define MODULE_PARM_DESC(var,desc) #define print_modules() /* v850 toolchain uses a `_' prefix for all user symbols */ @@ -58,12 +55,11 @@ search_extable(const struct exception_table_entry *first, unsigned long value); #ifdef MODULE -#define ___module_cat(a,b) a ## b +#define ___module_cat(a,b) __mod_ ## a ## b #define __module_cat(a,b) ___module_cat(a,b) -/* For userspace: you can also call me... */ -#define MODULE_ALIAS(alias) \ - static const char __module_cat(__alias_,__LINE__)[] \ - __attribute__((section(".modinfo"),unused)) = "alias=" alias +#define __MODULE_INFO(tag, name, info) \ +static const char __module_cat(name,__LINE__)[] \ + __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info #define MODULE_GENERIC_TABLE(gtype,name) \ extern const struct gtype##_id __mod_##gtype##_table \ @@ -71,6 +67,19 @@ extern const struct gtype##_id __mod_##gtype##_table \ #define THIS_MODULE (&__this_module) +#else /* !MODULE */ + +#define MODULE_GENERIC_TABLE(gtype,name) +#define __MODULE_INFO(tag, name, info) +#define THIS_MODULE ((struct module *)0) +#endif + +/* Generic info of form tag = "info" */ +#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) + +/* For userspace: you can also call me... */ +#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) + /* * The following license idents are currently accepted as indicating free * software modules @@ -97,17 +106,18 @@ extern const struct gtype##_id __mod_##gtype##_table \ * 2. So the community can ignore bug reports including proprietary modules * 3. So vendors can do likewise based on their own policies */ -#define MODULE_LICENSE(license) \ - static const char __module_license[] \ - __attribute__((section(".init.license"), unused)) = license +#define MODULE_LICENSE(_license) MODULE_INFO(license, _license) -#else /* !MODULE */ +/* Author, ideally of form NAME <EMAIL>[, NAME <EMAIL>]*[ and NAME <EMAIL>] */ +#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) + +/* What your module does. */ +#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) -#define MODULE_ALIAS(alias) -#define MODULE_GENERIC_TABLE(gtype,name) -#define THIS_MODULE ((struct module *)0) -#define MODULE_LICENSE(license) -#endif +/* One for each parameter, describing how to use it. Some files do + multiple of these per line, so can't just use MODULE_INFO. */ +#define MODULE_PARM_DESC(_parm, desc) \ + __MODULE_INFO(parm, _parm, #_parm ":" desc) #define MODULE_DEVICE_TABLE(type,name) \ MODULE_GENERIC_TABLE(type##_device,name) @@ -255,6 +265,7 @@ struct module *module_text_address(unsigned long addr); #ifdef CONFIG_MODULE_UNLOAD +unsigned int module_refcount(struct module *mod); void __symbol_put(const char *symbol); #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) void symbol_put_addr(void *addr); @@ -265,6 +276,17 @@ void symbol_put_addr(void *addr); #define local_dec(x) atomic_dec(x) #endif +/* Sometimes we know we already have a refcount, and it's easier not + to handle the error case (which only happens with rmmod --wait). */ +static inline void __module_get(struct module *module) +{ + if (module) { + BUG_ON(module_refcount(module) == 0); + local_inc(&module->ref[get_cpu()].count); + put_cpu(); + } +} + static inline int try_module_get(struct module *module) { int ret = 1; @@ -300,6 +322,9 @@ static inline int try_module_get(struct module *module) static inline void module_put(struct module *module) { } +static inline void __module_get(struct module *module) +{ +} #define symbol_put(x) do { } while(0) #define symbol_put_addr(p) do { } while(0) @@ -357,6 +382,10 @@ static inline struct module *module_text_address(unsigned long addr) #define symbol_put(x) do { } while(0) #define symbol_put_addr(x) do { } while(0) +static inline void __module_get(struct module *module) +{ +} + static inline int try_module_get(struct module *module) { return 1; diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 69d0a66b662e..53c52176c391 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h @@ -7,7 +7,7 @@ #include <linux/config.h> #include <linux/spinlock.h> #include <linux/smp.h> -#include <linux/preempt.h> +#include <linux/threads.h> #ifdef CONFIG_SMP diff --git a/include/linux/slab.h b/include/linux/slab.h index 603748b9b349..49374df2d450 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -22,8 +22,11 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_KERNEL GFP_KERNEL #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY) -#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ + __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|\ + __GFP_NOFAIL|__GFP_NORETRY) + +#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */ /* flags to pass to kmem_cache_create(). * The first 3 are only valid when the allocator as been build diff --git a/include/net/irda/irport.h b/include/net/irda/irport.h index e5877f66fab8..79b4d8904346 100644 --- a/include/net/irda/irport.h +++ b/include/net/irda/irport.h @@ -73,7 +73,7 @@ struct irport_cb { /* For piggyback drivers */ void *priv; void (*change_speed)(void *priv, __u32 speed); - void (*interrupt)(int irq, void *dev_id, struct pt_regs *regs); + int (*interrupt)(int irq, void *dev_id, struct pt_regs *regs); }; struct irport_cb *irport_open(int i, unsigned int iobase, unsigned int irq); diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 87c8e809915b..43732400e3bc 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -141,11 +141,6 @@ typedef struct dev_link_t { #define DEV_OK(l) \ ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) -int register_pccard_driver(dev_info_t *dev_info, - dev_link_t *(*attach)(void), - void (*detach)(dev_link_t *)); - -int unregister_pccard_driver(dev_info_t *dev_info); extern struct bus_type pcmcia_bus_type; @@ -157,9 +152,18 @@ struct pcmcia_driver { struct device_driver drv; }; +/* driver registration */ int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); -#endif /* __KERNEL__ */ +/* legacy driver registration interface. don't use in new code */ +int register_pccard_driver(dev_info_t *dev_info, + dev_link_t *(*attach)(void), + void (*detach)(dev_link_t *)); +int unregister_pccard_driver(dev_info_t *dev_info); + +/* error reporting */ +void cs_error(client_handle_t handle, int func, int ret); +#endif /* __KERNEL__ */ #endif /* _LINUX_DS_H */ |
