aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips')
-rw-r--r--include/asm-mips/atomic.h40
-rw-r--r--include/asm-mips/bitops.h24
-rw-r--r--include/asm-mips/bug.h3
-rw-r--r--include/asm-mips/cacheflush.h12
-rw-r--r--include/asm-mips/checksum.h2
-rw-r--r--include/asm-mips/cpu-features.h3
-rw-r--r--include/asm-mips/cpu-info.h1
-rw-r--r--include/asm-mips/delay.h2
-rw-r--r--include/asm-mips/fpu.h43
-rw-r--r--include/asm-mips/hazards.h1
-rw-r--r--include/asm-mips/irqflags.h55
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h34
-rw-r--r--include/asm-mips/mach-ip27/dma-coherence.h5
-rw-r--r--include/asm-mips/mach-ip32/dma-coherence.h5
-rw-r--r--include/asm-mips/marvell.h1
-rw-r--r--include/asm-mips/pgtable-64.h2
-rw-r--r--include/asm-mips/pgtable.h2
-rw-r--r--include/asm-mips/rtlx.h4
-rw-r--r--include/asm-mips/sgiarcs.h2
-rw-r--r--include/asm-mips/sibyte/sb1250.h2
-rw-r--r--include/asm-mips/sibyte/sb1250_scd.h1
-rw-r--r--include/asm-mips/smtc_ipi.h16
-rw-r--r--include/asm-mips/system.h16
23 files changed, 143 insertions, 133 deletions
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 8578869a8bcf..1ac50b6c47ad 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -79,9 +79,9 @@ static __inline__ void atomic_add(int i, atomic_t * v)
79 } else { 79 } else {
80 unsigned long flags; 80 unsigned long flags;
81 81
82 local_irq_save(flags); 82 raw_local_irq_save(flags);
83 v->counter += i; 83 v->counter += i;
84 local_irq_restore(flags); 84 raw_local_irq_restore(flags);
85 } 85 }
86} 86}
87 87
@@ -124,9 +124,9 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
124 } else { 124 } else {
125 unsigned long flags; 125 unsigned long flags;
126 126
127 local_irq_save(flags); 127 raw_local_irq_save(flags);
128 v->counter -= i; 128 v->counter -= i;
129 local_irq_restore(flags); 129 raw_local_irq_restore(flags);
130 } 130 }
131} 131}
132 132
@@ -173,11 +173,11 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
173 } else { 173 } else {
174 unsigned long flags; 174 unsigned long flags;
175 175
176 local_irq_save(flags); 176 raw_local_irq_save(flags);
177 result = v->counter; 177 result = v->counter;
178 result += i; 178 result += i;
179 v->counter = result; 179 v->counter = result;
180 local_irq_restore(flags); 180 raw_local_irq_restore(flags);
181 } 181 }
182 182
183 smp_mb(); 183 smp_mb();
@@ -225,11 +225,11 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
225 } else { 225 } else {
226 unsigned long flags; 226 unsigned long flags;
227 227
228 local_irq_save(flags); 228 raw_local_irq_save(flags);
229 result = v->counter; 229 result = v->counter;
230 result -= i; 230 result -= i;
231 v->counter = result; 231 v->counter = result;
232 local_irq_restore(flags); 232 raw_local_irq_restore(flags);
233 } 233 }
234 234
235 smp_mb(); 235 smp_mb();
@@ -293,12 +293,12 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
293 } else { 293 } else {
294 unsigned long flags; 294 unsigned long flags;
295 295
296 local_irq_save(flags); 296 raw_local_irq_save(flags);
297 result = v->counter; 297 result = v->counter;
298 result -= i; 298 result -= i;
299 if (result >= 0) 299 if (result >= 0)
300 v->counter = result; 300 v->counter = result;
301 local_irq_restore(flags); 301 raw_local_irq_restore(flags);
302 } 302 }
303 303
304 smp_mb(); 304 smp_mb();
@@ -454,9 +454,9 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
454 } else { 454 } else {
455 unsigned long flags; 455 unsigned long flags;
456 456
457 local_irq_save(flags); 457 raw_local_irq_save(flags);
458 v->counter += i; 458 v->counter += i;
459 local_irq_restore(flags); 459 raw_local_irq_restore(flags);
460 } 460 }
461} 461}
462 462
@@ -499,9 +499,9 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
499 } else { 499 } else {
500 unsigned long flags; 500 unsigned long flags;
501 501
502 local_irq_save(flags); 502 raw_local_irq_save(flags);
503 v->counter -= i; 503 v->counter -= i;
504 local_irq_restore(flags); 504 raw_local_irq_restore(flags);
505 } 505 }
506} 506}
507 507
@@ -548,11 +548,11 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
548 } else { 548 } else {
549 unsigned long flags; 549 unsigned long flags;
550 550
551 local_irq_save(flags); 551 raw_local_irq_save(flags);
552 result = v->counter; 552 result = v->counter;
553 result += i; 553 result += i;
554 v->counter = result; 554 v->counter = result;
555 local_irq_restore(flags); 555 raw_local_irq_restore(flags);
556 } 556 }
557 557
558 smp_mb(); 558 smp_mb();
@@ -600,11 +600,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
600 } else { 600 } else {
601 unsigned long flags; 601 unsigned long flags;
602 602
603 local_irq_save(flags); 603 raw_local_irq_save(flags);
604 result = v->counter; 604 result = v->counter;
605 result -= i; 605 result -= i;
606 v->counter = result; 606 v->counter = result;
607 local_irq_restore(flags); 607 raw_local_irq_restore(flags);
608 } 608 }
609 609
610 smp_mb(); 610 smp_mb();
@@ -668,12 +668,12 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
668 } else { 668 } else {
669 unsigned long flags; 669 unsigned long flags;
670 670
671 local_irq_save(flags); 671 raw_local_irq_save(flags);
672 result = v->counter; 672 result = v->counter;
673 result -= i; 673 result -= i;
674 if (result >= 0) 674 if (result >= 0)
675 v->counter = result; 675 v->counter = result;
676 local_irq_restore(flags); 676 raw_local_irq_restore(flags);
677 } 677 }
678 678
679 smp_mb(); 679 smp_mb();
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 8959da245cfb..d995413e11fd 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -100,9 +100,9 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
100 100
101 a += nr >> SZLONG_LOG; 101 a += nr >> SZLONG_LOG;
102 mask = 1UL << bit; 102 mask = 1UL << bit;
103 local_irq_save(flags); 103 raw_local_irq_save(flags);
104 *a |= mask; 104 *a |= mask;
105 local_irq_restore(flags); 105 raw_local_irq_restore(flags);
106 } 106 }
107} 107}
108 108
@@ -165,9 +165,9 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
165 165
166 a += nr >> SZLONG_LOG; 166 a += nr >> SZLONG_LOG;
167 mask = 1UL << bit; 167 mask = 1UL << bit;
168 local_irq_save(flags); 168 raw_local_irq_save(flags);
169 *a &= ~mask; 169 *a &= ~mask;
170 local_irq_restore(flags); 170 raw_local_irq_restore(flags);
171 } 171 }
172} 172}
173 173
@@ -220,9 +220,9 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
220 220
221 a += nr >> SZLONG_LOG; 221 a += nr >> SZLONG_LOG;
222 mask = 1UL << bit; 222 mask = 1UL << bit;
223 local_irq_save(flags); 223 raw_local_irq_save(flags);
224 *a ^= mask; 224 *a ^= mask;
225 local_irq_restore(flags); 225 raw_local_irq_restore(flags);
226 } 226 }
227} 227}
228 228
@@ -287,10 +287,10 @@ static inline int test_and_set_bit(unsigned long nr,
287 287
288 a += nr >> SZLONG_LOG; 288 a += nr >> SZLONG_LOG;
289 mask = 1UL << bit; 289 mask = 1UL << bit;
290 local_irq_save(flags); 290 raw_local_irq_save(flags);
291 retval = (mask & *a) != 0; 291 retval = (mask & *a) != 0;
292 *a |= mask; 292 *a |= mask;
293 local_irq_restore(flags); 293 raw_local_irq_restore(flags);
294 294
295 return retval; 295 return retval;
296 } 296 }
@@ -381,10 +381,10 @@ static inline int test_and_clear_bit(unsigned long nr,
381 381
382 a += nr >> SZLONG_LOG; 382 a += nr >> SZLONG_LOG;
383 mask = 1UL << bit; 383 mask = 1UL << bit;
384 local_irq_save(flags); 384 raw_local_irq_save(flags);
385 retval = (mask & *a) != 0; 385 retval = (mask & *a) != 0;
386 *a &= ~mask; 386 *a &= ~mask;
387 local_irq_restore(flags); 387 raw_local_irq_restore(flags);
388 388
389 return retval; 389 return retval;
390 } 390 }
@@ -452,10 +452,10 @@ static inline int test_and_change_bit(unsigned long nr,
452 452
453 a += nr >> SZLONG_LOG; 453 a += nr >> SZLONG_LOG;
454 mask = 1UL << bit; 454 mask = 1UL << bit;
455 local_irq_save(flags); 455 raw_local_irq_save(flags);
456 retval = (mask & *a) != 0; 456 retval = (mask & *a) != 0;
457 *a ^= mask; 457 *a ^= mask;
458 local_irq_restore(flags); 458 raw_local_irq_restore(flags);
459 459
460 return retval; 460 return retval;
461 } 461 }
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
index 4d560a533940..7eb63de808bc 100644
--- a/include/asm-mips/bug.h
+++ b/include/asm-mips/bug.h
@@ -18,7 +18,8 @@ do { \
18 18
19#define BUG_ON(condition) \ 19#define BUG_ON(condition) \
20do { \ 20do { \
21 __asm__ __volatile__("tne $0, %0" : : "r" (condition)); \ 21 __asm__ __volatile__("tne $0, %0, %1" \
22 : : "r" (condition), "i" (BRK_BUG)); \
22} while (0) 23} while (0)
23 24
24#define HAVE_ARCH_BUG_ON 25#define HAVE_ARCH_BUG_ON
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 0ddada3bb0b6..28d907d4347a 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -48,6 +48,15 @@ static inline void flush_dcache_page(struct page *page)
48#define flush_dcache_mmap_lock(mapping) do { } while (0) 48#define flush_dcache_mmap_lock(mapping) do { } while (0)
49#define flush_dcache_mmap_unlock(mapping) do { } while (0) 49#define flush_dcache_mmap_unlock(mapping) do { } while (0)
50 50
51#define ARCH_HAS_FLUSH_ANON_PAGE
52extern void __flush_anon_page(struct page *, unsigned long);
53static inline void flush_anon_page(struct vm_area_struct *vma,
54 struct page *page, unsigned long vmaddr)
55{
56 if (cpu_has_dc_aliases && PageAnon(page))
57 __flush_anon_page(page, vmaddr);
58}
59
51static inline void flush_icache_page(struct vm_area_struct *vma, 60static inline void flush_icache_page(struct vm_area_struct *vma,
52 struct page *page) 61 struct page *page)
53{ 62{
@@ -86,4 +95,7 @@ extern void (*flush_data_cache_page)(unsigned long addr);
86/* Run kernel code uncached, useful for cache probing functions. */ 95/* Run kernel code uncached, useful for cache probing functions. */
87unsigned long __init run_uncached(void *func); 96unsigned long __init run_uncached(void *func);
88 97
98extern void *kmap_coherent(struct page *page, unsigned long addr);
99extern void kunmap_coherent(struct page *page);
100
89#endif /* _ASM_CACHEFLUSH_H */ 101#endif /* _ASM_CACHEFLUSH_H */
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index 20a81e1548f5..290485ac5407 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -166,7 +166,7 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr,
166#else 166#else
167 "r" (proto + len), 167 "r" (proto + len),
168#endif 168#endif
169 "r" (sum)); 169 "r" ((__force unsigned long)sum));
170 170
171 return sum; 171 return sum;
172} 172}
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index eadca266f159..5e4bed123b48 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -40,6 +40,9 @@
40#endif 40#endif
41#ifndef cpu_has_fpu 41#ifndef cpu_has_fpu
42#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) 42#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU)
43#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU)
44#else
45#define raw_cpu_has_fpu cpu_has_fpu
43#endif 46#endif
44#ifndef cpu_has_32fpr 47#ifndef cpu_has_32fpr
45#define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) 48#define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR)
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 610d0cdeaa9e..22fe8453fcc7 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -87,6 +87,7 @@ struct cpuinfo_mips {
87 87
88extern struct cpuinfo_mips cpu_data[]; 88extern struct cpuinfo_mips cpu_data[];
89#define current_cpu_data cpu_data[smp_processor_id()] 89#define current_cpu_data cpu_data[smp_processor_id()]
90#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
90 91
91extern void cpu_probe(void); 92extern void cpu_probe(void);
92extern void cpu_report(void); 93extern void cpu_report(void);
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index ea77050f8e3a..223d156efb9f 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -79,7 +79,7 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
79 __delay(usecs); 79 __delay(usecs);
80} 80}
81 81
82#define __udelay_val cpu_data[smp_processor_id()].udelay_val 82#define __udelay_val cpu_data[raw_smp_processor_id()].udelay_val
83 83
84#define udelay(usecs) __udelay((usecs),__udelay_val) 84#define udelay(usecs) __udelay((usecs),__udelay_val)
85 85
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index efef843b93f0..b414a7d9db43 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -27,11 +27,11 @@
27struct sigcontext; 27struct sigcontext;
28struct sigcontext32; 28struct sigcontext32;
29 29
30extern asmlinkage int (*save_fp_context)(struct sigcontext *sc); 30extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);
31extern asmlinkage int (*restore_fp_context)(struct sigcontext *sc); 31extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);
32 32
33extern asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc); 33extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
34extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc); 34extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);
35 35
36extern void fpu_emulator_init_fpu(void); 36extern void fpu_emulator_init_fpu(void);
37extern void _init_fpu(void); 37extern void _init_fpu(void);
@@ -93,31 +93,52 @@ static inline int is_fpu_owner(void)
93 return cpu_has_fpu && __is_fpu_owner(); 93 return cpu_has_fpu && __is_fpu_owner();
94} 94}
95 95
96static inline void own_fpu(void) 96static inline void __own_fpu(void)
97{ 97{
98 if (cpu_has_fpu) { 98 __enable_fpu();
99 __enable_fpu(); 99 KSTK_STATUS(current) |= ST0_CU1;
100 KSTK_STATUS(current) |= ST0_CU1; 100 set_thread_flag(TIF_USEDFPU);
101 set_thread_flag(TIF_USEDFPU); 101}
102
103static inline void own_fpu_inatomic(int restore)
104{
105 if (cpu_has_fpu && !__is_fpu_owner()) {
106 __own_fpu();
107 if (restore)
108 _restore_fp(current);
102 } 109 }
103} 110}
104 111
105static inline void lose_fpu(void) 112static inline void own_fpu(int restore)
106{ 113{
107 if (cpu_has_fpu) { 114 preempt_disable();
115 own_fpu_inatomic(restore);
116 preempt_enable();
117}
118
119static inline void lose_fpu(int save)
120{
121 preempt_disable();
122 if (is_fpu_owner()) {
123 if (save)
124 _save_fp(current);
108 KSTK_STATUS(current) &= ~ST0_CU1; 125 KSTK_STATUS(current) &= ~ST0_CU1;
109 clear_thread_flag(TIF_USEDFPU); 126 clear_thread_flag(TIF_USEDFPU);
110 __disable_fpu(); 127 __disable_fpu();
111 } 128 }
129 preempt_enable();
112} 130}
113 131
114static inline void init_fpu(void) 132static inline void init_fpu(void)
115{ 133{
134 preempt_disable();
116 if (cpu_has_fpu) { 135 if (cpu_has_fpu) {
136 __own_fpu();
117 _init_fpu(); 137 _init_fpu();
118 } else { 138 } else {
119 fpu_emulator_init_fpu(); 139 fpu_emulator_init_fpu();
120 } 140 }
141 preempt_enable();
121} 142}
122 143
123static inline void save_fp(struct task_struct *tsk) 144static inline void save_fp(struct task_struct *tsk)
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index 50073157a617..e50c77e69cb5 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -52,6 +52,7 @@ ASMMACRO(tlb_probe_hazard,
52 _ehb 52 _ehb
53 ) 53 )
54ASMMACRO(irq_enable_hazard, 54ASMMACRO(irq_enable_hazard,
55 _ehb
55 ) 56 )
56ASMMACRO(irq_disable_hazard, 57ASMMACRO(irq_disable_hazard,
57 _ehb 58 _ehb
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h
index af3b07dfad4b..e459fa05db83 100644
--- a/include/asm-mips/irqflags.h
+++ b/include/asm-mips/irqflags.h
@@ -13,29 +13,9 @@
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15 15
16#include <linux/compiler.h>
16#include <asm/hazards.h> 17#include <asm/hazards.h>
17 18
18/*
19 * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred IPIs,
20 * at the cost of branch and call overhead on each local_irq_restore()
21 */
22
23#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY
24
25extern void smtc_ipi_replay(void);
26
27#define irq_restore_epilog(flags) \
28do { \
29 if (!(flags & 0x0400)) \
30 smtc_ipi_replay(); \
31} while (0)
32
33#else
34
35#define irq_restore_epilog(ignore) do { } while (0)
36
37#endif /* CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY */
38
39__asm__ ( 19__asm__ (
40 " .macro raw_local_irq_enable \n" 20 " .macro raw_local_irq_enable \n"
41 " .set push \n" 21 " .set push \n"
@@ -205,17 +185,28 @@ __asm__ (
205 " .set pop \n" 185 " .set pop \n"
206 " .endm \n"); 186 " .endm \n");
207 187
208#define raw_local_irq_restore(flags) \ 188extern void smtc_ipi_replay(void);
209do { \ 189
210 unsigned long __tmp1; \ 190static inline void raw_local_irq_restore(unsigned long flags)
211 \ 191{
212 __asm__ __volatile__( \ 192 unsigned long __tmp1;
213 "raw_local_irq_restore\t%0" \ 193
214 : "=r" (__tmp1) \ 194#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY
215 : "0" (flags) \ 195 /*
216 : "memory"); \ 196 * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred
217 irq_restore_epilog(flags); \ 197 * IPIs, at the cost of branch and call overhead on each
218} while(0) 198 * local_irq_restore()
199 */
200 if (unlikely(!(flags & 0x0400)))
201 smtc_ipi_replay();
202#endif
203
204 __asm__ __volatile__(
205 "raw_local_irq_restore\t%0"
206 : "=r" (__tmp1)
207 : "0" (flags)
208 : "memory");
209}
219 210
220static inline int raw_irqs_disabled_flags(unsigned long flags) 211static inline int raw_irqs_disabled_flags(unsigned long flags)
221{ 212{
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index e9fa252f8a3f..8fcae21adbd5 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -141,40 +141,6 @@ static int auide_ddma_init( _auide_hwif *auide );
141static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif); 141static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif);
142int __init auide_probe(void); 142int __init auide_probe(void);
143 143
144#ifdef CONFIG_PM
145 int au1200ide_pm_callback( au1xxx_power_dev_t *dev,
146 au1xxx_request_t request, void *data);
147 static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev );
148 static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev );
149 static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev );
150 static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev );
151 static int au1xxxide_pm_access( au1xxx_power_dev_t *dev );
152 static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev );
153 static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev );
154#endif
155
156
157/*
158 * Multi-Word DMA + DbDMA functions
159 */
160#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
161 static int auide_build_sglist(ide_drive_t *drive, struct request *rq);
162 static int auide_build_dmatable(ide_drive_t *drive);
163 static int auide_dma_end(ide_drive_t *drive);
164 ide_startstop_t auide_dma_intr (ide_drive_t *drive);
165 static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command);
166 static int auide_dma_setup(ide_drive_t *drive);
167 static int auide_dma_check(ide_drive_t *drive);
168 static int auide_dma_test_irq(ide_drive_t *drive);
169 static int auide_dma_host_off(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);
172 static int auide_dma_on(ide_drive_t *drive);
173 static void auide_ddma_tx_callback(int irq, void *param);
174 static void auide_ddma_rx_callback(int irq, void *param);
175 static int auide_dma_off_quietly(ide_drive_t *drive);
176#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
177
178/******************************************************************************* 144/*******************************************************************************
179* PIO Mode timing calculation : * 145* PIO Mode timing calculation : *
180* * 146* *
diff --git a/include/asm-mips/mach-ip27/dma-coherence.h b/include/asm-mips/mach-ip27/dma-coherence.h
index 659816e200d4..3fdbbf68e952 100644
--- a/include/asm-mips/mach-ip27/dma-coherence.h
+++ b/include/asm-mips/mach-ip27/dma-coherence.h
@@ -18,7 +18,8 @@
18 18
19struct device; 19struct device;
20 20
21static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) 21static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
22 size_t size)
22{ 23{
23 dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr)); 24 dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr));
24 25
@@ -37,7 +38,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
37 return dma_addr & (0xffUL << 56); 38 return dma_addr & (0xffUL << 56);
38} 39}
39 40
40static void plat_unmap_dma_mem(dma_addr_t dma_addr) 41static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
41{ 42{
42} 43}
43 44
diff --git a/include/asm-mips/mach-ip32/dma-coherence.h b/include/asm-mips/mach-ip32/dma-coherence.h
index 950be17bbb86..c3f9a6a20eb0 100644
--- a/include/asm-mips/mach-ip32/dma-coherence.h
+++ b/include/asm-mips/mach-ip32/dma-coherence.h
@@ -26,7 +26,8 @@ struct device;
26 26
27#define RAM_OFFSET_MASK 0x3fffffffUL 27#define RAM_OFFSET_MASK 0x3fffffffUL
28 28
29static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) 29static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
30 size_t size)
30{ 31{
31 dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK; 32 dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK;
32 33
@@ -59,7 +60,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
59 return addr; 60 return addr;
60} 61}
61 62
62static void plat_unmap_dma_mem(dma_addr_t dma_addr) 63static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
63{ 64{
64} 65}
65 66
diff --git a/include/asm-mips/marvell.h b/include/asm-mips/marvell.h
index df94955b098a..b6144bafc565 100644
--- a/include/asm-mips/marvell.h
+++ b/include/asm-mips/marvell.h
@@ -54,5 +54,6 @@ struct mv_pci_controller {
54}; 54};
55 55
56extern void ll_mv64340_irq(void); 56extern void ll_mv64340_irq(void);
57extern void mv64340_irq_init(unsigned int base);
57 58
58#endif /* __ASM_MIPS_MARVELL_H */ 59#endif /* __ASM_MIPS_MARVELL_H */
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index a5b18710b6a4..49f5a1a2dfcd 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -199,7 +199,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
199{ 199{
200 return pud_val(pud); 200 return pud_val(pud);
201} 201}
202#define pud_phys(pud) (pud_val(pud) - PAGE_OFFSET) 202#define pud_phys(pud) virt_to_phys((void *)pud_val(pud))
203#define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT)) 203#define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
204 204
205/* Find an entry in the second-level page table.. */ 205/* Find an entry in the second-level page table.. */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 3fcfd7979de5..0d3295f57a95 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -75,7 +75,7 @@ extern void paging_init(void);
75 * Conversion functions: convert a page and protection to a page entry, 75 * Conversion functions: convert a page and protection to a page entry,
76 * and a page entry and page directory to the page they refer to. 76 * and a page entry and page directory to the page they refer to.
77 */ 77 */
78#define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET) 78#define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
79#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) 79#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
80#define pmd_page_vaddr(pmd) pmd_val(pmd) 80#define pmd_page_vaddr(pmd) pmd_val(pmd)
81 81
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
index 59162f74a798..65778c890a62 100644
--- a/include/asm-mips/rtlx.h
+++ b/include/asm-mips/rtlx.h
@@ -23,8 +23,8 @@
23 23
24extern int rtlx_open(int index, int can_sleep); 24extern int rtlx_open(int index, int can_sleep);
25extern int rtlx_release(int index); 25extern int rtlx_release(int index);
26extern ssize_t rtlx_read(int index, void *buff, size_t count, int user); 26extern ssize_t rtlx_read(int index, void __user *buff, size_t count);
27extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user); 27extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count);
28extern unsigned int rtlx_read_poll(int index, int can_sleep); 28extern unsigned int rtlx_read_poll(int index, int can_sleep);
29extern unsigned int rtlx_write_poll(int index); 29extern unsigned int rtlx_write_poll(int index);
30 30
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h
index ddb859d05257..439bce7daa3a 100644
--- a/include/asm-mips/sgiarcs.h
+++ b/include/asm-mips/sgiarcs.h
@@ -459,7 +459,7 @@ struct linux_smonblock {
459 register signed int __a2 __asm__("$5") = (int) (long) (a2); \ 459 register signed int __a2 __asm__("$5") = (int) (long) (a2); \
460 register signed int __a3 __asm__("$6") = (int) (long) (a3); \ 460 register signed int __a3 __asm__("$6") = (int) (long) (a3); \
461 register signed int __a4 __asm__("$7") = (int) (long) (a4); \ 461 register signed int __a4 __asm__("$7") = (int) (long) (a4); \
462 register signed int __a5 = (a5); \ 462 register signed int __a5 = (int) (long) (a5); \
463 long __vec = (long) romvec->dest; \ 463 long __vec = (long) romvec->dest; \
464 __asm__ __volatile__( \ 464 __asm__ __volatile__( \
465 "dsubu\t$29, 32\n\t" \ 465 "dsubu\t$29, 32\n\t" \
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h
index dfb29e13bce0..494aa65dcfbd 100644
--- a/include/asm-mips/sibyte/sb1250.h
+++ b/include/asm-mips/sibyte/sb1250.h
@@ -67,6 +67,6 @@ extern void bcm1480_smp_finish(void);
67 67
68#endif 68#endif
69 69
70#define IOADDR(a) ((volatile void __iomem *)(IO_BASE + (a))) 70#define IOADDR(a) ((void __iomem *)(IO_BASE + (a)))
71 71
72#endif 72#endif
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h
index 7ed0bb611e56..b6a7d8f6ced5 100644
--- a/include/asm-mips/sibyte/sb1250_scd.h
+++ b/include/asm-mips/sibyte/sb1250_scd.h
@@ -84,6 +84,7 @@
84#define K_SYS_REVISION_BCM112x_A2 0x21 84#define K_SYS_REVISION_BCM112x_A2 0x21
85#define K_SYS_REVISION_BCM112x_A3 0x22 85#define K_SYS_REVISION_BCM112x_A3 0x22
86#define K_SYS_REVISION_BCM112x_A4 0x23 86#define K_SYS_REVISION_BCM112x_A4 0x23
87#define K_SYS_REVISION_BCM112x_B0 0x30
87 88
88#define K_SYS_REVISION_BCM1480_S0 0x01 89#define K_SYS_REVISION_BCM1480_S0 0x01
89#define K_SYS_REVISION_BCM1480_A1 0x02 90#define K_SYS_REVISION_BCM1480_A1 0x02
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
index 360ea6d250c7..a52a4a7a36e0 100644
--- a/include/asm-mips/smtc_ipi.h
+++ b/include/asm-mips/smtc_ipi.h
@@ -65,12 +65,10 @@ static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
65 spin_unlock_irqrestore(&q->lock, flags); 65 spin_unlock_irqrestore(&q->lock, flags);
66} 66}
67 67
68static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q) 68static inline struct smtc_ipi *__smtc_ipi_dq(struct smtc_ipi_q *q)
69{ 69{
70 struct smtc_ipi *p; 70 struct smtc_ipi *p;
71 long flags;
72 71
73 spin_lock_irqsave(&q->lock, flags);
74 if (q->head == NULL) 72 if (q->head == NULL)
75 p = NULL; 73 p = NULL;
76 else { 74 else {
@@ -81,7 +79,19 @@ static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
81 if (q->head == NULL) 79 if (q->head == NULL)
82 q->tail = NULL; 80 q->tail = NULL;
83 } 81 }
82
83 return p;
84}
85
86static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
87{
88 unsigned long flags;
89 struct smtc_ipi *p;
90
91 spin_lock_irqsave(&q->lock, flags);
92 p = __smtc_ipi_dq(q);
84 spin_unlock_irqrestore(&q->lock, flags); 93 spin_unlock_irqrestore(&q->lock, flags);
94
85 return p; 95 return p;
86} 96}
87 97
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 597a3743f6a1..290887077e44 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -121,10 +121,10 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
121 } else { 121 } else {
122 unsigned long flags; 122 unsigned long flags;
123 123
124 local_irq_save(flags); 124 raw_local_irq_save(flags);
125 retval = *m; 125 retval = *m;
126 *m = val; 126 *m = val;
127 local_irq_restore(flags); /* implies memory barrier */ 127 raw_local_irq_restore(flags); /* implies memory barrier */
128 } 128 }
129 129
130 smp_mb(); 130 smp_mb();
@@ -169,10 +169,10 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
169 } else { 169 } else {
170 unsigned long flags; 170 unsigned long flags;
171 171
172 local_irq_save(flags); 172 raw_local_irq_save(flags);
173 retval = *m; 173 retval = *m;
174 *m = val; 174 *m = val;
175 local_irq_restore(flags); /* implies memory barrier */ 175 raw_local_irq_restore(flags); /* implies memory barrier */
176 } 176 }
177 177
178 smp_mb(); 178 smp_mb();
@@ -250,11 +250,11 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
250 } else { 250 } else {
251 unsigned long flags; 251 unsigned long flags;
252 252
253 local_irq_save(flags); 253 raw_local_irq_save(flags);
254 retval = *m; 254 retval = *m;
255 if (retval == old) 255 if (retval == old)
256 *m = new; 256 *m = new;
257 local_irq_restore(flags); /* implies memory barrier */ 257 raw_local_irq_restore(flags); /* implies memory barrier */
258 } 258 }
259 259
260 smp_mb(); 260 smp_mb();
@@ -304,11 +304,11 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
304 } else { 304 } else {
305 unsigned long flags; 305 unsigned long flags;
306 306
307 local_irq_save(flags); 307 raw_local_irq_save(flags);
308 retval = *m; 308 retval = *m;
309 if (retval == old) 309 if (retval == old)
310 *m = new; 310 *m = new;
311 local_irq_restore(flags); /* implies memory barrier */ 311 raw_local_irq_restore(flags); /* implies memory barrier */
312 } 312 }
313 313
314 smp_mb(); 314 smp_mb();