diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-07-28 19:09:44 -0400 |
commit | f15cbe6f1a4b4d9df59142fc8e4abb973302cf44 (patch) | |
tree | 774d7b11abaaf33561ab8268bf51ddd9ceb79025 /include/asm-sh/cmpxchg-irq.h | |
parent | 25326277d8d1393d1c66240e6255aca780f9e3eb (diff) |
sh: migrate to arch/sh/include/
This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac.
Most of the moving about was done with Sam's directions at:
http://marc.info/?l=linux-sh&m=121724823706062&w=2
with subsequent hacking and fixups entirely my fault.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/cmpxchg-irq.h')
-rw-r--r-- | include/asm-sh/cmpxchg-irq.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/include/asm-sh/cmpxchg-irq.h b/include/asm-sh/cmpxchg-irq.h deleted file mode 100644 index 43049ec0554b..000000000000 --- a/include/asm-sh/cmpxchg-irq.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #ifndef __ASM_SH_CMPXCHG_IRQ_H | ||
2 | #define __ASM_SH_CMPXCHG_IRQ_H | ||
3 | |||
4 | static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) | ||
5 | { | ||
6 | unsigned long flags, retval; | ||
7 | |||
8 | local_irq_save(flags); | ||
9 | retval = *m; | ||
10 | *m = val; | ||
11 | local_irq_restore(flags); | ||
12 | return retval; | ||
13 | } | ||
14 | |||
15 | static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val) | ||
16 | { | ||
17 | unsigned long flags, retval; | ||
18 | |||
19 | local_irq_save(flags); | ||
20 | retval = *m; | ||
21 | *m = val & 0xff; | ||
22 | local_irq_restore(flags); | ||
23 | return retval; | ||
24 | } | ||
25 | |||
26 | static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old, | ||
27 | unsigned long new) | ||
28 | { | ||
29 | __u32 retval; | ||
30 | unsigned long flags; | ||
31 | |||
32 | local_irq_save(flags); | ||
33 | retval = *m; | ||
34 | if (retval == old) | ||
35 | *m = new; | ||
36 | local_irq_restore(flags); /* implies memory barrier */ | ||
37 | return retval; | ||
38 | } | ||
39 | |||
40 | #endif /* __ASM_SH_CMPXCHG_IRQ_H */ | ||