diff options
author | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
commit | 57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch) | |
tree | e9c790afb4286f78cb08d9664f58baa7e876fe55 /include/asm-powerpc | |
parent | cb18bd40030c879cd93fef02fd579f74dbab473d (diff) | |
parent | 49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff) |
Merge branch 'merge'
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/atomic.h | 32 | ||||
-rw-r--r-- | include/asm-powerpc/backlight.h | 16 | ||||
-rw-r--r-- | include/asm-powerpc/bitops.h | 16 | ||||
-rw-r--r-- | include/asm-powerpc/irq.h | 38 | ||||
-rw-r--r-- | include/asm-powerpc/kprobes.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 17 |
6 files changed, 59 insertions, 61 deletions
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index bb3c0ab7e667..53283e2540b3 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v) | |||
27 | PPC405_ERR77(0,%3) | 27 | PPC405_ERR77(0,%3) |
28 | " stwcx. %0,0,%3 \n\ | 28 | " stwcx. %0,0,%3 \n\ |
29 | bne- 1b" | 29 | bne- 1b" |
30 | : "=&r" (t), "=m" (v->counter) | 30 | : "=&r" (t), "+m" (v->counter) |
31 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 31 | : "r" (a), "r" (&v->counter) |
32 | : "cc"); | 32 | : "cc"); |
33 | } | 33 | } |
34 | 34 | ||
@@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v) | |||
63 | PPC405_ERR77(0,%3) | 63 | PPC405_ERR77(0,%3) |
64 | " stwcx. %0,0,%3 \n\ | 64 | " stwcx. %0,0,%3 \n\ |
65 | bne- 1b" | 65 | bne- 1b" |
66 | : "=&r" (t), "=m" (v->counter) | 66 | : "=&r" (t), "+m" (v->counter) |
67 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 67 | : "r" (a), "r" (&v->counter) |
68 | : "cc"); | 68 | : "cc"); |
69 | } | 69 | } |
70 | 70 | ||
@@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v) | |||
97 | PPC405_ERR77(0,%2) | 97 | PPC405_ERR77(0,%2) |
98 | " stwcx. %0,0,%2 \n\ | 98 | " stwcx. %0,0,%2 \n\ |
99 | bne- 1b" | 99 | bne- 1b" |
100 | : "=&r" (t), "=m" (v->counter) | 100 | : "=&r" (t), "+m" (v->counter) |
101 | : "r" (&v->counter), "m" (v->counter) | 101 | : "r" (&v->counter) |
102 | : "cc"); | 102 | : "cc"); |
103 | } | 103 | } |
104 | 104 | ||
@@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v) | |||
141 | PPC405_ERR77(0,%2)\ | 141 | PPC405_ERR77(0,%2)\ |
142 | " stwcx. %0,0,%2\n\ | 142 | " stwcx. %0,0,%2\n\ |
143 | bne- 1b" | 143 | bne- 1b" |
144 | : "=&r" (t), "=m" (v->counter) | 144 | : "=&r" (t), "+m" (v->counter) |
145 | : "r" (&v->counter), "m" (v->counter) | 145 | : "r" (&v->counter) |
146 | : "cc"); | 146 | : "cc"); |
147 | } | 147 | } |
148 | 148 | ||
@@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v) | |||
253 | add %0,%2,%0\n\ | 253 | add %0,%2,%0\n\ |
254 | stdcx. %0,0,%3 \n\ | 254 | stdcx. %0,0,%3 \n\ |
255 | bne- 1b" | 255 | bne- 1b" |
256 | : "=&r" (t), "=m" (v->counter) | 256 | : "=&r" (t), "+m" (v->counter) |
257 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 257 | : "r" (a), "r" (&v->counter) |
258 | : "cc"); | 258 | : "cc"); |
259 | } | 259 | } |
260 | 260 | ||
@@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v) | |||
287 | subf %0,%2,%0\n\ | 287 | subf %0,%2,%0\n\ |
288 | stdcx. %0,0,%3 \n\ | 288 | stdcx. %0,0,%3 \n\ |
289 | bne- 1b" | 289 | bne- 1b" |
290 | : "=&r" (t), "=m" (v->counter) | 290 | : "=&r" (t), "+m" (v->counter) |
291 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 291 | : "r" (a), "r" (&v->counter) |
292 | : "cc"); | 292 | : "cc"); |
293 | } | 293 | } |
294 | 294 | ||
@@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v) | |||
319 | addic %0,%0,1\n\ | 319 | addic %0,%0,1\n\ |
320 | stdcx. %0,0,%2 \n\ | 320 | stdcx. %0,0,%2 \n\ |
321 | bne- 1b" | 321 | bne- 1b" |
322 | : "=&r" (t), "=m" (v->counter) | 322 | : "=&r" (t), "+m" (v->counter) |
323 | : "r" (&v->counter), "m" (v->counter) | 323 | : "r" (&v->counter) |
324 | : "cc"); | 324 | : "cc"); |
325 | } | 325 | } |
326 | 326 | ||
@@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v) | |||
361 | addic %0,%0,-1\n\ | 361 | addic %0,%0,-1\n\ |
362 | stdcx. %0,0,%2\n\ | 362 | stdcx. %0,0,%2\n\ |
363 | bne- 1b" | 363 | bne- 1b" |
364 | : "=&r" (t), "=m" (v->counter) | 364 | : "=&r" (t), "+m" (v->counter) |
365 | : "r" (&v->counter), "m" (v->counter) | 365 | : "r" (&v->counter) |
366 | : "cc"); | 366 | : "cc"); |
367 | } | 367 | } |
368 | 368 | ||
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index a5e9e656e332..8cf5c37c3817 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h | |||
@@ -16,16 +16,26 @@ | |||
16 | extern struct backlight_device *pmac_backlight; | 16 | extern struct backlight_device *pmac_backlight; |
17 | extern struct mutex pmac_backlight_mutex; | 17 | extern struct mutex pmac_backlight_mutex; |
18 | 18 | ||
19 | extern void pmac_backlight_calc_curve(struct fb_info*); | ||
20 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); | 19 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); |
21 | 20 | ||
22 | extern int pmac_has_backlight_type(const char *type); | 21 | extern int pmac_has_backlight_type(const char *type); |
23 | 22 | ||
24 | extern void pmac_backlight_key_up(void); | 23 | extern void pmac_backlight_key(int direction); |
25 | extern void pmac_backlight_key_down(void); | 24 | static inline void pmac_backlight_key_up(void) |
25 | { | ||
26 | pmac_backlight_key(0); | ||
27 | } | ||
28 | static inline void pmac_backlight_key_down(void) | ||
29 | { | ||
30 | pmac_backlight_key(1); | ||
31 | } | ||
26 | 32 | ||
33 | extern void pmac_backlight_set_legacy_brightness_pmu(int brightness); | ||
27 | extern int pmac_backlight_set_legacy_brightness(int brightness); | 34 | extern int pmac_backlight_set_legacy_brightness(int brightness); |
28 | extern int pmac_backlight_get_legacy_brightness(void); | 35 | extern int pmac_backlight_get_legacy_brightness(void); |
29 | 36 | ||
37 | extern void pmac_backlight_enable(void); | ||
38 | extern void pmac_backlight_disable(void); | ||
39 | |||
30 | #endif /* __KERNEL__ */ | 40 | #endif /* __KERNEL__ */ |
31 | #endif | 41 | #endif |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 76e2f08c3c83..c341063d0804 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr) | |||
65 | PPC405_ERR77(0,%3) | 65 | PPC405_ERR77(0,%3) |
66 | PPC_STLCX "%0,0,%3\n" | 66 | PPC_STLCX "%0,0,%3\n" |
67 | "bne- 1b" | 67 | "bne- 1b" |
68 | : "=&r"(old), "=m"(*p) | 68 | : "=&r" (old), "+m" (*p) |
69 | : "r"(mask), "r"(p), "m"(*p) | 69 | : "r" (mask), "r" (p) |
70 | : "cc" ); | 70 | : "cc" ); |
71 | } | 71 | } |
72 | 72 | ||
@@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr) | |||
82 | PPC405_ERR77(0,%3) | 82 | PPC405_ERR77(0,%3) |
83 | PPC_STLCX "%0,0,%3\n" | 83 | PPC_STLCX "%0,0,%3\n" |
84 | "bne- 1b" | 84 | "bne- 1b" |
85 | : "=&r"(old), "=m"(*p) | 85 | : "=&r" (old), "+m" (*p) |
86 | : "r"(mask), "r"(p), "m"(*p) | 86 | : "r" (mask), "r" (p) |
87 | : "cc" ); | 87 | : "cc" ); |
88 | } | 88 | } |
89 | 89 | ||
@@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr) | |||
99 | PPC405_ERR77(0,%3) | 99 | PPC405_ERR77(0,%3) |
100 | PPC_STLCX "%0,0,%3\n" | 100 | PPC_STLCX "%0,0,%3\n" |
101 | "bne- 1b" | 101 | "bne- 1b" |
102 | : "=&r"(old), "=m"(*p) | 102 | : "=&r" (old), "+m" (*p) |
103 | : "r"(mask), "r"(p), "m"(*p) | 103 | : "r" (mask), "r" (p) |
104 | : "cc" ); | 104 | : "cc" ); |
105 | } | 105 | } |
106 | 106 | ||
@@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) | |||
179 | "or %0,%0,%2\n" | 179 | "or %0,%0,%2\n" |
180 | PPC_STLCX "%0,0,%3\n" | 180 | PPC_STLCX "%0,0,%3\n" |
181 | "bne- 1b" | 181 | "bne- 1b" |
182 | : "=&r" (old), "=m" (*addr) | 182 | : "=&r" (old), "+m" (*addr) |
183 | : "r" (mask), "r" (addr), "m" (*addr) | 183 | : "r" (mask), "r" (addr) |
184 | : "cc"); | 184 | : "cc"); |
185 | } | 185 | } |
186 | 186 | ||
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index e05754752028..d903a62959da 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -83,25 +83,24 @@ struct irq_host_ops { | |||
83 | int (*match)(struct irq_host *h, struct device_node *node); | 83 | int (*match)(struct irq_host *h, struct device_node *node); |
84 | 84 | ||
85 | /* Create or update a mapping between a virtual irq number and a hw | 85 | /* Create or update a mapping between a virtual irq number and a hw |
86 | * irq number. This can be called several times for the same mapping | 86 | * irq number. This is called only once for a given mapping. |
87 | * but with different flags, though unmap shall always be called | ||
88 | * before the virq->hw mapping is changed. | ||
89 | */ | 87 | */ |
90 | int (*map)(struct irq_host *h, unsigned int virq, | 88 | int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); |
91 | irq_hw_number_t hw, unsigned int flags); | ||
92 | 89 | ||
93 | /* Dispose of such a mapping */ | 90 | /* Dispose of such a mapping */ |
94 | void (*unmap)(struct irq_host *h, unsigned int virq); | 91 | void (*unmap)(struct irq_host *h, unsigned int virq); |
95 | 92 | ||
96 | /* Translate device-tree interrupt specifier from raw format coming | 93 | /* Translate device-tree interrupt specifier from raw format coming |
97 | * from the firmware to a irq_hw_number_t (interrupt line number) and | 94 | * from the firmware to a irq_hw_number_t (interrupt line number) and |
98 | * trigger flags that can be passed to irq_create_mapping(). | 95 | * type (sense) that can be passed to set_irq_type(). In the absence |
99 | * If no translation is provided, raw format is assumed to be one cell | 96 | * of this callback, irq_create_of_mapping() and irq_of_parse_and_map() |
100 | * for interrupt line and default sense. | 97 | * will return the hw number in the first cell and IRQ_TYPE_NONE for |
98 | * the type (which amount to keeping whatever default value the | ||
99 | * interrupt controller has for that line) | ||
101 | */ | 100 | */ |
102 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, | 101 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, |
103 | u32 *intspec, unsigned int intsize, | 102 | u32 *intspec, unsigned int intsize, |
104 | irq_hw_number_t *out_hwirq, unsigned int *out_flags); | 103 | irq_hw_number_t *out_hwirq, unsigned int *out_type); |
105 | }; | 104 | }; |
106 | 105 | ||
107 | struct irq_host { | 106 | struct irq_host { |
@@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count); | |||
193 | * irq_create_mapping - Map a hardware interrupt into linux virq space | 192 | * irq_create_mapping - Map a hardware interrupt into linux virq space |
194 | * @host: host owning this hardware interrupt or NULL for default host | 193 | * @host: host owning this hardware interrupt or NULL for default host |
195 | * @hwirq: hardware irq number in that host space | 194 | * @hwirq: hardware irq number in that host space |
196 | * @flags: flags passed to the controller. contains the trigger type among | ||
197 | * others. Use IRQ_TYPE_* defined in include/linux/irq.h | ||
198 | * | 195 | * |
199 | * Only one mapping per hardware interrupt is permitted. Returns a linux | 196 | * Only one mapping per hardware interrupt is permitted. Returns a linux |
200 | * virq number. The flags can be used to provide sense information to the | 197 | * virq number. |
201 | * controller (typically extracted from the device-tree). If no information | 198 | * If the sense/trigger is to be specified, set_irq_type() should be called |
202 | * is passed, the controller defaults will apply (for example, xics can only | 199 | * on the number returned from that call. |
203 | * do edge so flags are irrelevant for some pseries specific irqs). | ||
204 | * | ||
205 | * The device-tree generally contains the trigger info in an encoding that is | ||
206 | * specific to a given type of controller. In that case, you can directly use | ||
207 | * host->ops->trigger_xlate() to translate that. | ||
208 | * | ||
209 | * It is recommended that new PICs that don't have existing OF bindings chose | ||
210 | * to use a representation of triggers identical to linux. | ||
211 | */ | 200 | */ |
212 | extern unsigned int irq_create_mapping(struct irq_host *host, | 201 | extern unsigned int irq_create_mapping(struct irq_host *host, |
213 | irq_hw_number_t hwirq, | 202 | irq_hw_number_t hwirq); |
214 | unsigned int flags); | ||
215 | 203 | ||
216 | 204 | ||
217 | /*** | 205 | /*** |
@@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count); | |||
295 | * | 283 | * |
296 | * This function is identical to irq_create_mapping except that it takes | 284 | * This function is identical to irq_create_mapping except that it takes |
297 | * as input informations straight from the device-tree (typically the results | 285 | * as input informations straight from the device-tree (typically the results |
298 | * of the of_irq_map_*() functions | 286 | * of the of_irq_map_*() functions. |
299 | */ | 287 | */ |
300 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | 288 | extern unsigned int irq_create_of_mapping(struct device_node *controller, |
301 | u32 *intspec, unsigned int intsize); | 289 | u32 *intspec, unsigned int intsize); |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 2d0af52c823d..34e1f89a5fa0 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t; | |||
51 | 51 | ||
52 | #define ARCH_SUPPORTS_KRETPROBES | 52 | #define ARCH_SUPPORTS_KRETPROBES |
53 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | 53 | #define ARCH_INACTIVE_KPROBE_COUNT 1 |
54 | #define flush_insn_slot(p) do { } while (0) | ||
54 | 55 | ||
55 | void kretprobe_trampoline(void); | 56 | void kretprobe_trampoline(void); |
56 | extern void arch_remove_kprobe(struct kprobe *p); | 57 | extern void arch_remove_kprobe(struct kprobe *p); |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 5deb7bc7bb1f..b6d330fe8ed3 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -39,7 +39,6 @@ | |||
39 | #define read_barrier_depends() do { } while(0) | 39 | #define read_barrier_depends() do { } while(0) |
40 | 40 | ||
41 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 41 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
42 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
43 | 42 | ||
44 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
45 | #ifdef CONFIG_SMP | 44 | #ifdef CONFIG_SMP |
@@ -215,8 +214,8 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
215 | " stwcx. %3,0,%2 \n\ | 214 | " stwcx. %3,0,%2 \n\ |
216 | bne- 1b" | 215 | bne- 1b" |
217 | ISYNC_ON_SMP | 216 | ISYNC_ON_SMP |
218 | : "=&r" (prev), "=m" (*(volatile unsigned int *)p) | 217 | : "=&r" (prev), "+m" (*(volatile unsigned int *)p) |
219 | : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) | 218 | : "r" (p), "r" (val) |
220 | : "cc", "memory"); | 219 | : "cc", "memory"); |
221 | 220 | ||
222 | return prev; | 221 | return prev; |
@@ -235,8 +234,8 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
235 | " stdcx. %3,0,%2 \n\ | 234 | " stdcx. %3,0,%2 \n\ |
236 | bne- 1b" | 235 | bne- 1b" |
237 | ISYNC_ON_SMP | 236 | ISYNC_ON_SMP |
238 | : "=&r" (prev), "=m" (*(volatile unsigned long *)p) | 237 | : "=&r" (prev), "+m" (*(volatile unsigned long *)p) |
239 | : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) | 238 | : "r" (p), "r" (val) |
240 | : "cc", "memory"); | 239 | : "cc", "memory"); |
241 | 240 | ||
242 | return prev; | 241 | return prev; |
@@ -294,8 +293,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
294 | ISYNC_ON_SMP | 293 | ISYNC_ON_SMP |
295 | "\n\ | 294 | "\n\ |
296 | 2:" | 295 | 2:" |
297 | : "=&r" (prev), "=m" (*p) | 296 | : "=&r" (prev), "+m" (*p) |
298 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 297 | : "r" (p), "r" (old), "r" (new) |
299 | : "cc", "memory"); | 298 | : "cc", "memory"); |
300 | 299 | ||
301 | return prev; | 300 | return prev; |
@@ -317,8 +316,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
317 | ISYNC_ON_SMP | 316 | ISYNC_ON_SMP |
318 | "\n\ | 317 | "\n\ |
319 | 2:" | 318 | 2:" |
320 | : "=&r" (prev), "=m" (*p) | 319 | : "=&r" (prev), "+m" (*p) |
321 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 320 | : "r" (p), "r" (old), "r" (new) |
322 | : "cc", "memory"); | 321 | : "cc", "memory"); |
323 | 322 | ||
324 | return prev; | 323 | return prev; |