diff options
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/pgtable.h | 11 | ||||
-rw-r--r-- | include/asm-ppc/ptrace.h | 7 | ||||
-rw-r--r-- | include/asm-ppc/segment.h | 1 | ||||
-rw-r--r-- | include/asm-ppc/smp.h | 6 | ||||
-rw-r--r-- | include/asm-ppc/spinlock.h | 91 | ||||
-rw-r--r-- | include/asm-ppc/spinlock_types.h | 20 | ||||
-rw-r--r-- | include/asm-ppc/system.h | 1 |
7 files changed, 54 insertions, 83 deletions
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 92f30b28b252..eee601bb9ada 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -812,15 +812,6 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size, | |||
812 | #ifdef CONFIG_PHYS_64BIT | 812 | #ifdef CONFIG_PHYS_64BIT |
813 | extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | 813 | extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, |
814 | unsigned long paddr, unsigned long size, pgprot_t prot); | 814 | unsigned long paddr, unsigned long size, pgprot_t prot); |
815 | static inline int io_remap_page_range(struct vm_area_struct *vma, | ||
816 | unsigned long vaddr, | ||
817 | unsigned long paddr, | ||
818 | unsigned long size, | ||
819 | pgprot_t prot) | ||
820 | { | ||
821 | phys_addr_t paddr64 = fixup_bigphys_addr(paddr, size); | ||
822 | return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot); | ||
823 | } | ||
824 | 815 | ||
825 | static inline int io_remap_pfn_range(struct vm_area_struct *vma, | 816 | static inline int io_remap_pfn_range(struct vm_area_struct *vma, |
826 | unsigned long vaddr, | 817 | unsigned long vaddr, |
@@ -832,8 +823,6 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, | |||
832 | return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot); | 823 | return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot); |
833 | } | 824 | } |
834 | #else | 825 | #else |
835 | #define io_remap_page_range(vma, vaddr, paddr, size, prot) \ | ||
836 | remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) | ||
837 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 826 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
838 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 827 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
839 | #endif | 828 | #endif |
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h index 9d4e4ea530c3..7043c164b537 100644 --- a/include/asm-ppc/ptrace.h +++ b/include/asm-ppc/ptrace.h | |||
@@ -142,4 +142,11 @@ do { \ | |||
142 | #define PTRACE_GETEVRREGS 20 | 142 | #define PTRACE_GETEVRREGS 20 |
143 | #define PTRACE_SETEVRREGS 21 | 143 | #define PTRACE_SETEVRREGS 21 |
144 | 144 | ||
145 | /* | ||
146 | * Get or set a debug register. The first 16 are DABR registers and the | ||
147 | * second 16 are IABR registers. | ||
148 | */ | ||
149 | #define PTRACE_GET_DEBUGREG 25 | ||
150 | #define PTRACE_SET_DEBUGREG 26 | ||
151 | |||
145 | #endif | 152 | #endif |
diff --git a/include/asm-ppc/segment.h b/include/asm-ppc/segment.h deleted file mode 100644 index 0f2f7428d437..000000000000 --- a/include/asm-ppc/segment.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm/uaccess.h> | ||
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index 17530c232c76..829481c0a9dc 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h | |||
@@ -41,6 +41,10 @@ extern void smp_send_xmon_break(int cpu); | |||
41 | struct pt_regs; | 41 | struct pt_regs; |
42 | extern void smp_message_recv(int, struct pt_regs *); | 42 | extern void smp_message_recv(int, struct pt_regs *); |
43 | 43 | ||
44 | extern int __cpu_disable(void); | ||
45 | extern void __cpu_die(unsigned int cpu); | ||
46 | extern void cpu_die(void) __attribute__((noreturn)); | ||
47 | |||
44 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 48 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
45 | #define PROC_CHANGE_PENALTY 20 | 49 | #define PROC_CHANGE_PENALTY 20 |
46 | 50 | ||
@@ -64,6 +68,8 @@ extern struct klock_info_struct klock_info; | |||
64 | 68 | ||
65 | #else /* !(CONFIG_SMP) */ | 69 | #else /* !(CONFIG_SMP) */ |
66 | 70 | ||
71 | static inline void cpu_die(void) { } | ||
72 | |||
67 | #endif /* !(CONFIG_SMP) */ | 73 | #endif /* !(CONFIG_SMP) */ |
68 | 74 | ||
69 | #endif /* !(_PPC_SMP_H) */ | 75 | #endif /* !(_PPC_SMP_H) */ |
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 909199aae104..20edcf2a6e0c 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h | |||
@@ -5,41 +5,21 @@ | |||
5 | 5 | ||
6 | /* | 6 | /* |
7 | * Simple spin lock operations. | 7 | * Simple spin lock operations. |
8 | * | ||
9 | * (the type definitions are in asm/raw_spinlock_types.h) | ||
8 | */ | 10 | */ |
9 | 11 | ||
10 | typedef struct { | 12 | #define __raw_spin_is_locked(x) ((x)->lock != 0) |
11 | volatile unsigned long lock; | 13 | #define __raw_spin_unlock_wait(lock) \ |
12 | #ifdef CONFIG_DEBUG_SPINLOCK | 14 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) |
13 | volatile unsigned long owner_pc; | 15 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
14 | volatile unsigned long owner_cpu; | 16 | |
15 | #endif | 17 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
16 | #ifdef CONFIG_PREEMPT | ||
17 | unsigned int break_lock; | ||
18 | #endif | ||
19 | } spinlock_t; | ||
20 | |||
21 | #ifdef __KERNEL__ | ||
22 | #ifdef CONFIG_DEBUG_SPINLOCK | ||
23 | #define SPINLOCK_DEBUG_INIT , 0, 0 | ||
24 | #else | ||
25 | #define SPINLOCK_DEBUG_INIT /* */ | ||
26 | #endif | ||
27 | |||
28 | #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 SPINLOCK_DEBUG_INIT } | ||
29 | |||
30 | #define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0) | ||
31 | #define spin_is_locked(x) ((x)->lock != 0) | ||
32 | #define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x)) | ||
33 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | ||
34 | |||
35 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
36 | |||
37 | static inline void _raw_spin_lock(spinlock_t *lock) | ||
38 | { | 18 | { |
39 | unsigned long tmp; | 19 | unsigned long tmp; |
40 | 20 | ||
41 | __asm__ __volatile__( | 21 | __asm__ __volatile__( |
42 | "b 1f # spin_lock\n\ | 22 | "b 1f # __raw_spin_lock\n\ |
43 | 2: lwzx %0,0,%1\n\ | 23 | 2: lwzx %0,0,%1\n\ |
44 | cmpwi 0,%0,0\n\ | 24 | cmpwi 0,%0,0\n\ |
45 | bne+ 2b\n\ | 25 | bne+ 2b\n\ |
@@ -55,21 +35,13 @@ static inline void _raw_spin_lock(spinlock_t *lock) | |||
55 | : "cr0", "memory"); | 35 | : "cr0", "memory"); |
56 | } | 36 | } |
57 | 37 | ||
58 | static inline void _raw_spin_unlock(spinlock_t *lock) | 38 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
59 | { | 39 | { |
60 | __asm__ __volatile__("eieio # spin_unlock": : :"memory"); | 40 | __asm__ __volatile__("eieio # __raw_spin_unlock": : :"memory"); |
61 | lock->lock = 0; | 41 | lock->lock = 0; |
62 | } | 42 | } |
63 | 43 | ||
64 | #define _raw_spin_trylock(l) (!test_and_set_bit(0,&(l)->lock)) | 44 | #define __raw_spin_trylock(l) (!test_and_set_bit(0,&(l)->lock)) |
65 | |||
66 | #else | ||
67 | |||
68 | extern void _raw_spin_lock(spinlock_t *lock); | ||
69 | extern void _raw_spin_unlock(spinlock_t *lock); | ||
70 | extern int _raw_spin_trylock(spinlock_t *lock); | ||
71 | |||
72 | #endif | ||
73 | 45 | ||
74 | /* | 46 | /* |
75 | * Read-write spinlocks, allowing multiple readers | 47 | * Read-write spinlocks, allowing multiple readers |
@@ -81,22 +53,11 @@ extern int _raw_spin_trylock(spinlock_t *lock); | |||
81 | * irq-safe write-lock, but readers can get non-irqsafe | 53 | * irq-safe write-lock, but readers can get non-irqsafe |
82 | * read-locks. | 54 | * read-locks. |
83 | */ | 55 | */ |
84 | typedef struct { | ||
85 | volatile signed int lock; | ||
86 | #ifdef CONFIG_PREEMPT | ||
87 | unsigned int break_lock; | ||
88 | #endif | ||
89 | } rwlock_t; | ||
90 | 56 | ||
91 | #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } | 57 | #define __raw_read_can_lock(rw) ((rw)->lock >= 0) |
92 | #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) | 58 | #define __raw_write_can_lock(rw) (!(rw)->lock) |
93 | 59 | ||
94 | #define read_can_lock(rw) ((rw)->lock >= 0) | 60 | static __inline__ int __raw_read_trylock(raw_rwlock_t *rw) |
95 | #define write_can_lock(rw) (!(rw)->lock) | ||
96 | |||
97 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
98 | |||
99 | static __inline__ int _raw_read_trylock(rwlock_t *rw) | ||
100 | { | 61 | { |
101 | signed int tmp; | 62 | signed int tmp; |
102 | 63 | ||
@@ -116,7 +77,7 @@ static __inline__ int _raw_read_trylock(rwlock_t *rw) | |||
116 | return tmp > 0; | 77 | return tmp > 0; |
117 | } | 78 | } |
118 | 79 | ||
119 | static __inline__ void _raw_read_lock(rwlock_t *rw) | 80 | static __inline__ void __raw_read_lock(raw_rwlock_t *rw) |
120 | { | 81 | { |
121 | signed int tmp; | 82 | signed int tmp; |
122 | 83 | ||
@@ -137,7 +98,7 @@ static __inline__ void _raw_read_lock(rwlock_t *rw) | |||
137 | : "cr0", "memory"); | 98 | : "cr0", "memory"); |
138 | } | 99 | } |
139 | 100 | ||
140 | static __inline__ void _raw_read_unlock(rwlock_t *rw) | 101 | static __inline__ void __raw_read_unlock(raw_rwlock_t *rw) |
141 | { | 102 | { |
142 | signed int tmp; | 103 | signed int tmp; |
143 | 104 | ||
@@ -153,7 +114,7 @@ static __inline__ void _raw_read_unlock(rwlock_t *rw) | |||
153 | : "cr0", "memory"); | 114 | : "cr0", "memory"); |
154 | } | 115 | } |
155 | 116 | ||
156 | static __inline__ int _raw_write_trylock(rwlock_t *rw) | 117 | static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) |
157 | { | 118 | { |
158 | signed int tmp; | 119 | signed int tmp; |
159 | 120 | ||
@@ -173,7 +134,7 @@ static __inline__ int _raw_write_trylock(rwlock_t *rw) | |||
173 | return tmp == 0; | 134 | return tmp == 0; |
174 | } | 135 | } |
175 | 136 | ||
176 | static __inline__ void _raw_write_lock(rwlock_t *rw) | 137 | static __inline__ void __raw_write_lock(raw_rwlock_t *rw) |
177 | { | 138 | { |
178 | signed int tmp; | 139 | signed int tmp; |
179 | 140 | ||
@@ -194,22 +155,10 @@ static __inline__ void _raw_write_lock(rwlock_t *rw) | |||
194 | : "cr0", "memory"); | 155 | : "cr0", "memory"); |
195 | } | 156 | } |
196 | 157 | ||
197 | static __inline__ void _raw_write_unlock(rwlock_t *rw) | 158 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) |
198 | { | 159 | { |
199 | __asm__ __volatile__("eieio # write_unlock": : :"memory"); | 160 | __asm__ __volatile__("eieio # write_unlock": : :"memory"); |
200 | rw->lock = 0; | 161 | rw->lock = 0; |
201 | } | 162 | } |
202 | 163 | ||
203 | #else | ||
204 | |||
205 | extern void _raw_read_lock(rwlock_t *rw); | ||
206 | extern void _raw_read_unlock(rwlock_t *rw); | ||
207 | extern void _raw_write_lock(rwlock_t *rw); | ||
208 | extern void _raw_write_unlock(rwlock_t *rw); | ||
209 | extern int _raw_read_trylock(rwlock_t *rw); | ||
210 | extern int _raw_write_trylock(rwlock_t *rw); | ||
211 | |||
212 | #endif | ||
213 | |||
214 | #endif /* __ASM_SPINLOCK_H */ | 164 | #endif /* __ASM_SPINLOCK_H */ |
215 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/spinlock_types.h b/include/asm-ppc/spinlock_types.h new file mode 100644 index 000000000000..7919ccc75b8a --- /dev/null +++ b/include/asm-ppc/spinlock_types.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | ||
2 | #define __ASM_SPINLOCK_TYPES_H | ||
3 | |||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | ||
9 | volatile unsigned long lock; | ||
10 | } raw_spinlock_t; | ||
11 | |||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | ||
13 | |||
14 | typedef struct { | ||
15 | volatile signed int lock; | ||
16 | } raw_rwlock_t; | ||
17 | |||
18 | #define __RAW_RW_LOCK_UNLOCKED { 0 } | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 513a334c5810..d754ab570fe0 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h | |||
@@ -88,6 +88,7 @@ extern void *cacheable_memcpy(void *, const void *, unsigned int); | |||
88 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); | 88 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); |
89 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); | 89 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); |
90 | extern void die(const char *, struct pt_regs *, long); | 90 | extern void die(const char *, struct pt_regs *, long); |
91 | extern void _exception(int, struct pt_regs *, int, unsigned long); | ||
91 | #ifdef CONFIG_BOOKE_WDT | 92 | #ifdef CONFIG_BOOKE_WDT |
92 | extern u32 booke_wdt_enabled; | 93 | extern u32 booke_wdt_enabled; |
93 | extern u32 booke_wdt_period; | 94 | extern u32 booke_wdt_period; |