diff options
Diffstat (limited to 'include/asm-mips')
32 files changed, 251 insertions, 273 deletions
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 45c706e34df1..c6275088cf65 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -19,12 +19,16 @@ | |||
19 | #define _ATYPE_ | 19 | #define _ATYPE_ |
20 | #define _ATYPE32_ | 20 | #define _ATYPE32_ |
21 | #define _ATYPE64_ | 21 | #define _ATYPE64_ |
22 | #define _LLCONST_(x) x | 22 | #define _CONST64_(x) x |
23 | #else | 23 | #else |
24 | #define _ATYPE_ __PTRDIFF_TYPE__ | 24 | #define _ATYPE_ __PTRDIFF_TYPE__ |
25 | #define _ATYPE32_ int | 25 | #define _ATYPE32_ int |
26 | #define _ATYPE64_ long long | 26 | #define _ATYPE64_ __s64 |
27 | #define _LLCONST_(x) x ## LL | 27 | #ifdef CONFIG_64BIT |
28 | #define _CONST64_(x) x ## L | ||
29 | #else | ||
30 | #define _CONST64_(x) x ## LL | ||
31 | #endif | ||
28 | #endif | 32 | #endif |
29 | 33 | ||
30 | /* | 34 | /* |
@@ -48,7 +52,7 @@ | |||
48 | */ | 52 | */ |
49 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) | 53 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) |
50 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ | 54 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ |
51 | _LLCONST_(0x000000ffffffffff)) | 55 | _CONST64_(0x000000ffffffffff)) |
52 | 56 | ||
53 | #ifdef CONFIG_64BIT | 57 | #ifdef CONFIG_64BIT |
54 | 58 | ||
@@ -57,14 +61,14 @@ | |||
57 | * The compatibility segments use the full 64-bit sign extended value. Note | 61 | * The compatibility segments use the full 64-bit sign extended value. Note |
58 | * the R8000 doesn't have them so don't reference these in generic MIPS code. | 62 | * the R8000 doesn't have them so don't reference these in generic MIPS code. |
59 | */ | 63 | */ |
60 | #define XKUSEG _LLCONST_(0x0000000000000000) | 64 | #define XKUSEG _CONST64_(0x0000000000000000) |
61 | #define XKSSEG _LLCONST_(0x4000000000000000) | 65 | #define XKSSEG _CONST64_(0x4000000000000000) |
62 | #define XKPHYS _LLCONST_(0x8000000000000000) | 66 | #define XKPHYS _CONST64_(0x8000000000000000) |
63 | #define XKSEG _LLCONST_(0xc000000000000000) | 67 | #define XKSEG _CONST64_(0xc000000000000000) |
64 | #define CKSEG0 _LLCONST_(0xffffffff80000000) | 68 | #define CKSEG0 _CONST64_(0xffffffff80000000) |
65 | #define CKSEG1 _LLCONST_(0xffffffffa0000000) | 69 | #define CKSEG1 _CONST64_(0xffffffffa0000000) |
66 | #define CKSSEG _LLCONST_(0xffffffffc0000000) | 70 | #define CKSSEG _CONST64_(0xffffffffc0000000) |
67 | #define CKSEG3 _LLCONST_(0xffffffffe0000000) | 71 | #define CKSEG3 _CONST64_(0xffffffffe0000000) |
68 | 72 | ||
69 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) | 73 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) |
70 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) | 74 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) |
@@ -122,7 +126,7 @@ | |||
122 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) | 126 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) |
123 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) | 127 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) |
124 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) | 128 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) |
125 | #define PHYS_TO_XKPHYS(cm,a) (_LLCONST_(0x8000000000000000) | \ | 129 | #define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \ |
126 | ((cm)<<59) | (a)) | 130 | ((cm)<<59) | (a)) |
127 | 131 | ||
128 | #if defined (CONFIG_CPU_R4300) \ | 132 | #if defined (CONFIG_CPU_R4300) \ |
@@ -132,20 +136,20 @@ | |||
132 | || defined (CONFIG_CPU_NEVADA) \ | 136 | || defined (CONFIG_CPU_NEVADA) \ |
133 | || defined (CONFIG_CPU_TX49XX) \ | 137 | || defined (CONFIG_CPU_TX49XX) \ |
134 | || defined (CONFIG_CPU_MIPS64) | 138 | || defined (CONFIG_CPU_MIPS64) |
135 | #define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */ | 139 | #define TO_PHYS_MASK _CONST64_(0x0000000fffffffff) /* 2^^36 - 1 */ |
136 | #endif | 140 | #endif |
137 | 141 | ||
138 | #if defined (CONFIG_CPU_R8000) | 142 | #if defined (CONFIG_CPU_R8000) |
139 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ | 143 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ |
140 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ | 144 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ |
141 | #endif | 145 | #endif |
142 | 146 | ||
143 | #if defined (CONFIG_CPU_R10000) | 147 | #if defined (CONFIG_CPU_R10000) |
144 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ | 148 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ |
145 | #endif | 149 | #endif |
146 | 150 | ||
147 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) | 151 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) |
148 | #define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */ | 152 | #define TO_PHYS_MASK _CONST64_(0x00000fffffffffff) /* 2^^44 - 1 */ |
149 | #endif | 153 | #endif |
150 | 154 | ||
151 | #ifndef CONFIG_CPU_R8000 | 155 | #ifndef CONFIG_CPU_R8000 |
@@ -155,7 +159,7 @@ | |||
155 | * in order to catch bugs in the source code. | 159 | * in order to catch bugs in the source code. |
156 | */ | 160 | */ |
157 | 161 | ||
158 | #define COMPAT_K1BASE32 _LLCONST_(0xffffffffa0000000) | 162 | #define COMPAT_K1BASE32 _CONST64_(0xffffffffa0000000) |
159 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ | 163 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ |
160 | 164 | ||
161 | #endif | 165 | #endif |
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h index e3038a4599ee..838eb3144d81 100644 --- a/include/asm-mips/asm.h +++ b/include/asm-mips/asm.h | |||
@@ -344,6 +344,7 @@ symbol = value | |||
344 | #define PTR_L lw | 344 | #define PTR_L lw |
345 | #define PTR_S sw | 345 | #define PTR_S sw |
346 | #define PTR_LA la | 346 | #define PTR_LA la |
347 | #define PTR_LI li | ||
347 | #define PTR_SLL sll | 348 | #define PTR_SLL sll |
348 | #define PTR_SLLV sllv | 349 | #define PTR_SLLV sllv |
349 | #define PTR_SRL srl | 350 | #define PTR_SRL srl |
@@ -368,6 +369,7 @@ symbol = value | |||
368 | #define PTR_L ld | 369 | #define PTR_L ld |
369 | #define PTR_S sd | 370 | #define PTR_S sd |
370 | #define PTR_LA dla | 371 | #define PTR_LA dla |
372 | #define PTR_LI dli | ||
371 | #define PTR_SLL dsll | 373 | #define PTR_SLL dsll |
372 | #define PTR_SLLV dsllv | 374 | #define PTR_SLLV dsllv |
373 | #define PTR_SRL dsrl | 375 | #define PTR_SRL dsrl |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index e64abc0d8221..7978d8e11647 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -9,16 +9,8 @@ | |||
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | 10 | * for more details. |
11 | * | 11 | * |
12 | * Copyright (C) 1996, 97, 99, 2000, 03, 04 by Ralf Baechle | 12 | * Copyright (C) 1996, 97, 99, 2000, 03, 04, 06 by Ralf Baechle |
13 | */ | 13 | */ |
14 | |||
15 | /* | ||
16 | * As workaround for the ATOMIC_DEC_AND_LOCK / atomic_dec_and_lock mess in | ||
17 | * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the | ||
18 | * main big wrapper ... | ||
19 | */ | ||
20 | #include <linux/spinlock.h> | ||
21 | |||
22 | #ifndef _ASM_ATOMIC_H | 14 | #ifndef _ASM_ATOMIC_H |
23 | #define _ASM_ATOMIC_H | 15 | #define _ASM_ATOMIC_H |
24 | 16 | ||
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 1bb89c5a10ee..b9007411b60f 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -10,31 +10,26 @@ | |||
10 | #define _ASM_BITOPS_H | 10 | #define _ASM_BITOPS_H |
11 | 11 | ||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
13 | #include <linux/irqflags.h> | ||
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
14 | #include <asm/bug.h> | 15 | #include <asm/bug.h> |
15 | #include <asm/byteorder.h> /* sigh ... */ | 16 | #include <asm/byteorder.h> /* sigh ... */ |
16 | #include <asm/cpu-features.h> | 17 | #include <asm/cpu-features.h> |
18 | #include <asm/sgidefs.h> | ||
19 | #include <asm/war.h> | ||
17 | 20 | ||
18 | #if (_MIPS_SZLONG == 32) | 21 | #if (_MIPS_SZLONG == 32) |
19 | #define SZLONG_LOG 5 | 22 | #define SZLONG_LOG 5 |
20 | #define SZLONG_MASK 31UL | 23 | #define SZLONG_MASK 31UL |
21 | #define __LL "ll " | 24 | #define __LL "ll " |
22 | #define __SC "sc " | 25 | #define __SC "sc " |
23 | #define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) | ||
24 | #elif (_MIPS_SZLONG == 64) | 26 | #elif (_MIPS_SZLONG == 64) |
25 | #define SZLONG_LOG 6 | 27 | #define SZLONG_LOG 6 |
26 | #define SZLONG_MASK 63UL | 28 | #define SZLONG_MASK 63UL |
27 | #define __LL "lld " | 29 | #define __LL "lld " |
28 | #define __SC "scd " | 30 | #define __SC "scd " |
29 | #define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) | ||
30 | #endif | 31 | #endif |
31 | 32 | ||
32 | #ifdef __KERNEL__ | ||
33 | |||
34 | #include <linux/irqflags.h> | ||
35 | #include <asm/sgidefs.h> | ||
36 | #include <asm/war.h> | ||
37 | |||
38 | /* | 33 | /* |
39 | * clear_bit() doesn't provide any barrier for the compiler. | 34 | * clear_bit() doesn't provide any barrier for the compiler. |
40 | */ | 35 | */ |
@@ -42,20 +37,6 @@ | |||
42 | #define smp_mb__after_clear_bit() smp_mb() | 37 | #define smp_mb__after_clear_bit() smp_mb() |
43 | 38 | ||
44 | /* | 39 | /* |
45 | * Only disable interrupt for kernel mode stuff to keep usermode stuff | ||
46 | * that dares to use kernel include files alive. | ||
47 | */ | ||
48 | |||
49 | #define __bi_flags unsigned long flags | ||
50 | #define __bi_local_irq_save(x) local_irq_save(x) | ||
51 | #define __bi_local_irq_restore(x) local_irq_restore(x) | ||
52 | #else | ||
53 | #define __bi_flags | ||
54 | #define __bi_local_irq_save(x) | ||
55 | #define __bi_local_irq_restore(x) | ||
56 | #endif /* __KERNEL__ */ | ||
57 | |||
58 | /* | ||
59 | * set_bit - Atomically set a bit in memory | 40 | * set_bit - Atomically set a bit in memory |
60 | * @nr: the bit to set | 41 | * @nr: the bit to set |
61 | * @addr: the address to start counting from | 42 | * @addr: the address to start counting from |
@@ -93,13 +74,13 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
93 | } else { | 74 | } else { |
94 | volatile unsigned long *a = addr; | 75 | volatile unsigned long *a = addr; |
95 | unsigned long mask; | 76 | unsigned long mask; |
96 | __bi_flags; | 77 | unsigned long flags; |
97 | 78 | ||
98 | a += nr >> SZLONG_LOG; | 79 | a += nr >> SZLONG_LOG; |
99 | mask = 1UL << (nr & SZLONG_MASK); | 80 | mask = 1UL << (nr & SZLONG_MASK); |
100 | __bi_local_irq_save(flags); | 81 | local_irq_save(flags); |
101 | *a |= mask; | 82 | *a |= mask; |
102 | __bi_local_irq_restore(flags); | 83 | local_irq_restore(flags); |
103 | } | 84 | } |
104 | } | 85 | } |
105 | 86 | ||
@@ -141,13 +122,13 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
141 | } else { | 122 | } else { |
142 | volatile unsigned long *a = addr; | 123 | volatile unsigned long *a = addr; |
143 | unsigned long mask; | 124 | unsigned long mask; |
144 | __bi_flags; | 125 | unsigned long flags; |
145 | 126 | ||
146 | a += nr >> SZLONG_LOG; | 127 | a += nr >> SZLONG_LOG; |
147 | mask = 1UL << (nr & SZLONG_MASK); | 128 | mask = 1UL << (nr & SZLONG_MASK); |
148 | __bi_local_irq_save(flags); | 129 | local_irq_save(flags); |
149 | *a &= ~mask; | 130 | *a &= ~mask; |
150 | __bi_local_irq_restore(flags); | 131 | local_irq_restore(flags); |
151 | } | 132 | } |
152 | } | 133 | } |
153 | 134 | ||
@@ -191,13 +172,13 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
191 | } else { | 172 | } else { |
192 | volatile unsigned long *a = addr; | 173 | volatile unsigned long *a = addr; |
193 | unsigned long mask; | 174 | unsigned long mask; |
194 | __bi_flags; | 175 | unsigned long flags; |
195 | 176 | ||
196 | a += nr >> SZLONG_LOG; | 177 | a += nr >> SZLONG_LOG; |
197 | mask = 1UL << (nr & SZLONG_MASK); | 178 | mask = 1UL << (nr & SZLONG_MASK); |
198 | __bi_local_irq_save(flags); | 179 | local_irq_save(flags); |
199 | *a ^= mask; | 180 | *a ^= mask; |
200 | __bi_local_irq_restore(flags); | 181 | local_irq_restore(flags); |
201 | } | 182 | } |
202 | } | 183 | } |
203 | 184 | ||
@@ -258,14 +239,14 @@ static inline int test_and_set_bit(unsigned long nr, | |||
258 | volatile unsigned long *a = addr; | 239 | volatile unsigned long *a = addr; |
259 | unsigned long mask; | 240 | unsigned long mask; |
260 | int retval; | 241 | int retval; |
261 | __bi_flags; | 242 | unsigned long flags; |
262 | 243 | ||
263 | a += nr >> SZLONG_LOG; | 244 | a += nr >> SZLONG_LOG; |
264 | mask = 1UL << (nr & SZLONG_MASK); | 245 | mask = 1UL << (nr & SZLONG_MASK); |
265 | __bi_local_irq_save(flags); | 246 | local_irq_save(flags); |
266 | retval = (mask & *a) != 0; | 247 | retval = (mask & *a) != 0; |
267 | *a |= mask; | 248 | *a |= mask; |
268 | __bi_local_irq_restore(flags); | 249 | local_irq_restore(flags); |
269 | 250 | ||
270 | return retval; | 251 | return retval; |
271 | } | 252 | } |
@@ -330,14 +311,14 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
330 | volatile unsigned long *a = addr; | 311 | volatile unsigned long *a = addr; |
331 | unsigned long mask; | 312 | unsigned long mask; |
332 | int retval; | 313 | int retval; |
333 | __bi_flags; | 314 | unsigned long flags; |
334 | 315 | ||
335 | a += nr >> SZLONG_LOG; | 316 | a += nr >> SZLONG_LOG; |
336 | mask = 1UL << (nr & SZLONG_MASK); | 317 | mask = 1UL << (nr & SZLONG_MASK); |
337 | __bi_local_irq_save(flags); | 318 | local_irq_save(flags); |
338 | retval = (mask & *a) != 0; | 319 | retval = (mask & *a) != 0; |
339 | *a &= ~mask; | 320 | *a &= ~mask; |
340 | __bi_local_irq_restore(flags); | 321 | local_irq_restore(flags); |
341 | 322 | ||
342 | return retval; | 323 | return retval; |
343 | } | 324 | } |
@@ -399,23 +380,19 @@ static inline int test_and_change_bit(unsigned long nr, | |||
399 | } else { | 380 | } else { |
400 | volatile unsigned long *a = addr; | 381 | volatile unsigned long *a = addr; |
401 | unsigned long mask, retval; | 382 | unsigned long mask, retval; |
402 | __bi_flags; | 383 | unsigned long flags; |
403 | 384 | ||
404 | a += nr >> SZLONG_LOG; | 385 | a += nr >> SZLONG_LOG; |
405 | mask = 1UL << (nr & SZLONG_MASK); | 386 | mask = 1UL << (nr & SZLONG_MASK); |
406 | __bi_local_irq_save(flags); | 387 | local_irq_save(flags); |
407 | retval = (mask & *a) != 0; | 388 | retval = (mask & *a) != 0; |
408 | *a ^= mask; | 389 | *a ^= mask; |
409 | __bi_local_irq_restore(flags); | 390 | local_irq_restore(flags); |
410 | 391 | ||
411 | return retval; | 392 | return retval; |
412 | } | 393 | } |
413 | } | 394 | } |
414 | 395 | ||
415 | #undef __bi_flags | ||
416 | #undef __bi_local_irq_save | ||
417 | #undef __bi_local_irq_restore | ||
418 | |||
419 | #include <asm-generic/bitops/non-atomic.h> | 396 | #include <asm-generic/bitops/non-atomic.h> |
420 | 397 | ||
421 | /* | 398 | /* |
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h index 7b4739dc8f3f..4d560a533940 100644 --- a/include/asm-mips/bug.h +++ b/include/asm-mips/bug.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_BUG_H | 1 | #ifndef __ASM_BUG_H |
2 | #define __ASM_BUG_H | 2 | #define __ASM_BUG_H |
3 | 3 | ||
4 | #include <asm/sgidefs.h> | ||
4 | 5 | ||
5 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
6 | 7 | ||
@@ -13,6 +14,17 @@ do { \ | |||
13 | 14 | ||
14 | #define HAVE_ARCH_BUG | 15 | #define HAVE_ARCH_BUG |
15 | 16 | ||
17 | #if (_MIPS_ISA > _MIPS_ISA_MIPS1) | ||
18 | |||
19 | #define BUG_ON(condition) \ | ||
20 | do { \ | ||
21 | __asm__ __volatile__("tne $0, %0" : : "r" (condition)); \ | ||
22 | } while (0) | ||
23 | |||
24 | #define HAVE_ARCH_BUG_ON | ||
25 | |||
26 | #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */ | ||
27 | |||
16 | #endif | 28 | #endif |
17 | 29 | ||
18 | #include <asm-generic/bug.h> | 30 | #include <asm-generic/bug.h> |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 9ab59e2bb233..e3c9925876a3 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end); | |||
55 | #define flush_cache_vmap(start, end) flush_cache_all() | 55 | #define flush_cache_vmap(start, end) flush_cache_all() |
56 | #define flush_cache_vunmap(start, end) flush_cache_all() | 56 | #define flush_cache_vunmap(start, end) flush_cache_all() |
57 | 57 | ||
58 | static inline void copy_to_user_page(struct vm_area_struct *vma, | 58 | extern void copy_to_user_page(struct vm_area_struct *vma, |
59 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 59 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
60 | unsigned long len) | 60 | unsigned long len); |
61 | { | ||
62 | if (cpu_has_dc_aliases) | ||
63 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
64 | memcpy(dst, src, len); | ||
65 | __flush_icache_page(vma, page); | ||
66 | } | ||
67 | 61 | ||
68 | static inline void copy_from_user_page(struct vm_area_struct *vma, | 62 | extern void copy_from_user_page(struct vm_area_struct *vma, |
69 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 63 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
70 | unsigned long len) | 64 | unsigned long len); |
71 | { | ||
72 | if (cpu_has_dc_aliases) | ||
73 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
74 | memcpy(dst, src, len); | ||
75 | } | ||
76 | 65 | ||
77 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 66 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
78 | extern void (*flush_icache_all)(void); | 67 | extern void (*flush_icache_all)(void); |
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index a5e6050ec0f3..9b768c3b96b3 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h | |||
@@ -27,23 +27,22 @@ | |||
27 | * | 27 | * |
28 | * it's best to have buff aligned on a 32-bit boundary | 28 | * it's best to have buff aligned on a 32-bit boundary |
29 | */ | 29 | */ |
30 | unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum); | 30 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * this is a new version of the above that records errors it finds in *errp, | 33 | * this is a new version of the above that records errors it finds in *errp, |
34 | * but continues and zeros the rest of the buffer. | 34 | * but continues and zeros the rest of the buffer. |
35 | */ | 35 | */ |
36 | unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | 36 | __wsum csum_partial_copy_from_user(const void __user *src, |
37 | unsigned char *dst, int len, | 37 | void *dst, int len, |
38 | unsigned int sum, int *errp); | 38 | __wsum sum, int *errp); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Copy and checksum to user | 41 | * Copy and checksum to user |
42 | */ | 42 | */ |
43 | #define HAVE_CSUM_COPY_USER | 43 | #define HAVE_CSUM_COPY_USER |
44 | static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | 44 | static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst, |
45 | unsigned char __user *dst, | 45 | int len, __wsum sum, |
46 | int len, int sum, | ||
47 | int *err_ptr) | 46 | int *err_ptr) |
48 | { | 47 | { |
49 | might_sleep(); | 48 | might_sleep(); |
@@ -51,7 +50,7 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | |||
51 | 50 | ||
52 | if (copy_to_user(dst, src, len)) { | 51 | if (copy_to_user(dst, src, len)) { |
53 | *err_ptr = -EFAULT; | 52 | *err_ptr = -EFAULT; |
54 | return -1; | 53 | return (__force __wsum)-1; |
55 | } | 54 | } |
56 | 55 | ||
57 | return sum; | 56 | return sum; |
@@ -61,13 +60,13 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | |||
61 | * the same as csum_partial, but copies from user space (but on MIPS | 60 | * the same as csum_partial, but copies from user space (but on MIPS |
62 | * we have just one address space, so this is identical to the above) | 61 | * we have just one address space, so this is identical to the above) |
63 | */ | 62 | */ |
64 | unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, | 63 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
65 | int len, unsigned int sum); | 64 | int len, __wsum sum); |
66 | 65 | ||
67 | /* | 66 | /* |
68 | * Fold a partial checksum without adding pseudo headers | 67 | * Fold a partial checksum without adding pseudo headers |
69 | */ | 68 | */ |
70 | static inline unsigned short int csum_fold(unsigned int sum) | 69 | static inline __sum16 csum_fold(__wsum sum) |
71 | { | 70 | { |
72 | __asm__( | 71 | __asm__( |
73 | " .set push # csum_fold\n" | 72 | " .set push # csum_fold\n" |
@@ -82,7 +81,7 @@ static inline unsigned short int csum_fold(unsigned int sum) | |||
82 | : "=r" (sum) | 81 | : "=r" (sum) |
83 | : "0" (sum)); | 82 | : "0" (sum)); |
84 | 83 | ||
85 | return sum; | 84 | return (__force __sum16)sum; |
86 | } | 85 | } |
87 | 86 | ||
88 | /* | 87 | /* |
@@ -92,10 +91,10 @@ static inline unsigned short int csum_fold(unsigned int sum) | |||
92 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by | 91 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by |
93 | * Arnt Gulbrandsen. | 92 | * Arnt Gulbrandsen. |
94 | */ | 93 | */ |
95 | static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | 94 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
96 | { | 95 | { |
97 | unsigned int *word = (unsigned int *) iph; | 96 | const unsigned int *word = iph; |
98 | unsigned int *stop = word + ihl; | 97 | const unsigned int *stop = word + ihl; |
99 | unsigned int csum; | 98 | unsigned int csum; |
100 | int carry; | 99 | int carry; |
101 | 100 | ||
@@ -123,9 +122,9 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
123 | return csum_fold(csum); | 122 | return csum_fold(csum); |
124 | } | 123 | } |
125 | 124 | ||
126 | static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | 125 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, |
127 | unsigned long daddr, unsigned short len, unsigned short proto, | 126 | __be32 daddr, unsigned short len, unsigned short proto, |
128 | unsigned int sum) | 127 | __wsum sum) |
129 | { | 128 | { |
130 | __asm__( | 129 | __asm__( |
131 | " .set push # csum_tcpudp_nofold\n" | 130 | " .set push # csum_tcpudp_nofold\n" |
@@ -155,9 +154,9 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | |||
155 | : "=r" (sum) | 154 | : "=r" (sum) |
156 | : "0" (daddr), "r"(saddr), | 155 | : "0" (daddr), "r"(saddr), |
157 | #ifdef __MIPSEL__ | 156 | #ifdef __MIPSEL__ |
158 | "r" (((unsigned long)htons(len)<<16) + proto*256), | 157 | "r" ((proto + len) << 8), |
159 | #else | 158 | #else |
160 | "r" (((unsigned long)(proto)<<16) + len), | 159 | "r" (proto + len), |
161 | #endif | 160 | #endif |
162 | "r" (sum)); | 161 | "r" (sum)); |
163 | 162 | ||
@@ -168,11 +167,10 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | |||
168 | * computes the checksum of the TCP/UDP pseudo-header | 167 | * computes the checksum of the TCP/UDP pseudo-header |
169 | * returns a 16-bit checksum, already complemented | 168 | * returns a 16-bit checksum, already complemented |
170 | */ | 169 | */ |
171 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 170 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
172 | unsigned long daddr, | ||
173 | unsigned short len, | 171 | unsigned short len, |
174 | unsigned short proto, | 172 | unsigned short proto, |
175 | unsigned int sum) | 173 | __wsum sum) |
176 | { | 174 | { |
177 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); | 175 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); |
178 | } | 176 | } |
@@ -181,17 +179,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
181 | * this routine is used for miscellaneous IP-like checksums, mainly | 179 | * this routine is used for miscellaneous IP-like checksums, mainly |
182 | * in icmp.c | 180 | * in icmp.c |
183 | */ | 181 | */ |
184 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 182 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
185 | { | 183 | { |
186 | return csum_fold(csum_partial(buff, len, 0)); | 184 | return csum_fold(csum_partial(buff, len, 0)); |
187 | } | 185 | } |
188 | 186 | ||
189 | #define _HAVE_ARCH_IPV6_CSUM | 187 | #define _HAVE_ARCH_IPV6_CSUM |
190 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 188 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
191 | struct in6_addr *daddr, | 189 | const struct in6_addr *daddr, |
192 | __u32 len, | 190 | __u32 len, unsigned short proto, |
193 | unsigned short proto, | 191 | __wsum sum) |
194 | unsigned int sum) | ||
195 | { | 192 | { |
196 | __asm__( | 193 | __asm__( |
197 | " .set push # csum_ipv6_magic\n" | 194 | " .set push # csum_ipv6_magic\n" |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index a2f0c8ea9160..610d0cdeaa9e 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -22,12 +22,12 @@ | |||
22 | * Descriptor for a cache | 22 | * Descriptor for a cache |
23 | */ | 23 | */ |
24 | struct cache_desc { | 24 | struct cache_desc { |
25 | unsigned short linesz; /* Size of line in bytes */ | ||
26 | unsigned short ways; /* Number of ways */ | ||
27 | unsigned short sets; /* Number of lines per set */ | ||
28 | unsigned int waysize; /* Bytes per way */ | 25 | unsigned int waysize; /* Bytes per way */ |
29 | unsigned int waybit; /* Bits to select in a cache set */ | 26 | unsigned short sets; /* Number of lines per set */ |
30 | unsigned int flags; /* Flags describing cache properties */ | 27 | unsigned char ways; /* Number of ways */ |
28 | unsigned char linesz; /* Size of line in bytes */ | ||
29 | unsigned char waybit; /* Bits to select in a cache set */ | ||
30 | unsigned char flags; /* Flags describing cache properties */ | ||
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* | 33 | /* |
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h index 8319ad77b250..93430b5f4724 100644 --- a/include/asm-mips/dec/kn02.h +++ b/include/asm-mips/dec/kn02.h | |||
@@ -82,11 +82,9 @@ | |||
82 | 82 | ||
83 | #ifndef __ASSEMBLY__ | 83 | #ifndef __ASSEMBLY__ |
84 | 84 | ||
85 | #include <linux/spinlock.h> | ||
86 | #include <linux/types.h> | 85 | #include <linux/types.h> |
87 | 86 | ||
88 | extern u32 cached_kn02_csr; | 87 | extern u32 cached_kn02_csr; |
89 | extern spinlock_t kn02_lock; | ||
90 | extern void init_kn02_irqs(int base); | 88 | extern void init_kn02_irqs(int base); |
91 | #endif | 89 | #endif |
92 | 90 | ||
diff --git a/include/asm-mips/device.h b/include/asm-mips/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-mips/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h index 5f7dcf5452e7..d107832de1b6 100644 --- a/include/asm-mips/div64.h +++ b/include/asm-mips/div64.h | |||
@@ -83,27 +83,6 @@ | |||
83 | #if (_MIPS_SZLONG == 64) | 83 | #if (_MIPS_SZLONG == 64) |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Don't use this one in new code | ||
87 | */ | ||
88 | #define do_div64_32(res, high, low, base) ({ \ | ||
89 | unsigned int __quot, __mod; \ | ||
90 | unsigned long __div; \ | ||
91 | unsigned int __low, __high, __base; \ | ||
92 | \ | ||
93 | __high = (high); \ | ||
94 | __low = (low); \ | ||
95 | __div = __high; \ | ||
96 | __div = __div << 32 | __low; \ | ||
97 | __base = (base); \ | ||
98 | \ | ||
99 | __mod = __div % __base; \ | ||
100 | __div = __div / __base; \ | ||
101 | \ | ||
102 | __quot = __div; \ | ||
103 | (res) = __quot; \ | ||
104 | __mod; }) | ||
105 | |||
106 | /* | ||
107 | * Hey, we're already 64-bit, no | 86 | * Hey, we're already 64-bit, no |
108 | * need to play games.. | 87 | * need to play games.. |
109 | */ | 88 | */ |
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h index e85849ac165f..23f789c80845 100644 --- a/include/asm-mips/dma.h +++ b/include/asm-mips/dma.h | |||
@@ -74,7 +74,9 @@ | |||
74 | * | 74 | * |
75 | */ | 75 | */ |
76 | 76 | ||
77 | #ifndef GENERIC_ISA_DMA_SUPPORT_BROKEN | ||
77 | #define MAX_DMA_CHANNELS 8 | 78 | #define MAX_DMA_CHANNELS 8 |
79 | #endif | ||
78 | 80 | ||
79 | /* | 81 | /* |
80 | * The maximum address in KSEG0 that we can perform a DMA transfer to on this | 82 | * The maximum address in KSEG0 that we can perform a DMA transfer to on this |
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h index 6959bdb59310..02c8a13fc894 100644 --- a/include/asm-mips/fixmap.h +++ b/include/asm-mips/fixmap.h | |||
@@ -45,8 +45,16 @@ | |||
45 | * fix-mapped? | 45 | * fix-mapped? |
46 | */ | 46 | */ |
47 | enum fixed_addresses { | 47 | enum fixed_addresses { |
48 | #define FIX_N_COLOURS 8 | ||
49 | FIX_CMAP_BEGIN, | ||
50 | #ifdef CONFIG_MIPS_MT_SMTC | ||
51 | FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS), | ||
52 | #else | ||
53 | FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS, | ||
54 | #endif | ||
48 | #ifdef CONFIG_HIGHMEM | 55 | #ifdef CONFIG_HIGHMEM |
49 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ | 56 | /* reserved pte's for temporary kernel mappings */ |
57 | FIX_KMAP_BEGIN = FIX_CMAP_END + 1, | ||
50 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | 58 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, |
51 | #endif | 59 | #endif |
52 | __end_of_fixed_addresses | 60 | __end_of_fixed_addresses |
@@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx, | |||
70 | * at the top of mem.. | 78 | * at the top of mem.. |
71 | */ | 79 | */ |
72 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) | 80 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) |
73 | #define FIXADDR_TOP (0xff000000UL - 0x2000) | 81 | #define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000)) |
74 | #else | 82 | #else |
75 | #define FIXADDR_TOP (0xffffe000UL) | 83 | #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) |
76 | #endif | 84 | #endif |
77 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | 85 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
78 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | 86 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
diff --git a/include/asm-mips/gt64120.h b/include/asm-mips/gt64120.h index 2edd171bb6cd..4bf8e28f8850 100644 --- a/include/asm-mips/gt64120.h +++ b/include/asm-mips/gt64120.h | |||
@@ -451,6 +451,13 @@ | |||
451 | #define GT_SDRAM_OPMODE_OP_MODE 3 | 451 | #define GT_SDRAM_OPMODE_OP_MODE 3 |
452 | #define GT_SDRAM_OPMODE_OP_CBR 4 | 452 | #define GT_SDRAM_OPMODE_OP_CBR 4 |
453 | 453 | ||
454 | #define GT_TC_CONTROL_ENTC0_SHF 0 | ||
455 | #define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF) | ||
456 | #define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK | ||
457 | #define GT_TC_CONTROL_SELTC0_SHF 1 | ||
458 | #define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF) | ||
459 | #define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK | ||
460 | |||
454 | 461 | ||
455 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0 | 462 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0 |
456 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF) | 463 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF) |
@@ -523,6 +530,13 @@ | |||
523 | #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF) | 530 | #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF) |
524 | #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK | 531 | #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK |
525 | 532 | ||
533 | #define GT_INTR_T0EXP_SHF 8 | ||
534 | #define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF) | ||
535 | #define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK | ||
536 | #define GT_INTR_RETRYCTR0_SHF 20 | ||
537 | #define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF) | ||
538 | #define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK | ||
539 | |||
526 | /* | 540 | /* |
527 | * Misc | 541 | * Misc |
528 | */ | 542 | */ |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index c2d124badbe5..d77b657c09c7 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -113,7 +113,7 @@ static inline void set_io_port_base(unsigned long base) | |||
113 | * almost all conceivable cases a device driver should not be using | 113 | * almost all conceivable cases a device driver should not be using |
114 | * this function | 114 | * this function |
115 | */ | 115 | */ |
116 | static inline unsigned long virt_to_phys(volatile void * address) | 116 | static inline unsigned long virt_to_phys(volatile const void *address) |
117 | { | 117 | { |
118 | return (unsigned long)address - PAGE_OFFSET; | 118 | return (unsigned long)address - PAGE_OFFSET; |
119 | } | 119 | } |
@@ -172,7 +172,7 @@ extern unsigned long isa_slot_offset; | |||
172 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) | 172 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) |
173 | 173 | ||
174 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); | 174 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); |
175 | extern void __iounmap(volatile void __iomem *addr); | 175 | extern void __iounmap(const volatile void __iomem *addr); |
176 | 176 | ||
177 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | 177 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, |
178 | unsigned long flags) | 178 | unsigned long flags) |
@@ -279,7 +279,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | |||
279 | #define ioremap_uncached_accelerated(offset, size) \ | 279 | #define ioremap_uncached_accelerated(offset, size) \ |
280 | __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED) | 280 | __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED) |
281 | 281 | ||
282 | static inline void iounmap(volatile void __iomem *addr) | 282 | static inline void iounmap(const volatile void __iomem *addr) |
283 | { | 283 | { |
284 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) | 284 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
285 | 285 | ||
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 0ce2a80b689e..67657089efa7 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
@@ -24,8 +24,6 @@ static inline int irq_canonicalize(int irq) | |||
24 | #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ | 24 | #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | extern asmlinkage unsigned int do_IRQ(unsigned int irq); | ||
28 | |||
29 | #ifdef CONFIG_MIPS_MT_SMTC | 27 | #ifdef CONFIG_MIPS_MT_SMTC |
30 | /* | 28 | /* |
31 | * Clear interrupt mask handling "backstop" if irq_hwmask | 29 | * Clear interrupt mask handling "backstop" if irq_hwmask |
@@ -43,8 +41,6 @@ do { \ | |||
43 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) | 41 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) |
44 | #endif | 42 | #endif |
45 | 43 | ||
46 | #ifdef CONFIG_PREEMPT | ||
47 | |||
48 | /* | 44 | /* |
49 | * do_IRQ handles all normal device IRQ's (the special | 45 | * do_IRQ handles all normal device IRQ's (the special |
50 | * SMP cross-CPU interrupts have their own specific | 46 | * SMP cross-CPU interrupts have their own specific |
@@ -57,12 +53,10 @@ do { \ | |||
57 | do { \ | 53 | do { \ |
58 | irq_enter(); \ | 54 | irq_enter(); \ |
59 | __DO_IRQ_SMTC_HOOK(); \ | 55 | __DO_IRQ_SMTC_HOOK(); \ |
60 | __do_IRQ((irq)); \ | 56 | generic_handle_irq(irq); \ |
61 | irq_exit(); \ | 57 | irq_exit(); \ |
62 | } while (0) | 58 | } while (0) |
63 | 59 | ||
64 | #endif | ||
65 | |||
66 | extern void arch_init_irq(void); | 60 | extern void arch_init_irq(void); |
67 | extern void spurious_interrupt(void); | 61 | extern void spurious_interrupt(void); |
68 | 62 | ||
@@ -74,4 +68,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, | |||
74 | unsigned long hwmask); | 68 | unsigned long hwmask); |
75 | #endif /* CONFIG_MIPS_MT_SMTC */ | 69 | #endif /* CONFIG_MIPS_MT_SMTC */ |
76 | 70 | ||
71 | extern int allocate_irqno(void); | ||
72 | extern void alloc_legacy_irqno(void); | ||
73 | extern void free_irqno(unsigned int irq); | ||
74 | |||
77 | #endif /* _ASM_IRQ_H */ | 75 | #endif /* _ASM_IRQ_H */ |
diff --git a/include/asm-mips/kexec.h b/include/asm-mips/kexec.h new file mode 100644 index 000000000000..b25267ebcb09 --- /dev/null +++ b/include/asm-mips/kexec.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * kexec.h for kexec | ||
3 | * Created by <nschichan@corp.free.fr> on Thu Oct 12 14:59:34 2006 | ||
4 | * | ||
5 | * This source code is licensed under the GNU General Public License, | ||
6 | * Version 2. See the file COPYING for more details. | ||
7 | */ | ||
8 | |||
9 | #ifndef _MIPS_KEXEC | ||
10 | # define _MIPS_KEXEC | ||
11 | |||
12 | /* Maximum physical address we can use pages from */ | ||
13 | #define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000) | ||
14 | /* Maximum address we can reach in physical address mode */ | ||
15 | #define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000) | ||
16 | /* Maximum address we can use for the control code buffer */ | ||
17 | #define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000) | ||
18 | |||
19 | #define KEXEC_CONTROL_CODE_SIZE 4096 | ||
20 | |||
21 | /* The native architecture */ | ||
22 | #define KEXEC_ARCH KEXEC_ARCH_MIPS | ||
23 | |||
24 | #define MAX_NOTE_BYTES 1024 | ||
25 | |||
26 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
27 | struct pt_regs *oldregs) | ||
28 | { | ||
29 | /* Dummy implementation for now */ | ||
30 | } | ||
31 | |||
32 | #endif /* !_MIPS_KEXEC */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h index 301e71300779..e9fa252f8a3f 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -170,10 +170,8 @@ int __init auide_probe(void); | |||
170 | static int auide_dma_host_on(ide_drive_t *drive); | 170 | static int auide_dma_host_on(ide_drive_t *drive); |
171 | static int auide_dma_lostirq(ide_drive_t *drive); | 171 | static int auide_dma_lostirq(ide_drive_t *drive); |
172 | static int auide_dma_on(ide_drive_t *drive); | 172 | static int auide_dma_on(ide_drive_t *drive); |
173 | static void auide_ddma_tx_callback(int irq, void *param, | 173 | static void auide_ddma_tx_callback(int irq, void *param); |
174 | struct pt_regs *regs); | 174 | static void auide_ddma_rx_callback(int irq, void *param); |
175 | static void auide_ddma_rx_callback(int irq, void *param, | ||
176 | struct pt_regs *regs); | ||
177 | static int auide_dma_off_quietly(ide_drive_t *drive); | 175 | static int auide_dma_off_quietly(ide_drive_t *drive); |
178 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ | 176 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ |
179 | 177 | ||
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h index b3c5ecbec03c..00b0fc68d5cb 100644 --- a/include/asm-mips/mach-cobalt/cobalt.h +++ b/include/asm-mips/mach-cobalt/cobalt.h | |||
@@ -67,34 +67,9 @@ | |||
67 | #define COBALT_BRD_ID_QUBE2 0x5 | 67 | #define COBALT_BRD_ID_QUBE2 0x5 |
68 | #define COBALT_BRD_ID_RAQ2 0x6 | 68 | #define COBALT_BRD_ID_RAQ2 0x6 |
69 | 69 | ||
70 | /* | ||
71 | * Galileo chipset access macros for the Cobalt. The base address for | ||
72 | * the GT64111 chip is 0x14000000 | ||
73 | * | ||
74 | * Most of this really should go into a separate GT64111 header file. | ||
75 | */ | ||
76 | #define GT64111_IO_BASE 0x10000000UL | ||
77 | #define GT64111_IO_END 0x11ffffffUL | ||
78 | #define GT64111_MEM_BASE 0x12000000UL | ||
79 | #define GT64111_MEM_END 0x13ffffffUL | ||
80 | #define GT64111_BASE 0x14000000UL | ||
81 | #define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs)) | ||
82 | |||
83 | #define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) | ||
84 | #define GALILEO_OUTL(val, port) \ | ||
85 | do { \ | ||
86 | *(volatile unsigned int *) GALILEO_REG(port) = (val); \ | ||
87 | } while (0) | ||
88 | |||
89 | #define GALILEO_INTR_T0EXP (1 << 8) | ||
90 | #define GALILEO_INTR_RETRY_CTR (1 << 20) | ||
91 | |||
92 | #define GALILEO_ENTC0 0x01 | ||
93 | #define GALILEO_SELTC0 0x02 | ||
94 | |||
95 | #define PCI_CFG_SET(devfn,where) \ | 70 | #define PCI_CFG_SET(devfn,where) \ |
96 | GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ | 71 | GT_WRITE(GT_PCI0_CFGADDR_OFS, (0x80000000 | (PCI_SLOT (devfn) << 11) | \ |
97 | (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) | 72 | (PCI_FUNC (devfn) << 8) | (where))) |
98 | 73 | ||
99 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) | 74 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) |
100 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ | 75 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ |
diff --git a/include/asm-mips/mach-cobalt/mach-gt64120.h b/include/asm-mips/mach-cobalt/mach-gt64120.h index 587fc4378f44..ae9c5523c7ef 100644 --- a/include/asm-mips/mach-cobalt/mach-gt64120.h +++ b/include/asm-mips/mach-cobalt/mach-gt64120.h | |||
@@ -1 +1,27 @@ | |||
1 | /* there's something here ... in the dark */ | 1 | /* |
2 | * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef _COBALT_MACH_GT64120_H | ||
19 | #define _COBALT_MACH_GT64120_H | ||
20 | |||
21 | /* | ||
22 | * Cobalt uses GT64111. GT64111 is almost the same as GT64120. | ||
23 | */ | ||
24 | |||
25 | #define GT64120_BASE CKSEG1ADDR(GT_DEF_BASE) | ||
26 | |||
27 | #endif /* _COBALT_MACH_GT64120_H */ | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h index f637ce70758f..3e9468f424f4 100644 --- a/include/asm-mips/mipsmtregs.h +++ b/include/asm-mips/mipsmtregs.h | |||
@@ -352,6 +352,8 @@ do { \ | |||
352 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) | 352 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) |
353 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) | 353 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) |
354 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) | 354 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) |
355 | #define read_vpe_c0_count() mftc0(9, 0) | ||
356 | #define write_vpe_c0_count(val) mttc0(9, 0, val) | ||
355 | #define read_vpe_c0_status() mftc0(12, 0) | 357 | #define read_vpe_c0_status() mftc0(12, 0) |
356 | #define write_vpe_c0_status(val) mttc0(12, 0, val) | 358 | #define write_vpe_c0_status(val) mttc0(12, 0, val) |
357 | #define read_vpe_c0_cause() mftc0(13, 0) | 359 | #define read_vpe_c0_cause() mftc0(13, 0) |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 1f318d707998..9985cb7c16e7 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -545,62 +545,6 @@ | |||
545 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) | 545 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) |
546 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) | 546 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) |
547 | 547 | ||
548 | /* | ||
549 | * R10000 performance counter definitions. | ||
550 | * | ||
551 | * FIXME: The R10000 performance counter opens a nice way to implement CPU | ||
552 | * time accounting with a precission of one cycle. I don't have | ||
553 | * R10000 silicon but just a manual, so ... | ||
554 | */ | ||
555 | |||
556 | /* | ||
557 | * Events counted by counter #0 | ||
558 | */ | ||
559 | #define CE0_CYCLES 0 | ||
560 | #define CE0_INSN_ISSUED 1 | ||
561 | #define CE0_LPSC_ISSUED 2 | ||
562 | #define CE0_S_ISSUED 3 | ||
563 | #define CE0_SC_ISSUED 4 | ||
564 | #define CE0_SC_FAILED 5 | ||
565 | #define CE0_BRANCH_DECODED 6 | ||
566 | #define CE0_QW_WB_SECONDARY 7 | ||
567 | #define CE0_CORRECTED_ECC_ERRORS 8 | ||
568 | #define CE0_ICACHE_MISSES 9 | ||
569 | #define CE0_SCACHE_I_MISSES 10 | ||
570 | #define CE0_SCACHE_I_WAY_MISSPREDICTED 11 | ||
571 | #define CE0_EXT_INTERVENTIONS_REQ 12 | ||
572 | #define CE0_EXT_INVALIDATE_REQ 13 | ||
573 | #define CE0_VIRTUAL_COHERENCY_COND 14 | ||
574 | #define CE0_INSN_GRADUATED 15 | ||
575 | |||
576 | /* | ||
577 | * Events counted by counter #1 | ||
578 | */ | ||
579 | #define CE1_CYCLES 0 | ||
580 | #define CE1_INSN_GRADUATED 1 | ||
581 | #define CE1_LPSC_GRADUATED 2 | ||
582 | #define CE1_S_GRADUATED 3 | ||
583 | #define CE1_SC_GRADUATED 4 | ||
584 | #define CE1_FP_INSN_GRADUATED 5 | ||
585 | #define CE1_QW_WB_PRIMARY 6 | ||
586 | #define CE1_TLB_REFILL 7 | ||
587 | #define CE1_BRANCH_MISSPREDICTED 8 | ||
588 | #define CE1_DCACHE_MISS 9 | ||
589 | #define CE1_SCACHE_D_MISSES 10 | ||
590 | #define CE1_SCACHE_D_WAY_MISSPREDICTED 11 | ||
591 | #define CE1_EXT_INTERVENTION_HITS 12 | ||
592 | #define CE1_EXT_INVALIDATE_REQ 13 | ||
593 | #define CE1_SP_HINT_TO_CEXCL_SC_BLOCKS 14 | ||
594 | #define CE1_SP_HINT_TO_SHARED_SC_BLOCKS 15 | ||
595 | |||
596 | /* | ||
597 | * These flags define in which privilege mode the counters count events | ||
598 | */ | ||
599 | #define CEB_USER 8 /* Count events in user mode, EXL = ERL = 0 */ | ||
600 | #define CEB_SUPERVISOR 4 /* Count events in supvervisor mode EXL = ERL = 0 */ | ||
601 | #define CEB_KERNEL 2 /* Count events in kernel mode EXL = ERL = 0 */ | ||
602 | #define CEB_EXL 1 /* Count events with EXL = 1, ERL = 0 */ | ||
603 | |||
604 | #ifndef __ASSEMBLY__ | 548 | #ifndef __ASSEMBLY__ |
605 | 549 | ||
606 | /* | 550 | /* |
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 85b258ee7090..0dc1a45c27ed 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,7 +34,9 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | #include <linux/pfn.h> | ||
37 | #include <asm/cpu-features.h> | 38 | #include <asm/cpu-features.h> |
39 | #include <asm/io.h> | ||
38 | 40 | ||
39 | extern void clear_page(void * page); | 41 | extern void clear_page(void * page); |
40 | extern void copy_page(void * to, void * from); | 42 | extern void copy_page(void * to, void * from); |
@@ -134,8 +136,14 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
134 | /* to align the pointer to the (next) page boundary */ | 136 | /* to align the pointer to the (next) page boundary */ |
135 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | 137 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) |
136 | 138 | ||
137 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 139 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
138 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 140 | #define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) |
141 | #else | ||
142 | #define __pa_page_offset(x) PAGE_OFFSET | ||
143 | #endif | ||
144 | #define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) | ||
145 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) | ||
146 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) | ||
139 | 147 | ||
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 148 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | 149 | ||
@@ -160,8 +168,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
160 | 168 | ||
161 | #endif | 169 | #endif |
162 | 170 | ||
163 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 171 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) |
164 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 172 | #define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) |
165 | 173 | ||
166 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 174 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
167 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 175 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index 582c1fe6cc4a..af121c67dc71 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
48 | 48 | ||
49 | ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); | 49 | ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); |
50 | if (ret) { | 50 | if (ret) { |
51 | init = pgd_offset(&init_mm, 0); | 51 | init = pgd_offset(&init_mm, 0UL); |
52 | pgd_init((unsigned long)ret); | 52 | pgd_init((unsigned long)ret); |
53 | memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, | 53 | memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, |
54 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); | 54 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index d05fb6f38aa7..b9b1e86493ee 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/addrspace.h> | 14 | #include <asm/addrspace.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | #include <asm/cachectl.h> | 16 | #include <asm/cachectl.h> |
17 | #include <asm/fixmap.h> | ||
17 | 18 | ||
18 | #include <asm-generic/pgtable-nopud.h> | 19 | #include <asm-generic/pgtable-nopud.h> |
19 | 20 | ||
@@ -103,6 +104,13 @@ | |||
103 | #define VMALLOC_START MAP_BASE | 104 | #define VMALLOC_START MAP_BASE |
104 | #define VMALLOC_END \ | 105 | #define VMALLOC_END \ |
105 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
107 | #if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64) && \ | ||
108 | VMALLOC_START != CKSSEG | ||
109 | /* Load modules into 32bit-compatible segment. */ | ||
110 | #define MODULE_START CKSSEG | ||
111 | #define MODULE_END (FIXADDR_START-2*PAGE_SIZE) | ||
112 | extern pgd_t module_pg_dir[PTRS_PER_PGD]; | ||
113 | #endif | ||
106 | 114 | ||
107 | #define pte_ERROR(e) \ | 115 | #define pte_ERROR(e) \ |
108 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) | 116 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) |
@@ -174,7 +182,12 @@ static inline void pud_clear(pud_t *pudp) | |||
174 | #define __pmd_offset(address) pmd_index(address) | 182 | #define __pmd_offset(address) pmd_index(address) |
175 | 183 | ||
176 | /* to find an entry in a kernel page-table-directory */ | 184 | /* to find an entry in a kernel page-table-directory */ |
177 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) | 185 | #ifdef MODULE_START |
186 | #define pgd_offset_k(address) \ | ||
187 | ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL)) | ||
188 | #else | ||
189 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0UL) | ||
190 | #endif | ||
178 | 191 | ||
179 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 192 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
180 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 193 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 1ca4d1e185c7..f2e1325fec6c 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -67,7 +67,7 @@ extern unsigned long empty_zero_page; | |||
67 | extern unsigned long zero_page_mask; | 67 | extern unsigned long zero_page_mask; |
68 | 68 | ||
69 | #define ZERO_PAGE(vaddr) \ | 69 | #define ZERO_PAGE(vaddr) \ |
70 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) | 70 | (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) |
71 | 71 | ||
72 | #define __HAVE_ARCH_MOVE_PTE | 72 | #define __HAVE_ARCH_MOVE_PTE |
73 | #define move_pte(pte, prot, old_addr, new_addr) \ | 73 | #define move_pte(pte, prot, old_addr, new_addr) \ |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 5f3a9075cd28..30bf555faeaa 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -80,8 +80,6 @@ struct pt_regs { | |||
80 | #define instruction_pointer(regs) ((regs)->cp0_epc) | 80 | #define instruction_pointer(regs) ((regs)->cp0_epc) |
81 | #define profile_pc(regs) instruction_pointer(regs) | 81 | #define profile_pc(regs) instruction_pointer(regs) |
82 | 82 | ||
83 | extern void show_regs(struct pt_regs *); | ||
84 | |||
85 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | 83 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); |
86 | 84 | ||
87 | #endif | 85 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h index b09e16c93ca0..2ba6988ddc8e 100644 --- a/include/asm-mips/sibyte/sb1250.h +++ b/include/asm-mips/sibyte/sb1250.h | |||
@@ -51,8 +51,8 @@ extern void sb1250_mask_irq(int cpu, int irq); | |||
51 | extern void sb1250_unmask_irq(int cpu, int irq); | 51 | extern void sb1250_unmask_irq(int cpu, int irq); |
52 | extern void sb1250_smp_finish(void); | 52 | extern void sb1250_smp_finish(void); |
53 | 53 | ||
54 | extern void bcm1480_hpt_setup(void); | ||
54 | extern void bcm1480_time_init(void); | 55 | extern void bcm1480_time_init(void); |
55 | extern unsigned long bcm1480_gettimeoffset(void); | ||
56 | extern void bcm1480_mask_irq(int cpu, int irq); | 56 | extern void bcm1480_mask_irq(int cpu, int irq); |
57 | extern void bcm1480_unmask_irq(int cpu, int irq); | 57 | extern void bcm1480_unmask_irq(int cpu, int irq); |
58 | extern void bcm1480_smp_finish(void); | 58 | extern void bcm1480_smp_finish(void); |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index dcb4701d5728..3056feed5a36 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -392,7 +392,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, | |||
392 | { | 392 | { |
393 | __u64 retval; | 393 | __u64 retval; |
394 | 394 | ||
395 | if (cpu_has_llsc) { | 395 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
396 | __asm__ __volatile__( | 396 | __asm__ __volatile__( |
397 | " .set push \n" | 397 | " .set push \n" |
398 | " .set noat \n" | 398 | " .set noat \n" |
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 28512ba2266e..a632cef830a2 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/clocksource.h> | ||
24 | 25 | ||
25 | extern spinlock_t rtc_lock; | 26 | extern spinlock_t rtc_lock; |
26 | 27 | ||
@@ -44,11 +45,10 @@ extern int (*mips_timer_state)(void); | |||
44 | extern void (*mips_timer_ack)(void); | 45 | extern void (*mips_timer_ack)(void); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * High precision timer functions. | 48 | * High precision timer clocksource. |
48 | * If mips_hpt_read is NULL, an R4k-compatible timer setup is attempted. | 49 | * If .read is NULL, an R4k-compatible timer setup is attempted. |
49 | */ | 50 | */ |
50 | extern unsigned int (*mips_hpt_read)(void); | 51 | extern struct clocksource clocksource_mips; |
51 | extern void (*mips_hpt_init)(unsigned int); | ||
52 | 52 | ||
53 | /* | 53 | /* |
54 | * to_tm() converts system time back to (year, mon, day, hour, min, sec). | 54 | * to_tm() converts system time back to (year, mon, day, hour, min, sec). |
@@ -58,13 +58,6 @@ extern void (*mips_hpt_init)(unsigned int); | |||
58 | extern void to_tm(unsigned long tim, struct rtc_time *tm); | 58 | extern void to_tm(unsigned long tim, struct rtc_time *tm); |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * do_gettimeoffset(). By default, this func pointer points to | ||
62 | * do_null_gettimeoffset(), which leads to the same resolution as HZ. | ||
63 | * Higher resolution versions are available, which give ~1us resolution. | ||
64 | */ | ||
65 | extern unsigned long (*do_gettimeoffset)(void); | ||
66 | |||
67 | /* | ||
68 | * high-level timer interrupt routines. | 61 | * high-level timer interrupt routines. |
69 | */ | 62 | */ |
70 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); | 63 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); |
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 685c91467e63..ec56aa52f669 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -331,16 +331,19 @@ | |||
331 | #define __NR_move_pages (__NR_Linux + 308) | 331 | #define __NR_move_pages (__NR_Linux + 308) |
332 | #define __NR_set_robust_list (__NR_Linux + 309) | 332 | #define __NR_set_robust_list (__NR_Linux + 309) |
333 | #define __NR_get_robust_list (__NR_Linux + 310) | 333 | #define __NR_get_robust_list (__NR_Linux + 310) |
334 | #define __NR_kexec_load (__NR_Linux + 311) | ||
335 | #define __NR_getcpu (__NR_Linux + 312) | ||
336 | #define __NR_epoll_pwait (__NR_Linux + 313) | ||
334 | 337 | ||
335 | /* | 338 | /* |
336 | * Offset of the last Linux o32 flavoured syscall | 339 | * Offset of the last Linux o32 flavoured syscall |
337 | */ | 340 | */ |
338 | #define __NR_Linux_syscalls 310 | 341 | #define __NR_Linux_syscalls 313 |
339 | 342 | ||
340 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 343 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
341 | 344 | ||
342 | #define __NR_O32_Linux 4000 | 345 | #define __NR_O32_Linux 4000 |
343 | #define __NR_O32_Linux_syscalls 310 | 346 | #define __NR_O32_Linux_syscalls 313 |
344 | 347 | ||
345 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 348 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
346 | 349 | ||
@@ -618,16 +621,19 @@ | |||
618 | #define __NR_move_pages (__NR_Linux + 267) | 621 | #define __NR_move_pages (__NR_Linux + 267) |
619 | #define __NR_set_robust_list (__NR_Linux + 268) | 622 | #define __NR_set_robust_list (__NR_Linux + 268) |
620 | #define __NR_get_robust_list (__NR_Linux + 269) | 623 | #define __NR_get_robust_list (__NR_Linux + 269) |
624 | #define __NR_kexec_load (__NR_Linux + 270) | ||
625 | #define __NR_getcpu (__NR_Linux + 271) | ||
626 | #define __NR_epoll_pwait (__NR_Linux + 272) | ||
621 | 627 | ||
622 | /* | 628 | /* |
623 | * Offset of the last Linux 64-bit flavoured syscall | 629 | * Offset of the last Linux 64-bit flavoured syscall |
624 | */ | 630 | */ |
625 | #define __NR_Linux_syscalls 269 | 631 | #define __NR_Linux_syscalls 272 |
626 | 632 | ||
627 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 633 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
628 | 634 | ||
629 | #define __NR_64_Linux 5000 | 635 | #define __NR_64_Linux 5000 |
630 | #define __NR_64_Linux_syscalls 269 | 636 | #define __NR_64_Linux_syscalls 272 |
631 | 637 | ||
632 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 638 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
633 | 639 | ||
@@ -909,16 +915,19 @@ | |||
909 | #define __NR_move_pages (__NR_Linux + 271) | 915 | #define __NR_move_pages (__NR_Linux + 271) |
910 | #define __NR_set_robust_list (__NR_Linux + 272) | 916 | #define __NR_set_robust_list (__NR_Linux + 272) |
911 | #define __NR_get_robust_list (__NR_Linux + 273) | 917 | #define __NR_get_robust_list (__NR_Linux + 273) |
918 | #define __NR_kexec_load (__NR_Linux + 274) | ||
919 | #define __NR_getcpu (__NR_Linux + 275) | ||
920 | #define __NR_epoll_pwait (__NR_Linux + 276) | ||
912 | 921 | ||
913 | /* | 922 | /* |
914 | * Offset of the last N32 flavoured syscall | 923 | * Offset of the last N32 flavoured syscall |
915 | */ | 924 | */ |
916 | #define __NR_Linux_syscalls 273 | 925 | #define __NR_Linux_syscalls 276 |
917 | 926 | ||
918 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 927 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
919 | 928 | ||
920 | #define __NR_N32_Linux 6000 | 929 | #define __NR_N32_Linux 6000 |
921 | #define __NR_N32_Linux_syscalls 273 | 930 | #define __NR_N32_Linux_syscalls 276 |
922 | 931 | ||
923 | #ifdef __KERNEL__ | 932 | #ifdef __KERNEL__ |
924 | 933 | ||
@@ -1186,6 +1195,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ | |||
1186 | #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ | 1195 | #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ |
1187 | 1196 | ||
1188 | 1197 | ||
1198 | #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 | ||
1189 | #define __ARCH_WANT_IPC_PARSE_VERSION | 1199 | #define __ARCH_WANT_IPC_PARSE_VERSION |
1190 | #define __ARCH_WANT_OLD_READDIR | 1200 | #define __ARCH_WANT_OLD_READDIR |
1191 | #define __ARCH_WANT_SYS_ALARM | 1201 | #define __ARCH_WANT_SYS_ALARM |
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index dd3eb3dc5886..88b492f6ea9c 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h | |||
@@ -75,7 +75,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); | |||
75 | * Interrupt Control Unit | 75 | * Interrupt Control Unit |
76 | */ | 76 | */ |
77 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); | 77 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); |
78 | extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); | 78 | extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)); |
79 | 79 | ||
80 | #define PIUINT_COMMAND 0x0040 | 80 | #define PIUINT_COMMAND 0x0040 |
81 | #define PIUINT_DATA 0x0020 | 81 | #define PIUINT_DATA 0x0020 |