diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-22 19:13:54 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-22 19:13:54 -0500 |
commit | f01c18456993bab43067b678f56c87ca954aa43b (patch) | |
tree | 3e0cd0cdf1a57618202b46a7126125902e3ab832 /include | |
parent | 949ec2c8e6b7b89179b85baf6309c009e1a1b951 (diff) | |
parent | 1c2e02750b992703a8a18634e08b04353face243 (diff) |
Merge branch 'master'
Diffstat (limited to 'include')
66 files changed, 431 insertions, 248 deletions
diff --git a/include/asm-arm/arch-pxa/audio.h b/include/asm-arm/arch-pxa/audio.h index 60976f830e3f..17eccd720136 100644 --- a/include/asm-arm/arch-pxa/audio.h +++ b/include/asm-arm/arch-pxa/audio.h | |||
@@ -6,8 +6,8 @@ | |||
6 | #include <sound/pcm.h> | 6 | #include <sound/pcm.h> |
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | int (*startup)(snd_pcm_substream_t *, void *); | 9 | int (*startup)(struct snd_pcm_substream *, void *); |
10 | void (*shutdown)(snd_pcm_substream_t *, void *); | 10 | void (*shutdown)(struct snd_pcm_substream *, void *); |
11 | void (*suspend)(void *); | 11 | void (*suspend)(void *); |
12 | void (*resume)(void *); | 12 | void (*resume)(void *); |
13 | void *priv; | 13 | void *priv; |
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 55059abf9c95..20f523954218 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h | |||
@@ -103,6 +103,12 @@ __acpi_release_global_lock (unsigned int *lock) | |||
103 | :"=r"(n_hi), "=r"(n_lo) \ | 103 | :"=r"(n_hi), "=r"(n_lo) \ |
104 | :"0"(n_hi), "1"(n_lo)) | 104 | :"0"(n_hi), "1"(n_lo)) |
105 | 105 | ||
106 | #ifdef CONFIG_X86_IO_APIC | ||
107 | extern void check_acpi_pci(void); | ||
108 | #else | ||
109 | static inline void check_acpi_pci(void) { } | ||
110 | #endif | ||
111 | |||
106 | #ifdef CONFIG_ACPI | 112 | #ifdef CONFIG_ACPI |
107 | extern int acpi_lapic; | 113 | extern int acpi_lapic; |
108 | extern int acpi_ioapic; | 114 | extern int acpi_ioapic; |
@@ -128,8 +134,6 @@ extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); | |||
128 | extern int skip_ioapic_setup; | 134 | extern int skip_ioapic_setup; |
129 | extern int acpi_skip_timer_override; | 135 | extern int acpi_skip_timer_override; |
130 | 136 | ||
131 | extern void check_acpi_pci(void); | ||
132 | |||
133 | static inline void disable_ioapic_setup(void) | 137 | static inline void disable_ioapic_setup(void) |
134 | { | 138 | { |
135 | skip_ioapic_setup = 1; | 139 | skip_ioapic_setup = 1; |
@@ -142,8 +146,6 @@ static inline int ioapic_setup_disabled(void) | |||
142 | 146 | ||
143 | #else | 147 | #else |
144 | static inline void disable_ioapic_setup(void) { } | 148 | static inline void disable_ioapic_setup(void) { } |
145 | static inline void check_acpi_pci(void) { } | ||
146 | |||
147 | #endif | 149 | #endif |
148 | 150 | ||
149 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } | 151 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 088a945bf26b..ee056c41a9fb 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -219,13 +219,12 @@ extern unsigned long pg0[]; | |||
219 | * The following only work if pte_present() is true. | 219 | * The following only work if pte_present() is true. |
220 | * Undefined behaviour if not.. | 220 | * Undefined behaviour if not.. |
221 | */ | 221 | */ |
222 | #define __LARGE_PTE (_PAGE_PSE | _PAGE_PRESENT) | ||
223 | static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } | 222 | static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } |
224 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } | 223 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } |
225 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } | 224 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } |
226 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } | 225 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } |
227 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } | 226 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } |
228 | static inline int pte_huge(pte_t pte) { return ((pte).pte_low & __LARGE_PTE) == __LARGE_PTE; } | 227 | static inline int pte_huge(pte_t pte) { return (pte).pte_low & _PAGE_PSE; } |
229 | 228 | ||
230 | /* | 229 | /* |
231 | * The following only works if pte_present() is not true. | 230 | * The following only works if pte_present() is not true. |
@@ -242,7 +241,7 @@ static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return | |||
242 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } | 241 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } |
243 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } | 242 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } |
244 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } | 243 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } |
245 | static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= __LARGE_PTE; return pte; } | 244 | static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; } |
246 | 245 | ||
247 | #ifdef CONFIG_X86_PAE | 246 | #ifdef CONFIG_X86_PAE |
248 | # include <asm/pgtable-3level.h> | 247 | # include <asm/pgtable-3level.h> |
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 5e6362a786b7..3ab27333dae4 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
@@ -57,6 +57,8 @@ | |||
57 | 57 | ||
58 | # define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | 58 | # define HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
59 | # define ARCH_HAS_HUGEPAGE_ONLY_RANGE | 59 | # define ARCH_HAS_HUGEPAGE_ONLY_RANGE |
60 | # define ARCH_HAS_PREPARE_HUGEPAGE_RANGE | ||
61 | # define ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
60 | #endif /* CONFIG_HUGETLB_PAGE */ | 62 | #endif /* CONFIG_HUGETLB_PAGE */ |
61 | 63 | ||
62 | #ifdef __ASSEMBLY__ | 64 | #ifdef __ASSEMBLY__ |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index e2560c58384b..c0f8144f2349 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -314,7 +314,7 @@ ia64_phys_addr_valid (unsigned long addr) | |||
314 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) | 314 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) |
315 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) | 315 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) |
316 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_D)) | 316 | #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_D)) |
317 | #define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_P)) | 317 | #define pte_mkhuge(pte) (__pte(pte_val(pte))) |
318 | 318 | ||
319 | /* | 319 | /* |
320 | * Macro to a page protection value as "uncacheable". Note that "protection" is really a | 320 | * Macro to a page protection value as "uncacheable". Note that "protection" is really a |
@@ -505,9 +505,6 @@ extern struct page *zero_page_memmap_ptr; | |||
505 | #define HUGETLB_PGDIR_SHIFT (HPAGE_SHIFT + 2*(PAGE_SHIFT-3)) | 505 | #define HUGETLB_PGDIR_SHIFT (HPAGE_SHIFT + 2*(PAGE_SHIFT-3)) |
506 | #define HUGETLB_PGDIR_SIZE (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT) | 506 | #define HUGETLB_PGDIR_SIZE (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT) |
507 | #define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) | 507 | #define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) |
508 | struct mmu_gather; | ||
509 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
510 | unsigned long end, unsigned long floor, unsigned long ceiling); | ||
511 | #endif | 508 | #endif |
512 | 509 | ||
513 | /* | 510 | /* |
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h index c29c65b7818e..fa6d04dac56b 100644 --- a/include/asm-mips/termbits.h +++ b/include/asm-mips/termbits.h | |||
@@ -77,7 +77,7 @@ struct termios { | |||
77 | #define IXANY 0004000 /* Any character will restart after stop. */ | 77 | #define IXANY 0004000 /* Any character will restart after stop. */ |
78 | #define IXOFF 0010000 /* Enable start/stop input control. */ | 78 | #define IXOFF 0010000 /* Enable start/stop input control. */ |
79 | #define IMAXBEL 0020000 /* Ring bell when input queue is full. */ | 79 | #define IMAXBEL 0020000 /* Ring bell when input queue is full. */ |
80 | #define IUTF8 0040000 /* Input is UTF8 */ | 80 | #define IUTF8 0040000 /* Input is UTF-8 */ |
81 | 81 | ||
82 | /* c_oflag bits */ | 82 | /* c_oflag bits */ |
83 | #define OPOST 0000001 /* Perform output processing. */ | 83 | #define OPOST 0000001 /* Perform output processing. */ |
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index e38931379a72..185ee15963a1 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h | |||
@@ -468,11 +468,6 @@ extern pgd_t swapper_pg_dir[]; | |||
468 | 468 | ||
469 | extern void paging_init(void); | 469 | extern void paging_init(void); |
470 | 470 | ||
471 | #ifdef CONFIG_HUGETLB_PAGE | ||
472 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | ||
473 | free_pgd_range(tlb, addr, end, floor, ceiling) | ||
474 | #endif | ||
475 | |||
476 | /* | 471 | /* |
477 | * This gets called at the end of handling a page fault, when | 472 | * This gets called at the end of handling a page fault, when |
478 | * the kernel has put a new PTE into the page table for the process. | 473 | * the kernel has put a new PTE into the page table for the process. |
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h index 3417dd71ab43..e28aaf28e4a8 100644 --- a/include/asm-s390/pgalloc.h +++ b/include/asm-s390/pgalloc.h | |||
@@ -158,11 +158,4 @@ static inline void pte_free(struct page *pte) | |||
158 | 158 | ||
159 | #define __pte_free_tlb(tlb,pte) tlb_remove_page(tlb,pte) | 159 | #define __pte_free_tlb(tlb,pte) tlb_remove_page(tlb,pte) |
160 | 160 | ||
161 | /* | ||
162 | * This establishes kernel virtual mappings (e.g., as a result of a | ||
163 | * vmalloc call). Since s390-esame uses a separate kernel page table, | ||
164 | * there is nothing to do here... :) | ||
165 | */ | ||
166 | #define set_pgdir(addr,entry) do { } while(0) | ||
167 | |||
168 | #endif /* _S390_PGALLOC_H */ | 161 | #endif /* _S390_PGALLOC_H */ |
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h index 678251ac1db8..b29dd468817e 100644 --- a/include/asm-sh64/pgalloc.h +++ b/include/asm-sh64/pgalloc.h | |||
@@ -167,22 +167,6 @@ static __inline__ void pmd_free(pmd_t *pmd) | |||
167 | 167 | ||
168 | extern int do_check_pgt_cache(int, int); | 168 | extern int do_check_pgt_cache(int, int); |
169 | 169 | ||
170 | static inline void set_pgdir(unsigned long address, pgd_t entry) | ||
171 | { | ||
172 | struct task_struct * p; | ||
173 | pgd_t *pgd; | ||
174 | |||
175 | read_lock(&tasklist_lock); | ||
176 | for_each_process(p) { | ||
177 | if (!p->mm) | ||
178 | continue; | ||
179 | *pgd_offset(p->mm,address) = entry; | ||
180 | } | ||
181 | read_unlock(&tasklist_lock); | ||
182 | for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd) | ||
183 | pgd[address >> PGDIR_SHIFT] = entry; | ||
184 | } | ||
185 | |||
186 | #define pmd_populate_kernel(mm, pmd, pte) \ | 170 | #define pmd_populate_kernel(mm, pmd, pte) \ |
187 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) | 171 | set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) |
188 | 172 | ||
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index b33c35411e82..9eea8f4d41f0 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
@@ -269,11 +269,14 @@ BTFIXUPDEF_CALL_CONST(pte_t, mk_pte, struct page *, pgprot_t) | |||
269 | 269 | ||
270 | BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_phys, unsigned long, pgprot_t) | 270 | BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_phys, unsigned long, pgprot_t) |
271 | BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) | 271 | BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) |
272 | BTFIXUPDEF_CALL_CONST(pgprot_t, pgprot_noncached, pgprot_t) | ||
272 | 273 | ||
273 | #define mk_pte(page,pgprot) BTFIXUP_CALL(mk_pte)(page,pgprot) | 274 | #define mk_pte(page,pgprot) BTFIXUP_CALL(mk_pte)(page,pgprot) |
274 | #define mk_pte_phys(page,pgprot) BTFIXUP_CALL(mk_pte_phys)(page,pgprot) | 275 | #define mk_pte_phys(page,pgprot) BTFIXUP_CALL(mk_pte_phys)(page,pgprot) |
275 | #define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space) | 276 | #define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space) |
276 | 277 | ||
278 | #define pgprot_noncached(pgprot) BTFIXUP_CALL(pgprot_noncached)(pgprot) | ||
279 | |||
277 | BTFIXUPDEF_INT(pte_modify_mask) | 280 | BTFIXUPDEF_INT(pte_modify_mask) |
278 | 281 | ||
279 | static pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; | 282 | static pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; |
@@ -309,9 +312,6 @@ BTFIXUPDEF_CALL(pte_t *, pte_offset_kernel, pmd_t *, unsigned long) | |||
309 | #define pte_unmap(pte) do{}while(0) | 312 | #define pte_unmap(pte) do{}while(0) |
310 | #define pte_unmap_nested(pte) do{}while(0) | 313 | #define pte_unmap_nested(pte) do{}while(0) |
311 | 314 | ||
312 | /* The permissions for pgprot_val to make a page mapped on the obio space */ | ||
313 | extern unsigned int pg_iobits; | ||
314 | |||
315 | /* Certain architectures need to do special things when pte's | 315 | /* Certain architectures need to do special things when pte's |
316 | * within a page table are directly modified. Thus, the following | 316 | * within a page table are directly modified. Thus, the following |
317 | * hook is made available. | 317 | * hook is made available. |
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index c66a81bbc84d..9d6a6dbaf126 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
@@ -71,7 +71,8 @@ struct trap_per_cpu { | |||
71 | /* Dcache line 7: Physical addresses of CPU send mondo block and CPU list. */ | 71 | /* Dcache line 7: Physical addresses of CPU send mondo block and CPU list. */ |
72 | unsigned long cpu_mondo_block_pa; | 72 | unsigned long cpu_mondo_block_pa; |
73 | unsigned long cpu_list_pa; | 73 | unsigned long cpu_list_pa; |
74 | unsigned long __pad1[2]; | 74 | unsigned long tsb_huge; |
75 | unsigned long tsb_huge_temp; | ||
75 | 76 | ||
76 | /* Dcache line 8: Unused, needed to keep trap_block a power-of-2 in size. */ | 77 | /* Dcache line 8: Unused, needed to keep trap_block a power-of-2 in size. */ |
77 | unsigned long __pad2[4]; | 78 | unsigned long __pad2[4]; |
@@ -116,6 +117,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch, | |||
116 | #define TRAP_PER_CPU_FAULT_INFO 0x40 | 117 | #define TRAP_PER_CPU_FAULT_INFO 0x40 |
117 | #define TRAP_PER_CPU_CPU_MONDO_BLOCK_PA 0xc0 | 118 | #define TRAP_PER_CPU_CPU_MONDO_BLOCK_PA 0xc0 |
118 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 | 119 | #define TRAP_PER_CPU_CPU_LIST_PA 0xc8 |
120 | #define TRAP_PER_CPU_TSB_HUGE 0xd0 | ||
121 | #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 | ||
119 | 122 | ||
120 | #define TRAP_BLOCK_SZ_SHIFT 8 | 123 | #define TRAP_BLOCK_SZ_SHIFT 8 |
121 | 124 | ||
diff --git a/include/asm-sparc64/mmu.h b/include/asm-sparc64/mmu.h index 230ba678d3b0..2d4f2ea9568a 100644 --- a/include/asm-sparc64/mmu.h +++ b/include/asm-sparc64/mmu.h | |||
@@ -90,18 +90,39 @@ extern void __tsb_insert(unsigned long ent, unsigned long tag, unsigned long pte | |||
90 | extern void tsb_flush(unsigned long ent, unsigned long tag); | 90 | extern void tsb_flush(unsigned long ent, unsigned long tag); |
91 | extern void tsb_init(struct tsb *tsb, unsigned long size); | 91 | extern void tsb_init(struct tsb *tsb, unsigned long size); |
92 | 92 | ||
93 | typedef struct { | 93 | struct tsb_config { |
94 | spinlock_t lock; | ||
95 | unsigned long sparc64_ctx_val; | ||
96 | struct tsb *tsb; | 94 | struct tsb *tsb; |
97 | unsigned long tsb_rss_limit; | 95 | unsigned long tsb_rss_limit; |
98 | unsigned long tsb_nentries; | 96 | unsigned long tsb_nentries; |
99 | unsigned long tsb_reg_val; | 97 | unsigned long tsb_reg_val; |
100 | unsigned long tsb_map_vaddr; | 98 | unsigned long tsb_map_vaddr; |
101 | unsigned long tsb_map_pte; | 99 | unsigned long tsb_map_pte; |
102 | struct hv_tsb_descr tsb_descr; | 100 | }; |
101 | |||
102 | #define MM_TSB_BASE 0 | ||
103 | |||
104 | #ifdef CONFIG_HUGETLB_PAGE | ||
105 | #define MM_TSB_HUGE 1 | ||
106 | #define MM_NUM_TSBS 2 | ||
107 | #else | ||
108 | #define MM_NUM_TSBS 1 | ||
109 | #endif | ||
110 | |||
111 | typedef struct { | ||
112 | spinlock_t lock; | ||
113 | unsigned long sparc64_ctx_val; | ||
114 | unsigned long huge_pte_count; | ||
115 | struct tsb_config tsb_block[MM_NUM_TSBS]; | ||
116 | struct hv_tsb_descr tsb_descr[MM_NUM_TSBS]; | ||
103 | } mm_context_t; | 117 | } mm_context_t; |
104 | 118 | ||
105 | #endif /* !__ASSEMBLY__ */ | 119 | #endif /* !__ASSEMBLY__ */ |
106 | 120 | ||
121 | #define TSB_CONFIG_TSB 0x00 | ||
122 | #define TSB_CONFIG_RSS_LIMIT 0x08 | ||
123 | #define TSB_CONFIG_NENTRIES 0x10 | ||
124 | #define TSB_CONFIG_REG_VAL 0x18 | ||
125 | #define TSB_CONFIG_MAP_VADDR 0x20 | ||
126 | #define TSB_CONFIG_MAP_PTE 0x28 | ||
127 | |||
107 | #endif /* __MMU_H */ | 128 | #endif /* __MMU_H */ |
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index e7974321d052..2337eb487719 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h | |||
@@ -29,20 +29,25 @@ extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); | |||
29 | extern void destroy_context(struct mm_struct *mm); | 29 | extern void destroy_context(struct mm_struct *mm); |
30 | 30 | ||
31 | extern void __tsb_context_switch(unsigned long pgd_pa, | 31 | extern void __tsb_context_switch(unsigned long pgd_pa, |
32 | unsigned long tsb_reg, | 32 | struct tsb_config *tsb_base, |
33 | unsigned long tsb_vaddr, | 33 | struct tsb_config *tsb_huge, |
34 | unsigned long tsb_pte, | ||
35 | unsigned long tsb_descr_pa); | 34 | unsigned long tsb_descr_pa); |
36 | 35 | ||
37 | static inline void tsb_context_switch(struct mm_struct *mm) | 36 | static inline void tsb_context_switch(struct mm_struct *mm) |
38 | { | 37 | { |
39 | __tsb_context_switch(__pa(mm->pgd), mm->context.tsb_reg_val, | 38 | __tsb_context_switch(__pa(mm->pgd), |
40 | mm->context.tsb_map_vaddr, | 39 | &mm->context.tsb_block[0], |
41 | mm->context.tsb_map_pte, | 40 | #ifdef CONFIG_HUGETLB_PAGE |
42 | __pa(&mm->context.tsb_descr)); | 41 | (mm->context.tsb_block[1].tsb ? |
42 | &mm->context.tsb_block[1] : | ||
43 | NULL) | ||
44 | #else | ||
45 | NULL | ||
46 | #endif | ||
47 | , __pa(&mm->context.tsb_descr[0])); | ||
43 | } | 48 | } |
44 | 49 | ||
45 | extern void tsb_grow(struct mm_struct *mm, unsigned long mm_rss); | 50 | extern void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long mm_rss); |
46 | #ifdef CONFIG_SMP | 51 | #ifdef CONFIG_SMP |
47 | extern void smp_tsb_sync(struct mm_struct *mm); | 52 | extern void smp_tsb_sync(struct mm_struct *mm); |
48 | #else | 53 | #else |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index fcb2812265f4..66fe4ac59fd6 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -30,6 +30,23 @@ | |||
30 | 30 | ||
31 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
32 | 32 | ||
33 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) | ||
34 | #define HPAGE_SHIFT 22 | ||
35 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) | ||
36 | #define HPAGE_SHIFT 19 | ||
37 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
38 | #define HPAGE_SHIFT 16 | ||
39 | #endif | ||
40 | |||
41 | #ifdef CONFIG_HUGETLB_PAGE | ||
42 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) | ||
43 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) | ||
44 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
45 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
46 | #define ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
47 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | ||
48 | #endif | ||
49 | |||
33 | #ifndef __ASSEMBLY__ | 50 | #ifndef __ASSEMBLY__ |
34 | 51 | ||
35 | extern void _clear_page(void *page); | 52 | extern void _clear_page(void *page); |
@@ -90,23 +107,6 @@ typedef unsigned long pgprot_t; | |||
90 | 107 | ||
91 | #endif /* (STRICT_MM_TYPECHECKS) */ | 108 | #endif /* (STRICT_MM_TYPECHECKS) */ |
92 | 109 | ||
93 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) | ||
94 | #define HPAGE_SHIFT 22 | ||
95 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) | ||
96 | #define HPAGE_SHIFT 19 | ||
97 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | ||
98 | #define HPAGE_SHIFT 16 | ||
99 | #endif | ||
100 | |||
101 | #ifdef CONFIG_HUGETLB_PAGE | ||
102 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) | ||
103 | #define HPAGE_MASK (~(HPAGE_SIZE - 1UL)) | ||
104 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
105 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
106 | #define ARCH_HAS_HUGETLB_PREFAULT_HOOK | ||
107 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | ||
108 | #endif | ||
109 | |||
110 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ | 110 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ |
111 | (_AC(0x0000000070000000,UL)) : \ | 111 | (_AC(0x0000000070000000,UL)) : \ |
112 | (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) | 112 | (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index ed4124edf837..c44e7466534e 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -105,6 +105,7 @@ | |||
105 | #define _PAGE_RES1_4U _AC(0x0002000000000000,UL) /* Reserved */ | 105 | #define _PAGE_RES1_4U _AC(0x0002000000000000,UL) /* Reserved */ |
106 | #define _PAGE_SZ32MB_4U _AC(0x0001000000000000,UL) /* (Panther) 32MB page */ | 106 | #define _PAGE_SZ32MB_4U _AC(0x0001000000000000,UL) /* (Panther) 32MB page */ |
107 | #define _PAGE_SZ256MB_4U _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ | 107 | #define _PAGE_SZ256MB_4U _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ |
108 | #define _PAGE_SZALL_4U _AC(0x6001000000000000,UL) /* All pgsz bits */ | ||
108 | #define _PAGE_SN_4U _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ | 109 | #define _PAGE_SN_4U _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ |
109 | #define _PAGE_RES2_4U _AC(0x0000780000000000,UL) /* Reserved */ | 110 | #define _PAGE_RES2_4U _AC(0x0000780000000000,UL) /* Reserved */ |
110 | #define _PAGE_PADDR_4U _AC(0x000007FFFFFFE000,UL) /* (Cheetah) pa[42:13] */ | 111 | #define _PAGE_PADDR_4U _AC(0x000007FFFFFFE000,UL) /* (Cheetah) pa[42:13] */ |
@@ -150,6 +151,7 @@ | |||
150 | #define _PAGE_SZ512K_4V _AC(0x0000000000000002,UL) /* 512K Page */ | 151 | #define _PAGE_SZ512K_4V _AC(0x0000000000000002,UL) /* 512K Page */ |
151 | #define _PAGE_SZ64K_4V _AC(0x0000000000000001,UL) /* 64K Page */ | 152 | #define _PAGE_SZ64K_4V _AC(0x0000000000000001,UL) /* 64K Page */ |
152 | #define _PAGE_SZ8K_4V _AC(0x0000000000000000,UL) /* 8K Page */ | 153 | #define _PAGE_SZ8K_4V _AC(0x0000000000000000,UL) /* 8K Page */ |
154 | #define _PAGE_SZALL_4V _AC(0x0000000000000007,UL) /* All pgsz bits */ | ||
153 | 155 | ||
154 | #if PAGE_SHIFT == 13 | 156 | #if PAGE_SHIFT == 13 |
155 | #define _PAGE_SZBITS_4U _PAGE_SZ8K_4U | 157 | #define _PAGE_SZBITS_4U _PAGE_SZ8K_4U |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 715fd94cf577..a617d364d08d 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -273,7 +273,7 @@ static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | |||
273 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 273 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
274 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 274 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
275 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 275 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
276 | static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; } | 276 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } |
277 | 277 | ||
278 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 278 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
279 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 279 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
@@ -285,7 +285,7 @@ static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _ | |||
285 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 285 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
286 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 286 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
287 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } | 287 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } |
288 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | __LARGE_PTE)); return pte; } | 288 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_PSE)); return pte; } |
289 | 289 | ||
290 | struct vm_area_struct; | 290 | struct vm_area_struct; |
291 | 291 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 5b595fdfb672..f6e72a65a3f2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev); | |||
378 | extern void device_release_driver(struct device * dev); | 378 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 379 | extern int device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
381 | extern void device_reprobe(struct device *dev); | ||
381 | 382 | ||
382 | 383 | ||
383 | /* | 384 | /* |
@@ -399,7 +400,7 @@ extern struct device * get_device(struct device * dev); | |||
399 | extern void put_device(struct device * dev); | 400 | extern void put_device(struct device * dev); |
400 | 401 | ||
401 | 402 | ||
402 | /* drivers/base/power.c */ | 403 | /* drivers/base/power/shutdown.c */ |
403 | extern void device_shutdown(void); | 404 | extern void device_shutdown(void); |
404 | 405 | ||
405 | 406 | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2d80cc761a15..a8731062a74c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -20,6 +20,7 @@ enum dma_data_direction { | |||
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | 20 | #define DMA_31BIT_MASK 0x000000007fffffffULL |
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | 21 | #define DMA_30BIT_MASK 0x000000003fffffffULL |
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | 22 | #define DMA_29BIT_MASK 0x000000001fffffffULL |
23 | #define DMA_28BIT_MASK 0x000000000fffffffULL | ||
23 | 24 | ||
24 | #include <asm/dma-mapping.h> | 25 | #include <asm/dma-mapping.h> |
25 | 26 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 68d82ad6b17c..d6f1019625af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -20,10 +20,7 @@ void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long) | |||
20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
21 | int hugetlb_report_meminfo(char *); | 21 | int hugetlb_report_meminfo(char *); |
22 | int hugetlb_report_node_meminfo(int, char *); | 22 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | ||
24 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
25 | struct page *alloc_huge_page(struct vm_area_struct *, unsigned long); | ||
26 | void free_huge_page(struct page *); | ||
27 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
28 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
29 | 26 | ||
@@ -39,18 +36,35 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | |||
39 | int write); | 36 | int write); |
40 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
41 | pmd_t *pmd, int write); | 38 | pmd_t *pmd, int write); |
42 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
43 | int pmd_huge(pmd_t pmd); | 39 | int pmd_huge(pmd_t pmd); |
40 | void hugetlb_change_protection(struct vm_area_struct *vma, | ||
41 | unsigned long address, unsigned long end, pgprot_t newprot); | ||
44 | 42 | ||
45 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 43 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
46 | #define is_hugepage_only_range(mm, addr, len) 0 | 44 | #define is_hugepage_only_range(mm, addr, len) 0 |
47 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 45 | #endif |
48 | do { } while (0) | 46 | |
47 | #ifndef ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
48 | #define hugetlb_free_pgd_range free_pgd_range | ||
49 | #else | ||
50 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
51 | unsigned long end, unsigned long floor, | ||
52 | unsigned long ceiling); | ||
49 | #endif | 53 | #endif |
50 | 54 | ||
51 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 55 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
52 | #define prepare_hugepage_range(addr, len) \ | 56 | /* |
53 | is_aligned_hugepage_range(addr, len) | 57 | * If the arch doesn't supply something else, assume that hugepage |
58 | * size aligned regions are ok without further preparation. | ||
59 | */ | ||
60 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
61 | { | ||
62 | if (len & ~HPAGE_MASK) | ||
63 | return -EINVAL; | ||
64 | if (addr & ~HPAGE_MASK) | ||
65 | return -EINVAL; | ||
66 | return 0; | ||
67 | } | ||
54 | #else | 68 | #else |
55 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 69 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
56 | #endif | 70 | #endif |
@@ -87,20 +101,17 @@ static inline unsigned long hugetlb_total_pages(void) | |||
87 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 101 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
88 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 102 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
89 | #define unmap_hugepage_range(vma, start, end) BUG() | 103 | #define unmap_hugepage_range(vma, start, end) BUG() |
90 | #define is_hugepage_mem_enough(size) 0 | ||
91 | #define hugetlb_report_meminfo(buf) 0 | 104 | #define hugetlb_report_meminfo(buf) 0 |
92 | #define hugetlb_report_node_meminfo(n, buf) 0 | 105 | #define hugetlb_report_node_meminfo(n, buf) 0 |
93 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 106 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
94 | #define is_aligned_hugepage_range(addr, len) 0 | ||
95 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 107 | #define prepare_hugepage_range(addr, len) (-EINVAL) |
96 | #define pmd_huge(x) 0 | 108 | #define pmd_huge(x) 0 |
97 | #define is_hugepage_only_range(mm, addr, len) 0 | 109 | #define is_hugepage_only_range(mm, addr, len) 0 |
98 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 110 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
99 | do { } while (0) | ||
100 | #define alloc_huge_page(vma, addr) ({ NULL; }) | ||
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | ||
102 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 111 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
103 | 112 | ||
113 | #define hugetlb_change_protection(vma, address, end, newprot) | ||
114 | |||
104 | #ifndef HPAGE_MASK | 115 | #ifndef HPAGE_MASK |
105 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ | 116 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ |
106 | #define HPAGE_SIZE PAGE_SIZE | 117 | #define HPAGE_SIZE PAGE_SIZE |
@@ -128,6 +139,8 @@ struct hugetlbfs_sb_info { | |||
128 | 139 | ||
129 | struct hugetlbfs_inode_info { | 140 | struct hugetlbfs_inode_info { |
130 | struct shared_policy policy; | 141 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
131 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
132 | }; | 145 | }; |
133 | 146 | ||
@@ -144,6 +157,10 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
144 | extern struct file_operations hugetlbfs_file_operations; | 157 | extern struct file_operations hugetlbfs_file_operations; |
145 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
146 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
147 | int hugetlb_get_quota(struct address_space *mapping); | 164 | int hugetlb_get_quota(struct address_space *mapping); |
148 | void hugetlb_put_quota(struct address_space *mapping); | 165 | void hugetlb_put_quota(struct address_space *mapping); |
149 | 166 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index d81cecdda4f3..7a54244d30aa 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -509,7 +509,6 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); | |||
509 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 509 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
512 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | ||
513 | extern int ata_scsi_error(struct Scsi_Host *host); | 512 | extern int ata_scsi_error(struct Scsi_Host *host); |
514 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
515 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h new file mode 100644 index 000000000000..7d09962c3c0b --- /dev/null +++ b/include/linux/migrate.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _LINUX_MIGRATE_H | ||
2 | #define _LINUX_MIGRATE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | #ifdef CONFIG_MIGRATION | ||
8 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | ||
9 | extern int putback_lru_pages(struct list_head *l); | ||
10 | extern int migrate_page(struct page *, struct page *); | ||
11 | extern void migrate_page_copy(struct page *, struct page *); | ||
12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
14 | struct list_head *moved, struct list_head *failed); | ||
15 | int migrate_pages_to(struct list_head *pagelist, | ||
16 | struct vm_area_struct *vma, int dest); | ||
17 | extern int fail_migrate_page(struct page *, struct page *); | ||
18 | |||
19 | extern int migrate_prep(void); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | ||
24 | { return -ENOSYS; } | ||
25 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
27 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
28 | |||
29 | static inline int migrate_prep(void) { return -ENOSYS; } | ||
30 | |||
31 | /* Possible settings for the migrate_page() method in address_operations */ | ||
32 | #define migrate_page NULL | ||
33 | #define fail_migrate_page NULL | ||
34 | |||
35 | #endif /* CONFIG_MIGRATION */ | ||
36 | #endif /* _LINUX_MIGRATE_H */ | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 498ff8778fb6..6aa016f1d3ae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -286,43 +286,34 @@ struct page { | |||
286 | * | 286 | * |
287 | * Also, many kernel routines increase the page count before a critical | 287 | * Also, many kernel routines increase the page count before a critical |
288 | * routine so they can be sure the page doesn't go away from under them. | 288 | * routine so they can be sure the page doesn't go away from under them. |
289 | * | ||
290 | * Since 2.6.6 (approx), a free page has ->_count = -1. This is so that we | ||
291 | * can use atomic_add_negative(-1, page->_count) to detect when the page | ||
292 | * becomes free and so that we can also use atomic_inc_and_test to atomically | ||
293 | * detect when we just tried to grab a ref on a page which some other CPU has | ||
294 | * already deemed to be freeable. | ||
295 | * | ||
296 | * NO code should make assumptions about this internal detail! Use the provided | ||
297 | * macros which retain the old rules: page_count(page) == 0 is a free page. | ||
298 | */ | 289 | */ |
299 | 290 | ||
300 | /* | 291 | /* |
301 | * Drop a ref, return true if the logical refcount fell to zero (the page has | 292 | * Drop a ref, return true if the logical refcount fell to zero (the page has |
302 | * no users) | 293 | * no users) |
303 | */ | 294 | */ |
304 | #define put_page_testzero(p) \ | 295 | static inline int put_page_testzero(struct page *page) |
305 | ({ \ | 296 | { |
306 | BUG_ON(atomic_read(&(p)->_count) == -1);\ | 297 | BUG_ON(atomic_read(&page->_count) == 0); |
307 | atomic_add_negative(-1, &(p)->_count); \ | 298 | return atomic_dec_and_test(&page->_count); |
308 | }) | 299 | } |
309 | 300 | ||
310 | /* | 301 | /* |
311 | * Grab a ref, return true if the page previously had a logical refcount of | 302 | * Try to grab a ref unless the page has a refcount of zero, return false if |
312 | * zero. ie: returns true if we just grabbed an already-deemed-to-be-free page | 303 | * that is the case. |
313 | */ | 304 | */ |
314 | #define get_page_testone(p) atomic_inc_and_test(&(p)->_count) | 305 | static inline int get_page_unless_zero(struct page *page) |
315 | 306 | { | |
316 | #define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1) | 307 | return atomic_inc_not_zero(&page->_count); |
317 | #define __put_page(p) atomic_dec(&(p)->_count) | 308 | } |
318 | 309 | ||
319 | extern void FASTCALL(__page_cache_release(struct page *)); | 310 | extern void FASTCALL(__page_cache_release(struct page *)); |
320 | 311 | ||
321 | static inline int page_count(struct page *page) | 312 | static inline int page_count(struct page *page) |
322 | { | 313 | { |
323 | if (PageCompound(page)) | 314 | if (unlikely(PageCompound(page))) |
324 | page = (struct page *)page_private(page); | 315 | page = (struct page *)page_private(page); |
325 | return atomic_read(&page->_count) + 1; | 316 | return atomic_read(&page->_count); |
326 | } | 317 | } |
327 | 318 | ||
328 | static inline void get_page(struct page *page) | 319 | static inline void get_page(struct page *page) |
@@ -332,8 +323,19 @@ static inline void get_page(struct page *page) | |||
332 | atomic_inc(&page->_count); | 323 | atomic_inc(&page->_count); |
333 | } | 324 | } |
334 | 325 | ||
326 | /* | ||
327 | * Setup the page count before being freed into the page allocator for | ||
328 | * the first time (boot or memory hotplug) | ||
329 | */ | ||
330 | static inline void init_page_count(struct page *page) | ||
331 | { | ||
332 | atomic_set(&page->_count, 1); | ||
333 | } | ||
334 | |||
335 | void put_page(struct page *page); | 335 | void put_page(struct page *page); |
336 | 336 | ||
337 | void split_page(struct page *page, unsigned int order); | ||
338 | |||
337 | /* | 339 | /* |
338 | * Multiple processes may "see" the same page. E.g. for untouched | 340 | * Multiple processes may "see" the same page. E.g. for untouched |
339 | * mappings of /dev/null, all processes see the same page full of | 341 | * mappings of /dev/null, all processes see the same page full of |
@@ -1046,7 +1048,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1046 | 1048 | ||
1047 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1049 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, |
1048 | void __user *, size_t *, loff_t *); | 1050 | void __user *, size_t *, loff_t *); |
1049 | int shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1051 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1050 | unsigned long lru_pages); | 1052 | unsigned long lru_pages); |
1051 | void drop_pagecache(void); | 1053 | void drop_pagecache(void); |
1052 | void drop_slab(void); | 1054 | void drop_slab(void); |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8ac854f7f190..3b6723dfaff3 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -32,7 +32,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
32 | { | 32 | { |
33 | list_del(&page->lru); | 33 | list_del(&page->lru); |
34 | if (PageActive(page)) { | 34 | if (PageActive(page)) { |
35 | ClearPageActive(page); | 35 | __ClearPageActive(page); |
36 | zone->nr_active--; | 36 | zone->nr_active--; |
37 | } else { | 37 | } else { |
38 | zone->nr_inactive--; | 38 | zone->nr_inactive--; |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index e933e2a355ad..8bcd9450d926 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -199,7 +199,7 @@ struct fat_mount_options { | |||
199 | sys_immutable:1, /* set = system files are immutable */ | 199 | sys_immutable:1, /* set = system files are immutable */ |
200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ | 200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ |
201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ | 201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ |
202 | utf8:1, /* Use of UTF8 character set (Default) */ | 202 | utf8:1, /* Use of UTF-8 character set (Default) */ |
203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
diff --git a/include/linux/net.h b/include/linux/net.h index 152fa6551fd8..84a490e5f0a1 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -143,6 +143,8 @@ struct proto_ops { | |||
143 | struct poll_table_struct *wait); | 143 | struct poll_table_struct *wait); |
144 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 144 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
145 | unsigned long arg); | 145 | unsigned long arg); |
146 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | ||
147 | unsigned long arg); | ||
146 | int (*listen) (struct socket *sock, int len); | 148 | int (*listen) (struct socket *sock, int len); |
147 | int (*shutdown) (struct socket *sock, int flags); | 149 | int (*shutdown) (struct socket *sock, int flags); |
148 | int (*setsockopt)(struct socket *sock, int level, | 150 | int (*setsockopt)(struct socket *sock, int level, |
@@ -251,6 +253,8 @@ SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_ | |||
251 | (file, sock, wait)) \ | 253 | (file, sock, wait)) \ |
252 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ | 254 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ |
253 | unsigned long arg), (sock, cmd, arg)) \ | 255 | unsigned long arg), (sock, cmd, arg)) \ |
256 | SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | ||
257 | unsigned long arg), (sock, cmd, arg)) \ | ||
254 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | 258 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ |
255 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | 259 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ |
256 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | 260 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ |
@@ -275,6 +279,7 @@ static const struct proto_ops name##_ops = { \ | |||
275 | .getname = __lock_##name##_getname, \ | 279 | .getname = __lock_##name##_getname, \ |
276 | .poll = __lock_##name##_poll, \ | 280 | .poll = __lock_##name##_poll, \ |
277 | .ioctl = __lock_##name##_ioctl, \ | 281 | .ioctl = __lock_##name##_ioctl, \ |
282 | .compat_ioctl = __lock_##name##_compat_ioctl, \ | ||
278 | .listen = __lock_##name##_listen, \ | 283 | .listen = __lock_##name##_listen, \ |
279 | .shutdown = __lock_##name##_shutdown, \ | 284 | .shutdown = __lock_##name##_shutdown, \ |
280 | .setsockopt = __lock_##name##_setsockopt, \ | 285 | .setsockopt = __lock_##name##_setsockopt, \ |
@@ -283,6 +288,7 @@ static const struct proto_ops name##_ops = { \ | |||
283 | .recvmsg = __lock_##name##_recvmsg, \ | 288 | .recvmsg = __lock_##name##_recvmsg, \ |
284 | .mmap = __lock_##name##_mmap, \ | 289 | .mmap = __lock_##name##_mmap, \ |
285 | }; | 290 | }; |
291 | |||
286 | #endif | 292 | #endif |
287 | 293 | ||
288 | #define MODULE_ALIAS_NETPROTO(proto) \ | 294 | #define MODULE_ALIAS_NETPROTO(proto) \ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d52999c43336..9ea629c02a4b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -86,8 +86,9 @@ | |||
86 | * - The __xxx_page_state variants can be used safely when interrupts are | 86 | * - The __xxx_page_state variants can be used safely when interrupts are |
87 | * disabled. | 87 | * disabled. |
88 | * - The __xxx_page_state variants can be used if the field is only | 88 | * - The __xxx_page_state variants can be used if the field is only |
89 | * modified from process context, or only modified from interrupt context. | 89 | * modified from process context and protected from preemption, or only |
90 | * In this case, the field should be commented here. | 90 | * modified from interrupt context. In this case, the field should be |
91 | * commented here. | ||
91 | */ | 92 | */ |
92 | struct page_state { | 93 | struct page_state { |
93 | unsigned long nr_dirty; /* Dirty writeable pages */ | 94 | unsigned long nr_dirty; /* Dirty writeable pages */ |
@@ -239,22 +240,19 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
239 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) | 240 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) |
240 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) | 241 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) |
241 | 242 | ||
242 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) | ||
243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) | 243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) |
244 | #define TestSetPageLRU(page) test_and_set_bit(PG_lru, &(page)->flags) | 244 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) |
245 | #define TestClearPageLRU(page) test_and_clear_bit(PG_lru, &(page)->flags) | 245 | #define ClearPageLRU(page) clear_bit(PG_lru, &(page)->flags) |
246 | #define __ClearPageLRU(page) __clear_bit(PG_lru, &(page)->flags) | ||
246 | 247 | ||
247 | #define PageActive(page) test_bit(PG_active, &(page)->flags) | 248 | #define PageActive(page) test_bit(PG_active, &(page)->flags) |
248 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) | 249 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) |
249 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) | 250 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) |
250 | #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags) | 251 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) |
251 | #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags) | ||
252 | 252 | ||
253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
254 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 254 | #define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags) |
255 | #define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags) | 255 | #define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags) |
256 | #define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags) | ||
257 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | ||
258 | 256 | ||
259 | #ifdef CONFIG_HIGHMEM | 257 | #ifdef CONFIG_HIGHMEM |
260 | #define PageHighMem(page) is_highmem(page_zone(page)) | 258 | #define PageHighMem(page) is_highmem(page_zone(page)) |
@@ -329,8 +327,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
329 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) | 327 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) |
330 | 328 | ||
331 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) | 329 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) |
332 | #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) | 330 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
333 | #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) | 331 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
334 | 332 | ||
335 | #ifdef CONFIG_SWAP | 333 | #ifdef CONFIG_SWAP |
336 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 334 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b9810ddf435a..ec3c32932620 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -852,6 +852,8 @@ | |||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | 852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | 853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | 854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 |
855 | #define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422 | ||
856 | #define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432 | ||
855 | 857 | ||
856 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 858 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
857 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 859 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 0b2ba67ff13c..b739ac1f7ca0 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_RTC_H_ | 11 | #ifndef _LINUX_RTC_H_ |
12 | #define _LINUX_RTC_H_ | 12 | #define _LINUX_RTC_H_ |
13 | 13 | ||
14 | #include <linux/interrupt.h> | ||
15 | |||
16 | /* | 14 | /* |
17 | * The struct used to pass data via the following ioctl. Similar to the | 15 | * The struct used to pass data via the following ioctl. Similar to the |
18 | * struct tm in <time.h>, but it needs to be here so that the kernel | 16 | * struct tm in <time.h>, but it needs to be here so that the kernel |
@@ -95,6 +93,8 @@ struct rtc_pll_info { | |||
95 | 93 | ||
96 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
97 | 95 | ||
96 | #include <linux/interrupt.h> | ||
97 | |||
98 | typedef struct rtc_task { | 98 | typedef struct rtc_task { |
99 | void (*func)(void *private_data); | 99 | void (*func)(void *private_data); |
100 | void *private_data; | 100 | void *private_data; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 8cf52939d0ab..2b28c849d75a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -38,7 +38,6 @@ typedef struct kmem_cache kmem_cache_t; | |||
38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ | 38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ |
39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ | 39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ |
40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ | 40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ |
41 | #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ | ||
42 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ | 41 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ |
43 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ | 42 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ |
44 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ | 43 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ |
@@ -118,7 +117,7 @@ extern void *kzalloc(size_t, gfp_t); | |||
118 | */ | 117 | */ |
119 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 118 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
120 | { | 119 | { |
121 | if (n != 0 && size > INT_MAX / n) | 120 | if (n != 0 && size > ULONG_MAX / n) |
122 | return NULL; | 121 | return NULL; |
123 | return kzalloc(n * size, flags); | 122 | return kzalloc(n * size, flags); |
124 | } | 123 | } |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 44153fdf73fc..d699a16b0cb2 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -52,23 +52,12 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
52 | /* | 52 | /* |
53 | * Call a function on all other processors | 53 | * Call a function on all other processors |
54 | */ | 54 | */ |
55 | extern int smp_call_function (void (*func) (void *info), void *info, | 55 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); |
56 | int retry, int wait); | ||
57 | 56 | ||
58 | /* | 57 | /* |
59 | * Call a function on all processors | 58 | * Call a function on all processors |
60 | */ | 59 | */ |
61 | static inline int on_each_cpu(void (*func) (void *info), void *info, | 60 | int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait); |
62 | int retry, int wait) | ||
63 | { | ||
64 | int ret = 0; | ||
65 | |||
66 | preempt_disable(); | ||
67 | ret = smp_call_function(func, info, retry, wait); | ||
68 | func(info); | ||
69 | preempt_enable(); | ||
70 | return ret; | ||
71 | } | ||
72 | 61 | ||
73 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | 62 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ |
74 | #define MSG_ALL 0x8001 | 63 | #define MSG_ALL 0x8001 |
@@ -94,7 +83,13 @@ void smp_prepare_boot_cpu(void); | |||
94 | #define raw_smp_processor_id() 0 | 83 | #define raw_smp_processor_id() 0 |
95 | #define hard_smp_processor_id() 0 | 84 | #define hard_smp_processor_id() 0 |
96 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 85 | #define smp_call_function(func,info,retry,wait) ({ 0; }) |
97 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 86 | #define on_each_cpu(func,info,retry,wait) \ |
87 | ({ \ | ||
88 | local_irq_disable(); \ | ||
89 | func(info); \ | ||
90 | local_irq_enable(); \ | ||
91 | 0; \ | ||
92 | }) | ||
98 | static inline void smp_send_reschedule(int cpu) { } | 93 | static inline void smp_send_reschedule(int cpu) { } |
99 | #define num_booting_cpus() 1 | 94 | #define num_booting_cpus() 1 |
100 | #define smp_prepare_boot_cpu() do {} while (0) | 95 | #define smp_prepare_boot_cpu() do {} while (0) |
diff --git a/include/linux/swap.h b/include/linux/swap.h index d572b19afb7d..12415dd94451 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,9 +172,24 @@ extern int rotate_reclaimable_page(struct page *page); | |||
172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
173 | 173 | ||
174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
175 | extern int try_to_free_pages(struct zone **, gfp_t); | 175 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); |
176 | extern int shrink_all_memory(int); | 176 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | extern int remove_mapping(struct address_space *mapping, struct page *page); | ||
179 | |||
180 | /* possible outcome of pageout() */ | ||
181 | typedef enum { | ||
182 | /* failed to write page out, page is locked */ | ||
183 | PAGE_KEEP, | ||
184 | /* move page to the active list, page is locked */ | ||
185 | PAGE_ACTIVATE, | ||
186 | /* page has been sent to the disk successfully, page is unlocked */ | ||
187 | PAGE_SUCCESS, | ||
188 | /* page is clean and locked */ | ||
189 | PAGE_CLEAN, | ||
190 | } pageout_t; | ||
191 | |||
192 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
178 | 193 | ||
179 | #ifdef CONFIG_NUMA | 194 | #ifdef CONFIG_NUMA |
180 | extern int zone_reclaim_mode; | 195 | extern int zone_reclaim_mode; |
@@ -188,25 +203,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
188 | } | 203 | } |
189 | #endif | 204 | #endif |
190 | 205 | ||
191 | #ifdef CONFIG_MIGRATION | ||
192 | extern int isolate_lru_page(struct page *p); | ||
193 | extern int putback_lru_pages(struct list_head *l); | ||
194 | extern int migrate_page(struct page *, struct page *); | ||
195 | extern void migrate_page_copy(struct page *, struct page *); | ||
196 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
197 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
198 | struct list_head *moved, struct list_head *failed); | ||
199 | extern int fail_migrate_page(struct page *, struct page *); | ||
200 | #else | ||
201 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | ||
202 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
203 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
204 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
205 | /* Possible settings for the migrate_page() method in address_operations */ | ||
206 | #define migrate_page NULL | ||
207 | #define fail_migrate_page NULL | ||
208 | #endif | ||
209 | |||
210 | #ifdef CONFIG_MMU | 206 | #ifdef CONFIG_MMU |
211 | /* linux/mm/shmem.c */ | 207 | /* linux/mm/shmem.c */ |
212 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 208 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 86b111300231..957c21c16d62 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -20,6 +20,10 @@ struct work_struct { | |||
20 | struct timer_list timer; | 20 | struct timer_list timer; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct execute_work { | ||
24 | struct work_struct work; | ||
25 | }; | ||
26 | |||
23 | #define __WORK_INITIALIZER(n, f, d) { \ | 27 | #define __WORK_INITIALIZER(n, f, d) { \ |
24 | .entry = { &(n).entry, &(n).entry }, \ | 28 | .entry = { &(n).entry, &(n).entry }, \ |
25 | .func = (f), \ | 29 | .func = (f), \ |
@@ -74,6 +78,8 @@ extern void init_workqueues(void); | |||
74 | void cancel_rearming_delayed_work(struct work_struct *work); | 78 | void cancel_rearming_delayed_work(struct work_struct *work); |
75 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 79 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
76 | struct work_struct *); | 80 | struct work_struct *); |
81 | int execute_in_process_context(void (*fn)(void *), void *, | ||
82 | struct execute_work *); | ||
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 85 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
diff --git a/include/linux/x25.h b/include/linux/x25.h index 16d44931afa0..d035e4e87d07 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef X25_KERNEL_H | 11 | #ifndef X25_KERNEL_H |
12 | #define X25_KERNEL_H | 12 | #define X25_KERNEL_H |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) | 16 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
15 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) | 17 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
16 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) | 18 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) |
@@ -21,6 +23,8 @@ | |||
21 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) | 23 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) |
22 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) | 24 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) |
23 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | ||
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | ||
24 | 28 | ||
25 | /* | 29 | /* |
26 | * Values for {get,set}sockopt. | 30 | * Values for {get,set}sockopt. |
@@ -77,6 +81,8 @@ struct x25_subscrip_struct { | |||
77 | #define X25_MASK_PACKET_SIZE 0x04 | 81 | #define X25_MASK_PACKET_SIZE 0x04 |
78 | #define X25_MASK_WINDOW_SIZE 0x08 | 82 | #define X25_MASK_WINDOW_SIZE 0x08 |
79 | 83 | ||
84 | #define X25_MASK_CALLING_AE 0x10 | ||
85 | #define X25_MASK_CALLED_AE 0x20 | ||
80 | 86 | ||
81 | 87 | ||
82 | /* | 88 | /* |
@@ -99,6 +105,26 @@ struct x25_facilities { | |||
99 | }; | 105 | }; |
100 | 106 | ||
101 | /* | 107 | /* |
108 | * ITU DTE facilities | ||
109 | * Only the called and calling address | ||
110 | * extension are currently implemented. | ||
111 | * The rest are in place to avoid the struct | ||
112 | * changing size if someone needs them later | ||
113 | */ | ||
114 | |||
115 | struct x25_dte_facilities { | ||
116 | __u16 delay_cumul; | ||
117 | __u16 delay_target; | ||
118 | __u16 delay_max; | ||
119 | __u8 min_throughput; | ||
120 | __u8 expedited; | ||
121 | __u8 calling_len; | ||
122 | __u8 called_len; | ||
123 | __u8 calling_ae[20]; | ||
124 | __u8 called_ae[20]; | ||
125 | }; | ||
126 | |||
127 | /* | ||
102 | * Call User Data structure. | 128 | * Call User Data structure. |
103 | */ | 129 | */ |
104 | struct x25_calluserdata { | 130 | struct x25_calluserdata { |
diff --git a/include/net/compat.h b/include/net/compat.h index 290bab46d457..8662b8f43df5 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -23,6 +23,9 @@ struct compat_cmsghdr { | |||
23 | compat_int_t cmsg_type; | 23 | compat_int_t cmsg_type; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | struct sock; | ||
27 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | ||
28 | |||
26 | #else /* defined(CONFIG_COMPAT) */ | 29 | #else /* defined(CONFIG_COMPAT) */ |
27 | #define compat_msghdr msghdr /* to avoid compiler warnings */ | 30 | #define compat_msghdr msghdr /* to avoid compiler warnings */ |
28 | #endif /* defined(CONFIG_COMPAT) */ | 31 | #endif /* defined(CONFIG_COMPAT) */ |
@@ -34,7 +37,6 @@ extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsi | |||
34 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 37 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
35 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 38 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
36 | 39 | ||
37 | struct sock; | ||
38 | extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); | 40 | extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); |
39 | 41 | ||
40 | #endif /* NET_COMPAT_H */ | 42 | #endif /* NET_COMPAT_H */ |
diff --git a/include/net/x25.h b/include/net/x25.h index fee62ff8c194..0ad90ebcf86e 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -101,9 +101,17 @@ enum { | |||
101 | #define X25_FAC_PACKET_SIZE 0x42 | 101 | #define X25_FAC_PACKET_SIZE 0x42 |
102 | #define X25_FAC_WINDOW_SIZE 0x43 | 102 | #define X25_FAC_WINDOW_SIZE 0x43 |
103 | 103 | ||
104 | #define X25_MAX_FAC_LEN 20 /* Plenty to spare */ | 104 | #define X25_MAX_FAC_LEN 60 |
105 | #define X25_MAX_CUD_LEN 128 | 105 | #define X25_MAX_CUD_LEN 128 |
106 | 106 | ||
107 | #define X25_FAC_CALLING_AE 0xCB | ||
108 | #define X25_FAC_CALLED_AE 0xC9 | ||
109 | |||
110 | #define X25_MARKER 0x00 | ||
111 | #define X25_DTE_SERVICES 0x0F | ||
112 | #define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */ | ||
113 | #define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */ | ||
114 | |||
107 | /** | 115 | /** |
108 | * struct x25_route - x25 routing entry | 116 | * struct x25_route - x25 routing entry |
109 | * @node - entry in x25_list_lock | 117 | * @node - entry in x25_list_lock |
@@ -148,6 +156,7 @@ struct x25_sock { | |||
148 | struct timer_list timer; | 156 | struct timer_list timer; |
149 | struct x25_causediag causediag; | 157 | struct x25_causediag causediag; |
150 | struct x25_facilities facilities; | 158 | struct x25_facilities facilities; |
159 | struct x25_dte_facilities dte_facilities; | ||
151 | struct x25_calluserdata calluserdata; | 160 | struct x25_calluserdata calluserdata; |
152 | unsigned long vc_facil_mask; /* inc_call facilities mask */ | 161 | unsigned long vc_facil_mask; /* inc_call facilities mask */ |
153 | }; | 162 | }; |
@@ -180,9 +189,13 @@ extern void x25_establish_link(struct x25_neigh *); | |||
180 | extern void x25_terminate_link(struct x25_neigh *); | 189 | extern void x25_terminate_link(struct x25_neigh *); |
181 | 190 | ||
182 | /* x25_facilities.c */ | 191 | /* x25_facilities.c */ |
183 | extern int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, unsigned long *); | 192 | extern int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, |
184 | extern int x25_create_facilities(unsigned char *, struct x25_facilities *, unsigned long); | 193 | struct x25_dte_facilities *, unsigned long *); |
185 | extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, struct x25_facilities *); | 194 | extern int x25_create_facilities(unsigned char *, struct x25_facilities *, |
195 | struct x25_dte_facilities *, unsigned long); | ||
196 | extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, | ||
197 | struct x25_facilities *, | ||
198 | struct x25_dte_facilities *); | ||
186 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); | 199 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); |
187 | 200 | ||
188 | /* x25_in.c */ | 201 | /* x25_in.c */ |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 9c331258bc27..c60b8ff2f5e4 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -433,6 +433,4 @@ struct scsi_lun { | |||
433 | /* Used to obtain the PCI location of a device */ | 433 | /* Used to obtain the PCI location of a device */ |
434 | #define SCSI_IOCTL_GET_PCI 0x5387 | 434 | #define SCSI_IOCTL_GET_PCI 0x5387 |
435 | 435 | ||
436 | int scsi_execute_in_process_context(void (*fn)(void *data), void *data); | ||
437 | |||
438 | #endif /* _SCSI_SCSI_H */ | 436 | #endif /* _SCSI_SCSI_H */ |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 7529f4388bb4..1ace1b9fe537 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -104,10 +104,10 @@ struct scsi_cmnd { | |||
104 | working on */ | 104 | working on */ |
105 | 105 | ||
106 | #define SCSI_SENSE_BUFFERSIZE 96 | 106 | #define SCSI_SENSE_BUFFERSIZE 96 |
107 | unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; /* obtained by REQUEST SENSE | 107 | unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; |
108 | * when CHECK CONDITION is | 108 | /* obtained by REQUEST SENSE when |
109 | * received on original command | 109 | * CHECK CONDITION is received on original |
110 | * (auto-sense) */ | 110 | * command (auto-sense) */ |
111 | 111 | ||
112 | /* Low-level done function - can be used by low-level driver to point | 112 | /* Low-level done function - can be used by low-level driver to point |
113 | * to completion function. Not used by mid/upper level code. */ | 113 | * to completion function. Not used by mid/upper level code. */ |
@@ -120,12 +120,12 @@ struct scsi_cmnd { | |||
120 | struct scsi_pointer SCp; /* Scratchpad used by some host adapters */ | 120 | struct scsi_pointer SCp; /* Scratchpad used by some host adapters */ |
121 | 121 | ||
122 | unsigned char *host_scribble; /* The host adapter is allowed to | 122 | unsigned char *host_scribble; /* The host adapter is allowed to |
123 | * call scsi_malloc and get some memory | 123 | * call scsi_malloc and get some memory |
124 | * and hang it here. The host adapter | 124 | * and hang it here. The host adapter |
125 | * is also expected to call scsi_free | 125 | * is also expected to call scsi_free |
126 | * to release this memory. (The memory | 126 | * to release this memory. (The memory |
127 | * obtained by scsi_malloc is guaranteed | 127 | * obtained by scsi_malloc is guaranteed |
128 | * to be at an address < 16Mb). */ | 128 | * to be at an address < 16Mb). */ |
129 | 129 | ||
130 | int result; /* Status code from lower level driver */ | 130 | int result; /* Status code from lower level driver */ |
131 | 131 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 290e3b4d2aec..895d212864cd 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/workqueue.h> | ||
7 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
8 | 9 | ||
9 | struct request_queue; | 10 | struct request_queue; |
@@ -73,7 +74,6 @@ struct scsi_device { | |||
73 | unsigned sector_size; /* size in bytes */ | 74 | unsigned sector_size; /* size in bytes */ |
74 | 75 | ||
75 | void *hostdata; /* available to low-level driver */ | 76 | void *hostdata; /* available to low-level driver */ |
76 | char devfs_name[256]; /* devfs junk */ | ||
77 | char type; | 77 | char type; |
78 | char scsi_level; | 78 | char scsi_level; |
79 | char inq_periph_qual; /* PQ from INQUIRY data */ | 79 | char inq_periph_qual; /* PQ from INQUIRY data */ |
@@ -138,6 +138,8 @@ struct scsi_device { | |||
138 | struct device sdev_gendev; | 138 | struct device sdev_gendev; |
139 | struct class_device sdev_classdev; | 139 | struct class_device sdev_classdev; |
140 | 140 | ||
141 | struct execute_work ew; /* used to get process context on put */ | ||
142 | |||
141 | enum scsi_device_state sdev_state; | 143 | enum scsi_device_state sdev_state; |
142 | unsigned long sdev_data[0]; | 144 | unsigned long sdev_data[0]; |
143 | } __attribute__((aligned(sizeof(unsigned long)))); | 145 | } __attribute__((aligned(sizeof(unsigned long)))); |
@@ -154,6 +156,11 @@ struct scsi_device { | |||
154 | #define scmd_printk(prefix, scmd, fmt, a...) \ | 156 | #define scmd_printk(prefix, scmd, fmt, a...) \ |
155 | dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) | 157 | dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) |
156 | 158 | ||
159 | enum scsi_target_state { | ||
160 | STARGET_RUNNING = 1, | ||
161 | STARGET_DEL, | ||
162 | }; | ||
163 | |||
157 | /* | 164 | /* |
158 | * scsi_target: representation of a scsi target, for now, this is only | 165 | * scsi_target: representation of a scsi target, for now, this is only |
159 | * used for single_lun devices. If no one has active IO to the target, | 166 | * used for single_lun devices. If no one has active IO to the target, |
@@ -168,8 +175,13 @@ struct scsi_target { | |||
168 | unsigned int channel; | 175 | unsigned int channel; |
169 | unsigned int id; /* target id ... replace | 176 | unsigned int id; /* target id ... replace |
170 | * scsi_device.id eventually */ | 177 | * scsi_device.id eventually */ |
171 | unsigned long create:1; /* signal that it needs to be added */ | 178 | unsigned int create:1; /* signal that it needs to be added */ |
179 | unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ | ||
180 | /* means no lun present */ | ||
181 | |||
172 | char scsi_level; | 182 | char scsi_level; |
183 | struct execute_work ew; | ||
184 | enum scsi_target_state state; | ||
173 | void *hostdata; /* available to low-level driver */ | 185 | void *hostdata; /* available to low-level driver */ |
174 | unsigned long starget_data[0]; /* for the transport */ | 186 | unsigned long starget_data[0]; /* for the transport */ |
175 | /* starget_data must be the last element!!!! */ | 187 | /* starget_data must be the last element!!!! */ |
@@ -249,6 +261,11 @@ extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, | |||
249 | unsigned char *buffer, int len, int timeout, | 261 | unsigned char *buffer, int len, int timeout, |
250 | int retries, struct scsi_mode_data *data, | 262 | int retries, struct scsi_mode_data *data, |
251 | struct scsi_sense_hdr *); | 263 | struct scsi_sense_hdr *); |
264 | extern int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, | ||
265 | int modepage, unsigned char *buffer, int len, | ||
266 | int timeout, int retries, | ||
267 | struct scsi_mode_data *data, | ||
268 | struct scsi_sense_hdr *); | ||
252 | extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, | 269 | extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, |
253 | int retries); | 270 | int retries); |
254 | extern int scsi_device_set_state(struct scsi_device *sdev, | 271 | extern int scsi_device_set_state(struct scsi_device *sdev, |
@@ -281,6 +298,11 @@ extern int scsi_execute_async(struct scsi_device *sdev, | |||
281 | void (*done)(void *, char *, int, int), | 298 | void (*done)(void *, char *, int, int), |
282 | gfp_t gfp); | 299 | gfp_t gfp); |
283 | 300 | ||
301 | static inline void scsi_device_reprobe(struct scsi_device *sdev) | ||
302 | { | ||
303 | device_reprobe(&sdev->sdev_gendev); | ||
304 | } | ||
305 | |||
284 | static inline unsigned int sdev_channel(struct scsi_device *sdev) | 306 | static inline unsigned int sdev_channel(struct scsi_device *sdev) |
285 | { | 307 | { |
286 | return sdev->channel; | 308 | return sdev->channel; |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 827992949c4b..a6cf3e535c0b 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -147,20 +147,6 @@ struct scsi_host_template { | |||
147 | int (* eh_host_reset_handler)(struct scsi_cmnd *); | 147 | int (* eh_host_reset_handler)(struct scsi_cmnd *); |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * This is an optional routine to notify the host that the scsi | ||
151 | * timer just fired. The returns tell the timer routine what to | ||
152 | * do about this: | ||
153 | * | ||
154 | * EH_HANDLED: I fixed the error, please complete the command | ||
155 | * EH_RESET_TIMER: I need more time, reset the timer and | ||
156 | * begin counting again | ||
157 | * EH_NOT_HANDLED Begin normal error recovery | ||
158 | * | ||
159 | * Status: OPTIONAL | ||
160 | */ | ||
161 | enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); | ||
162 | |||
163 | /* | ||
164 | * Before the mid layer attempts to scan for a new device where none | 150 | * Before the mid layer attempts to scan for a new device where none |
165 | * currently exists, it will call this entry in your driver. Should | 151 | * currently exists, it will call this entry in your driver. Should |
166 | * your driver need to allocate any structs or perform any other init | 152 | * your driver need to allocate any structs or perform any other init |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index e7b1054adf86..b3657f111937 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -48,6 +48,17 @@ struct scsi_transport_template { | |||
48 | * True if the transport wants to use a host-based work-queue | 48 | * True if the transport wants to use a host-based work-queue |
49 | */ | 49 | */ |
50 | unsigned int create_work_queue : 1; | 50 | unsigned int create_work_queue : 1; |
51 | |||
52 | /* | ||
53 | * This is an optional routine that allows the transport to become | ||
54 | * involved when a scsi io timer fires. The return value tells the | ||
55 | * timer routine how to finish the io timeout handling: | ||
56 | * EH_HANDLED: I fixed the error, please complete the command | ||
57 | * EH_RESET_TIMER: I need more time, reset the timer and | ||
58 | * begin counting again | ||
59 | * EH_NOT_HANDLED Begin normal error recovery | ||
60 | */ | ||
61 | enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); | ||
51 | }; | 62 | }; |
52 | 63 | ||
53 | #define transport_class_to_shost(tc) \ | 64 | #define transport_class_to_shost(tc) \ |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index b91400bfb02a..93cfb4bf4211 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -30,6 +30,7 @@ enum sas_linkrate { | |||
30 | SAS_SATA_PORT_SELECTOR, | 30 | SAS_SATA_PORT_SELECTOR, |
31 | SAS_LINK_RATE_1_5_GBPS, | 31 | SAS_LINK_RATE_1_5_GBPS, |
32 | SAS_LINK_RATE_3_0_GBPS, | 32 | SAS_LINK_RATE_3_0_GBPS, |
33 | SAS_LINK_RATE_6_0_GBPS, | ||
33 | SAS_LINK_VIRTUAL, | 34 | SAS_LINK_VIRTUAL, |
34 | }; | 35 | }; |
35 | 36 | ||
@@ -89,11 +90,45 @@ struct sas_rphy { | |||
89 | dev_to_rphy((cdev)->dev) | 90 | dev_to_rphy((cdev)->dev) |
90 | #define rphy_to_shost(rphy) \ | 91 | #define rphy_to_shost(rphy) \ |
91 | dev_to_shost((rphy)->dev.parent) | 92 | dev_to_shost((rphy)->dev.parent) |
93 | #define target_to_rphy(targ) \ | ||
94 | dev_to_rphy((targ)->dev.parent) | ||
95 | |||
96 | struct sas_end_device { | ||
97 | struct sas_rphy rphy; | ||
98 | /* flags */ | ||
99 | unsigned ready_led_meaning:1; | ||
100 | /* parameters */ | ||
101 | u16 I_T_nexus_loss_timeout; | ||
102 | u16 initiator_response_timeout; | ||
103 | }; | ||
104 | #define rphy_to_end_device(r) \ | ||
105 | container_of((r), struct sas_end_device, rphy) | ||
106 | |||
107 | struct sas_expander_device { | ||
108 | int level; | ||
109 | |||
110 | #define SAS_EXPANDER_VENDOR_ID_LEN 8 | ||
111 | char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1]; | ||
112 | #define SAS_EXPANDER_PRODUCT_ID_LEN 16 | ||
113 | char product_id[SAS_EXPANDER_PRODUCT_ID_LEN+1]; | ||
114 | #define SAS_EXPANDER_PRODUCT_REV_LEN 4 | ||
115 | char product_rev[SAS_EXPANDER_PRODUCT_REV_LEN+1]; | ||
116 | #define SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN 8 | ||
117 | char component_vendor_id[SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN+1]; | ||
118 | u16 component_id; | ||
119 | u8 component_revision_id; | ||
92 | 120 | ||
121 | struct sas_rphy rphy; | ||
122 | |||
123 | }; | ||
124 | #define rphy_to_expander_device(r) \ | ||
125 | container_of((r), struct sas_expander_device, rphy) | ||
93 | 126 | ||
94 | /* The functions by which the transport class and the driver communicate */ | 127 | /* The functions by which the transport class and the driver communicate */ |
95 | struct sas_function_template { | 128 | struct sas_function_template { |
96 | int (*get_linkerrors)(struct sas_phy *); | 129 | int (*get_linkerrors)(struct sas_phy *); |
130 | int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); | ||
131 | int (*get_bay_identifier)(struct sas_rphy *); | ||
97 | int (*phy_reset)(struct sas_phy *, int); | 132 | int (*phy_reset)(struct sas_phy *, int); |
98 | }; | 133 | }; |
99 | 134 | ||
@@ -106,7 +141,8 @@ extern int sas_phy_add(struct sas_phy *); | |||
106 | extern void sas_phy_delete(struct sas_phy *); | 141 | extern void sas_phy_delete(struct sas_phy *); |
107 | extern int scsi_is_sas_phy(const struct device *); | 142 | extern int scsi_is_sas_phy(const struct device *); |
108 | 143 | ||
109 | extern struct sas_rphy *sas_rphy_alloc(struct sas_phy *); | 144 | extern struct sas_rphy *sas_end_device_alloc(struct sas_phy *); |
145 | extern struct sas_rphy *sas_expander_alloc(struct sas_phy *, enum sas_device_type); | ||
110 | void sas_rphy_free(struct sas_rphy *); | 146 | void sas_rphy_free(struct sas_rphy *); |
111 | extern int sas_rphy_add(struct sas_rphy *); | 147 | extern int sas_rphy_add(struct sas_rphy *); |
112 | extern void sas_rphy_delete(struct sas_rphy *); | 148 | extern void sas_rphy_delete(struct sas_rphy *); |
@@ -115,5 +151,17 @@ extern int scsi_is_sas_rphy(const struct device *); | |||
115 | extern struct scsi_transport_template * | 151 | extern struct scsi_transport_template * |
116 | sas_attach_transport(struct sas_function_template *); | 152 | sas_attach_transport(struct sas_function_template *); |
117 | extern void sas_release_transport(struct scsi_transport_template *); | 153 | extern void sas_release_transport(struct scsi_transport_template *); |
154 | int sas_read_port_mode_page(struct scsi_device *); | ||
155 | |||
156 | static inline int | ||
157 | scsi_is_sas_expander_device(struct device *dev) | ||
158 | { | ||
159 | struct sas_rphy *rphy; | ||
160 | if (!scsi_is_sas_rphy(dev)) | ||
161 | return 0; | ||
162 | rphy = dev_to_rphy(dev); | ||
163 | return rphy->identify.device_type == SAS_FANOUT_EXPANDER_DEVICE || | ||
164 | rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE; | ||
165 | } | ||
118 | 166 | ||
119 | #endif /* SCSI_TRANSPORT_SAS_H */ | 167 | #endif /* SCSI_TRANSPORT_SAS_H */ |
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index fb5a2ffae939..5e1d61913d4e 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h | |||
@@ -148,5 +148,9 @@ void spi_schedule_dv_device(struct scsi_device *); | |||
148 | void spi_dv_device(struct scsi_device *); | 148 | void spi_dv_device(struct scsi_device *); |
149 | void spi_display_xfer_agreement(struct scsi_target *); | 149 | void spi_display_xfer_agreement(struct scsi_target *); |
150 | int spi_print_msg(const unsigned char *); | 150 | int spi_print_msg(const unsigned char *); |
151 | int spi_populate_width_msg(unsigned char *msg, int width); | ||
152 | int spi_populate_sync_msg(unsigned char *msg, int period, int offset); | ||
153 | int spi_populate_ppr_msg(unsigned char *msg, int period, int offset, int width, | ||
154 | int options); | ||
151 | 155 | ||
152 | #endif /* SCSI_TRANSPORT_SPI_H */ | 156 | #endif /* SCSI_TRANSPORT_SPI_H */ |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index b0b3ea7b365e..b45a73712748 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -433,6 +433,12 @@ struct snd_ac97_bus { | |||
433 | struct snd_info_entry *proc; | 433 | struct snd_info_entry *proc; |
434 | }; | 434 | }; |
435 | 435 | ||
436 | /* static resolution table */ | ||
437 | struct snd_ac97_res_table { | ||
438 | unsigned short reg; /* register */ | ||
439 | unsigned short bits; /* resolution bitmask */ | ||
440 | }; | ||
441 | |||
436 | struct snd_ac97_template { | 442 | struct snd_ac97_template { |
437 | void *private_data; | 443 | void *private_data; |
438 | void (*private_free) (struct snd_ac97 *ac97); | 444 | void (*private_free) (struct snd_ac97 *ac97); |
@@ -440,8 +446,7 @@ struct snd_ac97_template { | |||
440 | unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ | 446 | unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ |
441 | unsigned short addr; /* physical address of codec [0-3] */ | 447 | unsigned short addr; /* physical address of codec [0-3] */ |
442 | unsigned int scaps; /* driver capabilities */ | 448 | unsigned int scaps; /* driver capabilities */ |
443 | unsigned int limited_regs; /* allow limited registers only */ | 449 | const struct snd_ac97_res_table *res_table; /* static resolution */ |
444 | DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ | ||
445 | }; | 450 | }; |
446 | 451 | ||
447 | struct snd_ac97 { | 452 | struct snd_ac97 { |
@@ -456,20 +461,20 @@ struct snd_ac97 { | |||
456 | struct snd_info_entry *proc_regs; | 461 | struct snd_info_entry *proc_regs; |
457 | unsigned short subsystem_vendor; | 462 | unsigned short subsystem_vendor; |
458 | unsigned short subsystem_device; | 463 | unsigned short subsystem_device; |
459 | struct semaphore reg_mutex; | 464 | struct mutex reg_mutex; |
460 | struct semaphore page_mutex; /* mutex for AD18xx multi-codecs and paging (2.3) */ | 465 | struct mutex page_mutex; /* mutex for AD18xx multi-codecs and paging (2.3) */ |
461 | unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ | 466 | unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ |
462 | unsigned short addr; /* physical address of codec [0-3] */ | 467 | unsigned short addr; /* physical address of codec [0-3] */ |
463 | unsigned int id; /* identification of codec */ | 468 | unsigned int id; /* identification of codec */ |
464 | unsigned short caps; /* capabilities (register 0) */ | 469 | unsigned short caps; /* capabilities (register 0) */ |
465 | unsigned short ext_id; /* extended feature identification (register 28) */ | 470 | unsigned short ext_id; /* extended feature identification (register 28) */ |
466 | unsigned short ext_mid; /* extended modem ID (register 3C) */ | 471 | unsigned short ext_mid; /* extended modem ID (register 3C) */ |
472 | const struct snd_ac97_res_table *res_table; /* static resolution */ | ||
467 | unsigned int scaps; /* driver capabilities */ | 473 | unsigned int scaps; /* driver capabilities */ |
468 | unsigned int flags; /* specific code */ | 474 | unsigned int flags; /* specific code */ |
469 | unsigned int rates[6]; /* see AC97_RATES_* defines */ | 475 | unsigned int rates[6]; /* see AC97_RATES_* defines */ |
470 | unsigned int spdif_status; | 476 | unsigned int spdif_status; |
471 | unsigned short regs[0x80]; /* register cache */ | 477 | unsigned short regs[0x80]; /* register cache */ |
472 | unsigned int limited_regs; /* allow limited registers only */ | ||
473 | DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ | 478 | DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ |
474 | union { /* vendor specific code */ | 479 | union { /* vendor specific code */ |
475 | struct { | 480 | struct { |
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h index 1a2759f3a292..57af1fe7b309 100644 --- a/include/sound/ad1848.h +++ b/include/sound/ad1848.h | |||
@@ -154,7 +154,7 @@ struct snd_ad1848 { | |||
154 | #endif | 154 | #endif |
155 | 155 | ||
156 | spinlock_t reg_lock; | 156 | spinlock_t reg_lock; |
157 | struct semaphore open_mutex; | 157 | struct mutex open_mutex; |
158 | }; | 158 | }; |
159 | 159 | ||
160 | /* exported functions */ | 160 | /* exported functions */ |
diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h index edf04070ce7c..fb30faab43a8 100644 --- a/include/sound/ak4531_codec.h +++ b/include/sound/ak4531_codec.h | |||
@@ -71,7 +71,7 @@ struct snd_ak4531 { | |||
71 | void (*private_free) (struct snd_ak4531 *ak4531); | 71 | void (*private_free) (struct snd_ak4531 *ak4531); |
72 | /* --- */ | 72 | /* --- */ |
73 | unsigned char regs[0x20]; | 73 | unsigned char regs[0x20]; |
74 | struct semaphore reg_mutex; | 74 | struct mutex reg_mutex; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531, | 77 | int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531, |
diff --git a/include/sound/core.h b/include/sound/core.h index 3093e3ddcf36..144bdc2f217f 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/sched.h> /* wake_up() */ | 25 | #include <linux/sched.h> /* wake_up() */ |
26 | #include <asm/semaphore.h> /* struct semaphore */ | 26 | #include <linux/mutex.h> /* struct mutex */ |
27 | #include <linux/rwsem.h> /* struct rw_semaphore */ | 27 | #include <linux/rwsem.h> /* struct rw_semaphore */ |
28 | #include <linux/workqueue.h> /* struct workqueue_struct */ | 28 | #include <linux/workqueue.h> /* struct workqueue_struct */ |
29 | #include <linux/pm.h> /* pm_message_t */ | 29 | #include <linux/pm.h> /* pm_message_t */ |
@@ -137,7 +137,7 @@ struct snd_card { | |||
137 | 137 | ||
138 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
139 | unsigned int power_state; /* power state */ | 139 | unsigned int power_state; /* power state */ |
140 | struct semaphore power_lock; /* power lock */ | 140 | struct mutex power_lock; /* power lock */ |
141 | wait_queue_head_t power_sleep; | 141 | wait_queue_head_t power_sleep; |
142 | #endif | 142 | #endif |
143 | 143 | ||
@@ -150,12 +150,12 @@ struct snd_card { | |||
150 | #ifdef CONFIG_PM | 150 | #ifdef CONFIG_PM |
151 | static inline void snd_power_lock(struct snd_card *card) | 151 | static inline void snd_power_lock(struct snd_card *card) |
152 | { | 152 | { |
153 | down(&card->power_lock); | 153 | mutex_lock(&card->power_lock); |
154 | } | 154 | } |
155 | 155 | ||
156 | static inline void snd_power_unlock(struct snd_card *card) | 156 | static inline void snd_power_unlock(struct snd_card *card) |
157 | { | 157 | { |
158 | up(&card->power_lock); | 158 | mutex_unlock(&card->power_lock); |
159 | } | 159 | } |
160 | 160 | ||
161 | static inline unsigned int snd_power_get_state(struct snd_card *card) | 161 | static inline unsigned int snd_power_get_state(struct snd_card *card) |
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h index ac6a5d882088..60b5b92a1319 100644 --- a/include/sound/cs4231.h +++ b/include/sound/cs4231.h | |||
@@ -248,8 +248,8 @@ struct snd_cs4231 { | |||
248 | unsigned int c_dma_size; | 248 | unsigned int c_dma_size; |
249 | 249 | ||
250 | spinlock_t reg_lock; | 250 | spinlock_t reg_lock; |
251 | struct semaphore mce_mutex; | 251 | struct mutex mce_mutex; |
252 | struct semaphore open_mutex; | 252 | struct mutex open_mutex; |
253 | 253 | ||
254 | int (*rate_constraint) (struct snd_pcm_runtime *runtime); | 254 | int (*rate_constraint) (struct snd_pcm_runtime *runtime); |
255 | void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr); | 255 | void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr); |
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h index 199b5098ff7e..80b2979c0cba 100644 --- a/include/sound/cs46xx.h +++ b/include/sound/cs46xx.h | |||
@@ -1711,7 +1711,7 @@ struct snd_cs46xx { | |||
1711 | int current_gpio; | 1711 | int current_gpio; |
1712 | #endif | 1712 | #endif |
1713 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 1713 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
1714 | struct semaphore spos_mutex; | 1714 | struct mutex spos_mutex; |
1715 | 1715 | ||
1716 | struct dsp_spos_instance * dsp_spos_instance; | 1716 | struct dsp_spos_instance * dsp_spos_instance; |
1717 | 1717 | ||
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 951e40d720d9..186e00ad9e79 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <sound/pcm-indirect.h> | 33 | #include <sound/pcm-indirect.h> |
34 | #include <sound/timer.h> | 34 | #include <sound/timer.h> |
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | #include <linux/mutex.h> | ||
36 | #include <asm/io.h> | 37 | #include <asm/io.h> |
37 | 38 | ||
38 | /* ------------------- DEFINES -------------------- */ | 39 | /* ------------------- DEFINES -------------------- */ |
@@ -1022,7 +1023,7 @@ struct snd_emu10k1_fx8010 { | |||
1022 | int gpr_size; /* size of allocated GPR controls */ | 1023 | int gpr_size; /* size of allocated GPR controls */ |
1023 | int gpr_count; /* count of used kcontrols */ | 1024 | int gpr_count; /* count of used kcontrols */ |
1024 | struct list_head gpr_ctl; /* GPR controls */ | 1025 | struct list_head gpr_ctl; /* GPR controls */ |
1025 | struct semaphore lock; | 1026 | struct mutex lock; |
1026 | struct snd_emu10k1_fx8010_pcm pcm[8]; | 1027 | struct snd_emu10k1_fx8010_pcm pcm[8]; |
1027 | spinlock_t irq_lock; | 1028 | spinlock_t irq_lock; |
1028 | struct snd_emu10k1_fx8010_irq *irq_handlers; | 1029 | struct snd_emu10k1_fx8010_irq *irq_handlers; |
@@ -1122,7 +1123,6 @@ struct snd_emu10k1 { | |||
1122 | spinlock_t reg_lock; | 1123 | spinlock_t reg_lock; |
1123 | spinlock_t emu_lock; | 1124 | spinlock_t emu_lock; |
1124 | spinlock_t voice_lock; | 1125 | spinlock_t voice_lock; |
1125 | struct semaphore ptb_lock; | ||
1126 | 1126 | ||
1127 | struct snd_emu10k1_voice voices[NUM_G]; | 1127 | struct snd_emu10k1_voice voices[NUM_G]; |
1128 | struct snd_emu10k1_voice p16v_voices[4]; | 1128 | struct snd_emu10k1_voice p16v_voices[4]; |
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h index b2d6b2acc7c7..d8cb51b86c20 100644 --- a/include/sound/emux_synth.h +++ b/include/sound/emux_synth.h | |||
@@ -113,7 +113,7 @@ struct snd_emux { | |||
113 | struct snd_emux_voice *voices; /* Voices (EMU 'channel') */ | 113 | struct snd_emux_voice *voices; /* Voices (EMU 'channel') */ |
114 | int use_time; /* allocation counter */ | 114 | int use_time; /* allocation counter */ |
115 | spinlock_t voice_lock; /* Lock for voice access */ | 115 | spinlock_t voice_lock; /* Lock for voice access */ |
116 | struct semaphore register_mutex; | 116 | struct mutex register_mutex; |
117 | int client; /* For the sequencer client */ | 117 | int client; /* For the sequencer client */ |
118 | int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ | 118 | int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ |
119 | struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS]; | 119 | struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS]; |
diff --git a/include/sound/gus.h b/include/sound/gus.h index 63da50fae773..68a664ab97f3 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h | |||
@@ -209,7 +209,7 @@ struct snd_gf1_mem { | |||
209 | struct snd_gf1_bank_info banks_16[4]; | 209 | struct snd_gf1_bank_info banks_16[4]; |
210 | struct snd_gf1_mem_block *first; | 210 | struct snd_gf1_mem_block *first; |
211 | struct snd_gf1_mem_block *last; | 211 | struct snd_gf1_mem_block *last; |
212 | struct semaphore memory_mutex; | 212 | struct mutex memory_mutex; |
213 | }; | 213 | }; |
214 | 214 | ||
215 | struct snd_gf1_dma_block { | 215 | struct snd_gf1_dma_block { |
@@ -467,8 +467,8 @@ struct snd_gus_card { | |||
467 | spinlock_t dma_lock; | 467 | spinlock_t dma_lock; |
468 | spinlock_t pcm_volume_level_lock; | 468 | spinlock_t pcm_volume_level_lock; |
469 | spinlock_t uart_cmd_lock; | 469 | spinlock_t uart_cmd_lock; |
470 | struct semaphore dma_mutex; | 470 | struct mutex dma_mutex; |
471 | struct semaphore register_mutex; | 471 | struct mutex register_mutex; |
472 | }; | 472 | }; |
473 | 473 | ||
474 | /* I/O functions for GF1/InterWave chip - gus_io.c */ | 474 | /* I/O functions for GF1/InterWave chip - gus_io.c */ |
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h index c679e5b31111..94c387b5d724 100644 --- a/include/sound/hwdep.h +++ b/include/sound/hwdep.h | |||
@@ -60,7 +60,7 @@ struct snd_hwdep { | |||
60 | void *private_data; | 60 | void *private_data; |
61 | void (*private_free) (struct snd_hwdep *hwdep); | 61 | void (*private_free) (struct snd_hwdep *hwdep); |
62 | 62 | ||
63 | struct semaphore open_mutex; | 63 | struct mutex open_mutex; |
64 | int used; | 64 | int used; |
65 | unsigned int dsp_loaded; | 65 | unsigned int dsp_loaded; |
66 | unsigned int exclusive: 1; | 66 | unsigned int exclusive: 1; |
diff --git a/include/sound/i2c.h b/include/sound/i2c.h index 81eb23ed761f..d125ff8c85e8 100644 --- a/include/sound/i2c.h +++ b/include/sound/i2c.h | |||
@@ -55,7 +55,7 @@ struct snd_i2c_bus { | |||
55 | struct snd_card *card; /* card which I2C belongs to */ | 55 | struct snd_card *card; /* card which I2C belongs to */ |
56 | char name[32]; /* some useful label */ | 56 | char name[32]; /* some useful label */ |
57 | 57 | ||
58 | struct semaphore lock_mutex; | 58 | struct mutex lock_mutex; |
59 | 59 | ||
60 | struct snd_i2c_bus *master; /* master bus when SCK/SCL is shared */ | 60 | struct snd_i2c_bus *master; /* master bus when SCK/SCL is shared */ |
61 | struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */ | 61 | struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */ |
@@ -84,17 +84,17 @@ int snd_i2c_device_free(struct snd_i2c_device *device); | |||
84 | static inline void snd_i2c_lock(struct snd_i2c_bus *bus) | 84 | static inline void snd_i2c_lock(struct snd_i2c_bus *bus) |
85 | { | 85 | { |
86 | if (bus->master) | 86 | if (bus->master) |
87 | down(&bus->master->lock_mutex); | 87 | mutex_lock(&bus->master->lock_mutex); |
88 | else | 88 | else |
89 | down(&bus->lock_mutex); | 89 | mutex_lock(&bus->lock_mutex); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline void snd_i2c_unlock(struct snd_i2c_bus *bus) | 92 | static inline void snd_i2c_unlock(struct snd_i2c_bus *bus) |
93 | { | 93 | { |
94 | if (bus->master) | 94 | if (bus->master) |
95 | up(&bus->master->lock_mutex); | 95 | mutex_unlock(&bus->master->lock_mutex); |
96 | else | 96 | else |
97 | up(&bus->lock_mutex); | 97 | mutex_unlock(&bus->lock_mutex); |
98 | } | 98 | } |
99 | 99 | ||
100 | int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count); | 100 | int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count); |
diff --git a/include/sound/info.h b/include/sound/info.h index 8ea5c7497c03..f23d8381c216 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
@@ -84,7 +84,7 @@ struct snd_info_entry { | |||
84 | void *private_data; | 84 | void *private_data; |
85 | void (*private_free)(struct snd_info_entry *entry); | 85 | void (*private_free)(struct snd_info_entry *entry); |
86 | struct proc_dir_entry *p; | 86 | struct proc_dir_entry *p; |
87 | struct semaphore access; | 87 | struct mutex access; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) | 90 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) |
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h index ca5b4822b62c..197b9e3d612b 100644 --- a/include/sound/mixer_oss.h +++ b/include/sound/mixer_oss.h | |||
@@ -61,7 +61,7 @@ struct snd_mixer_oss { | |||
61 | unsigned int active_index); | 61 | unsigned int active_index); |
62 | void *private_data_recsrc; | 62 | void *private_data_recsrc; |
63 | void (*private_free_recsrc)(struct snd_mixer_oss *mixer); | 63 | void (*private_free_recsrc)(struct snd_mixer_oss *mixer); |
64 | struct semaphore reg_mutex; | 64 | struct mutex reg_mutex; |
65 | struct snd_info_entry *proc_entry; | 65 | struct snd_info_entry *proc_entry; |
66 | int oss_dev_alloc; | 66 | int oss_dev_alloc; |
67 | /* --- */ | 67 | /* --- */ |
diff --git a/include/sound/opl3.h b/include/sound/opl3.h index 83392641cb47..444907166f97 100644 --- a/include/sound/opl3.h +++ b/include/sound/opl3.h | |||
@@ -53,6 +53,7 @@ | |||
53 | 53 | ||
54 | #include "driver.h" | 54 | #include "driver.h" |
55 | #include <linux/time.h> | 55 | #include <linux/time.h> |
56 | #include <linux/mutex.h> | ||
56 | #include "core.h" | 57 | #include "core.h" |
57 | #include "hwdep.h" | 58 | #include "hwdep.h" |
58 | #include "timer.h" | 59 | #include "timer.h" |
@@ -312,7 +313,7 @@ struct snd_opl3 { | |||
312 | int sys_timer_status; /* system timer run status */ | 313 | int sys_timer_status; /* system timer run status */ |
313 | spinlock_t sys_timer_lock; /* Lock for system timer access */ | 314 | spinlock_t sys_timer_lock; /* Lock for system timer access */ |
314 | #endif | 315 | #endif |
315 | struct semaphore access_mutex; /* locking */ | 316 | struct mutex access_mutex; /* locking */ |
316 | }; | 317 | }; |
317 | 318 | ||
318 | /* opl3.c */ | 319 | /* opl3.c */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 314268a11048..15b885660bf0 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -420,7 +420,7 @@ struct snd_pcm { | |||
420 | char id[64]; | 420 | char id[64]; |
421 | char name[80]; | 421 | char name[80]; |
422 | struct snd_pcm_str streams[2]; | 422 | struct snd_pcm_str streams[2]; |
423 | struct semaphore open_mutex; | 423 | struct mutex open_mutex; |
424 | wait_queue_head_t open_wait; | 424 | wait_queue_head_t open_wait; |
425 | void *private_data; | 425 | void *private_data; |
426 | void (*private_free) (struct snd_pcm *pcm); | 426 | void (*private_free) (struct snd_pcm *pcm); |
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h index fddaddde47b4..bff0778e1969 100644 --- a/include/sound/pcm_oss.h +++ b/include/sound/pcm_oss.h | |||
@@ -56,8 +56,10 @@ struct snd_pcm_oss_runtime { | |||
56 | size_t mmap_bytes; | 56 | size_t mmap_bytes; |
57 | char *buffer; /* vmallocated period */ | 57 | char *buffer; /* vmallocated period */ |
58 | size_t buffer_used; /* used length from period buffer */ | 58 | size_t buffer_used; /* used length from period buffer */ |
59 | #ifdef CONFIG_SND_PCM_OSS_PLUGINS | ||
59 | struct snd_pcm_plugin *plugin_first; | 60 | struct snd_pcm_plugin *plugin_first; |
60 | struct snd_pcm_plugin *plugin_last; | 61 | struct snd_pcm_plugin *plugin_last; |
62 | #endif | ||
61 | unsigned int prev_hw_ptr_interrupt; | 63 | unsigned int prev_hw_ptr_interrupt; |
62 | }; | 64 | }; |
63 | 65 | ||
@@ -73,7 +75,7 @@ struct snd_pcm_oss_substream { | |||
73 | 75 | ||
74 | struct snd_pcm_oss_stream { | 76 | struct snd_pcm_oss_stream { |
75 | struct snd_pcm_oss_setup *setup_list; /* setup list */ | 77 | struct snd_pcm_oss_setup *setup_list; /* setup list */ |
76 | struct semaphore setup_mutex; | 78 | struct mutex setup_mutex; |
77 | struct snd_info_entry *proc_entry; | 79 | struct snd_info_entry *proc_entry; |
78 | }; | 80 | }; |
79 | 81 | ||
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index d19bddfbf995..584e73dd4793 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <asm/semaphore.h> | 29 | #include <linux/mutex.h> |
30 | 30 | ||
31 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | 31 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) |
32 | #include "seq_device.h" | 32 | #include "seq_device.h" |
@@ -130,7 +130,7 @@ struct snd_rawmidi { | |||
130 | void *private_data; | 130 | void *private_data; |
131 | void (*private_free) (struct snd_rawmidi *rmidi); | 131 | void (*private_free) (struct snd_rawmidi *rmidi); |
132 | 132 | ||
133 | struct semaphore open_mutex; | 133 | struct mutex open_mutex; |
134 | wait_queue_head_t open_wait; | 134 | wait_queue_head_t open_wait; |
135 | 135 | ||
136 | struct snd_info_entry *dev; | 136 | struct snd_info_entry *dev; |
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h index 3b44d4b370f5..caf6fe21514d 100644 --- a/include/sound/sb16_csp.h +++ b/include/sound/sb16_csp.h | |||
@@ -158,7 +158,7 @@ struct snd_sb_csp { | |||
158 | struct snd_kcontrol *qsound_switch; | 158 | struct snd_kcontrol *qsound_switch; |
159 | struct snd_kcontrol *qsound_space; | 159 | struct snd_kcontrol *qsound_space; |
160 | 160 | ||
161 | struct semaphore access_mutex; /* locking */ | 161 | struct mutex access_mutex; /* locking */ |
162 | }; | 162 | }; |
163 | 163 | ||
164 | int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); | 164 | int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); |
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h index db764f09efb7..f2db03bfd74e 100644 --- a/include/sound/seq_instr.h +++ b/include/sound/seq_instr.h | |||
@@ -64,7 +64,7 @@ struct snd_seq_kinstr_list { | |||
64 | 64 | ||
65 | spinlock_t lock; | 65 | spinlock_t lock; |
66 | spinlock_t ops_lock; | 66 | spinlock_t ops_lock; |
67 | struct semaphore ops_mutex; | 67 | struct mutex ops_mutex; |
68 | unsigned long ops_flags; | 68 | unsigned long ops_flags; |
69 | }; | 69 | }; |
70 | 70 | ||
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h index 61a010c65d02..f95d99ba7f74 100644 --- a/include/sound/soundfont.h +++ b/include/sound/soundfont.h | |||
@@ -93,7 +93,7 @@ struct snd_sf_list { | |||
93 | int sample_locked; /* locked time for sample */ | 93 | int sample_locked; /* locked time for sample */ |
94 | struct snd_sf_callback callback; /* callback functions */ | 94 | struct snd_sf_callback callback; /* callback functions */ |
95 | int presets_locked; | 95 | int presets_locked; |
96 | struct semaphore presets_mutex; | 96 | struct mutex presets_mutex; |
97 | spinlock_t lock; | 97 | spinlock_t lock; |
98 | struct snd_util_memhdr *memhdr; | 98 | struct snd_util_memhdr *memhdr; |
99 | }; | 99 | }; |
diff --git a/include/sound/util_mem.h b/include/sound/util_mem.h index 69944bbb5445..a1fb706b59a6 100644 --- a/include/sound/util_mem.h +++ b/include/sound/util_mem.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifndef __SOUND_UTIL_MEM_H | 1 | #ifndef __SOUND_UTIL_MEM_H |
2 | #define __SOUND_UTIL_MEM_H | 2 | #define __SOUND_UTIL_MEM_H |
3 | |||
4 | #include <linux/mutex.h> | ||
3 | /* | 5 | /* |
4 | * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> | 6 | * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> |
5 | * | 7 | * |
@@ -40,7 +42,7 @@ struct snd_util_memhdr { | |||
40 | int nblocks; /* # of allocated blocks */ | 42 | int nblocks; /* # of allocated blocks */ |
41 | unsigned int used; /* used memory size */ | 43 | unsigned int used; /* used memory size */ |
42 | int block_extra_size; /* extra data size of chunk */ | 44 | int block_extra_size; /* extra data size of chunk */ |
43 | struct semaphore block_mutex; /* lock */ | 45 | struct mutex block_mutex; /* lock */ |
44 | }; | 46 | }; |
45 | 47 | ||
46 | /* | 48 | /* |
diff --git a/include/sound/version.h b/include/sound/version.h index 919da0dd001c..4f0e65808cf1 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by configure. */ | 1 | /* include/version.h. Generated by configure. */ |
2 | #define CONFIG_SND_VERSION "1.0.11rc2" | 2 | #define CONFIG_SND_VERSION "1.0.11rc4" |
3 | #define CONFIG_SND_DATE " (Wed Jan 04 08:57:20 2006 UTC)" | 3 | #define CONFIG_SND_DATE " (Wed Mar 22 10:27:24 2006 UTC)" |
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 5fd6f3305e0d..9821a6194caa 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h | |||
@@ -206,7 +206,7 @@ struct vx_core { | |||
206 | int audio_monitor[4]; /* playback hw-monitor level */ | 206 | int audio_monitor[4]; /* playback hw-monitor level */ |
207 | unsigned char audio_monitor_active[4]; /* playback hw-monitor mute/unmute */ | 207 | unsigned char audio_monitor_active[4]; /* playback hw-monitor mute/unmute */ |
208 | 208 | ||
209 | struct semaphore mixer_mutex; | 209 | struct mutex mixer_mutex; |
210 | 210 | ||
211 | const struct firmware *firmware[4]; /* loaded firmware data */ | 211 | const struct firmware *firmware[4]; /* loaded firmware data */ |
212 | }; | 212 | }; |
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index d567bfdbf513..d41cda97e952 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
@@ -269,9 +269,10 @@ struct snd_ymfpci_pcm { | |||
269 | enum snd_ymfpci_pcm_type type; | 269 | enum snd_ymfpci_pcm_type type; |
270 | struct snd_pcm_substream *substream; | 270 | struct snd_pcm_substream *substream; |
271 | struct snd_ymfpci_voice *voices[2]; /* playback only */ | 271 | struct snd_ymfpci_voice *voices[2]; /* playback only */ |
272 | unsigned int running: 1; | 272 | unsigned int running: 1, |
273 | unsigned int output_front: 1; | 273 | output_front: 1, |
274 | unsigned int output_rear: 1; | 274 | output_rear: 1, |
275 | swap_rear: 1; | ||
275 | unsigned int update_pcm_vol; | 276 | unsigned int update_pcm_vol; |
276 | u32 period_size; /* cached from runtime->period_size */ | 277 | u32 period_size; /* cached from runtime->period_size */ |
277 | u32 buffer_size; /* cached from runtime->buffer_size */ | 278 | u32 buffer_size; /* cached from runtime->buffer_size */ |
@@ -344,6 +345,7 @@ struct snd_ymfpci { | |||
344 | struct snd_kcontrol *spdif_pcm_ctl; | 345 | struct snd_kcontrol *spdif_pcm_ctl; |
345 | int mode_dup4ch; | 346 | int mode_dup4ch; |
346 | int rear_opened; | 347 | int rear_opened; |
348 | int rear_swap; | ||
347 | int spdif_opened; | 349 | int spdif_opened; |
348 | struct { | 350 | struct { |
349 | u16 left; | 351 | u16 left; |
@@ -376,7 +378,7 @@ int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | |||
376 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | 378 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); |
377 | int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | 379 | int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); |
378 | int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | 380 | int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); |
379 | int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch); | 381 | int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch, int rear_swap); |
380 | int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); | 382 | int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); |
381 | 383 | ||
382 | #endif /* __SOUND_YMFPCI_H */ | 384 | #endif /* __SOUND_YMFPCI_H */ |