aboutsummaryrefslogtreecommitdiffstats
path: root/arch/score/include
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-03-28 13:30:02 -0400
committerDavid Howells <dhowells@redhat.com>2012-03-28 13:30:02 -0400
commit4eb14db4440febb7e560eb8ab2c099bc6e11a0ac (patch)
tree6a4d408111b670220c1515c1f688657c65b757cd /arch/score/include
parenta0616cdebcfd575dcd4c46102d1b52fbb827fc29 (diff)
Disintegrate asm/system.h for Score
Disintegrate asm/system.h for Score. Not compiled. Signed-off-by: David Howells <dhowells@redhat.com> cc: Chen Liqin <liqin.chen@sunplusct.com>
Diffstat (limited to 'arch/score/include')
-rw-r--r--arch/score/include/asm/atomic.h1
-rw-r--r--arch/score/include/asm/barrier.h16
-rw-r--r--arch/score/include/asm/bitops.h1
-rw-r--r--arch/score/include/asm/bug.h11
-rw-r--r--arch/score/include/asm/cmpxchg.h49
-rw-r--r--arch/score/include/asm/exec.h6
-rw-r--r--arch/score/include/asm/switch_to.h13
-rw-r--r--arch/score/include/asm/system.h95
8 files changed, 101 insertions, 91 deletions
diff --git a/arch/score/include/asm/atomic.h b/arch/score/include/asm/atomic.h
index 84eb8ddf9f3f..edf33dbded1e 100644
--- a/arch/score/include/asm/atomic.h
+++ b/arch/score/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_SCORE_ATOMIC_H 1#ifndef _ASM_SCORE_ATOMIC_H
2#define _ASM_SCORE_ATOMIC_H 2#define _ASM_SCORE_ATOMIC_H
3 3
4#include <asm/cmpxchg.h>
4#include <asm-generic/atomic.h> 5#include <asm-generic/atomic.h>
5 6
6#endif /* _ASM_SCORE_ATOMIC_H */ 7#endif /* _ASM_SCORE_ATOMIC_H */
diff --git a/arch/score/include/asm/barrier.h b/arch/score/include/asm/barrier.h
new file mode 100644
index 000000000000..0eacb6471e6d
--- /dev/null
+++ b/arch/score/include/asm/barrier.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_SCORE_BARRIER_H
2#define _ASM_SCORE_BARRIER_H
3
4#define mb() barrier()
5#define rmb() barrier()
6#define wmb() barrier()
7#define smp_mb() barrier()
8#define smp_rmb() barrier()
9#define smp_wmb() barrier()
10
11#define read_barrier_depends() do {} while (0)
12#define smp_read_barrier_depends() do {} while (0)
13
14#define set_mb(var, value) do {var = value; wmb(); } while (0)
15
16#endif /* _ASM_SCORE_BARRIER_H */
diff --git a/arch/score/include/asm/bitops.h b/arch/score/include/asm/bitops.h
index 2763b050fca8..a304096b1894 100644
--- a/arch/score/include/asm/bitops.h
+++ b/arch/score/include/asm/bitops.h
@@ -2,7 +2,6 @@
2#define _ASM_SCORE_BITOPS_H 2#define _ASM_SCORE_BITOPS_H
3 3
4#include <asm/byteorder.h> /* swab32 */ 4#include <asm/byteorder.h> /* swab32 */
5#include <asm/system.h> /* save_flags */
6 5
7/* 6/*
8 * clear_bit() doesn't provide any barrier for the compiler. 7 * clear_bit() doesn't provide any barrier for the compiler.
diff --git a/arch/score/include/asm/bug.h b/arch/score/include/asm/bug.h
index bb76a330bcf1..fd7164af1f04 100644
--- a/arch/score/include/asm/bug.h
+++ b/arch/score/include/asm/bug.h
@@ -3,4 +3,15 @@
3 3
4#include <asm-generic/bug.h> 4#include <asm-generic/bug.h>
5 5
6struct pt_regs;
7extern void __die(const char *, struct pt_regs *, const char *,
8 const char *, unsigned long) __attribute__((noreturn));
9extern void __die_if_kernel(const char *, struct pt_regs *, const char *,
10 const char *, unsigned long);
11
12#define die(msg, regs) \
13 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
14#define die_if_kernel(msg, regs) \
15 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
16
6#endif /* _ASM_SCORE_BUG_H */ 17#endif /* _ASM_SCORE_BUG_H */
diff --git a/arch/score/include/asm/cmpxchg.h b/arch/score/include/asm/cmpxchg.h
new file mode 100644
index 000000000000..f384839c3ee5
--- /dev/null
+++ b/arch/score/include/asm/cmpxchg.h
@@ -0,0 +1,49 @@
1#ifndef _ASM_SCORE_CMPXCHG_H
2#define _ASM_SCORE_CMPXCHG_H
3
4#include <linux/irqflags.h>
5
6struct __xchg_dummy { unsigned long a[100]; };
7#define __xg(x) ((struct __xchg_dummy *)(x))
8
9static inline
10unsigned long __xchg(volatile unsigned long *m, unsigned long val)
11{
12 unsigned long retval;
13 unsigned long flags;
14
15 local_irq_save(flags);
16 retval = *m;
17 *m = val;
18 local_irq_restore(flags);
19 return retval;
20}
21
22#define xchg(ptr, v) \
23 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
24 (unsigned long)(v)))
25
26static inline unsigned long __cmpxchg(volatile unsigned long *m,
27 unsigned long old, unsigned long new)
28{
29 unsigned long 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);
37 return retval;
38}
39
40#define cmpxchg(ptr, o, n) \
41 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
42 (unsigned long)(o), \
43 (unsigned long)(n)))
44
45#define __HAVE_ARCH_CMPXCHG 1
46
47#include <asm-generic/cmpxchg-local.h>
48
49#endif /* _ASM_SCORE_CMPXCHG_H */
diff --git a/arch/score/include/asm/exec.h b/arch/score/include/asm/exec.h
new file mode 100644
index 000000000000..f9f3cd59c860
--- /dev/null
+++ b/arch/score/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_SCORE_EXEC_H
2#define _ASM_SCORE_EXEC_H
3
4extern unsigned long arch_align_stack(unsigned long sp);
5
6#endif /* _ASM_SCORE_EXEC_H */
diff --git a/arch/score/include/asm/switch_to.h b/arch/score/include/asm/switch_to.h
new file mode 100644
index 000000000000..031756b59ece
--- /dev/null
+++ b/arch/score/include/asm/switch_to.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_SCORE_SWITCH_TO_H
2#define _ASM_SCORE_SWITCH_TO_H
3
4extern void *resume(void *last, void *next, void *next_ti);
5
6#define switch_to(prev, next, last) \
7do { \
8 (last) = resume(prev, next, task_thread_info(next)); \
9} while (0)
10
11#define finish_arch_switch(prev) do {} while (0)
12
13#endif /* _ASM_SCORE_SWITCH_TO_H */
diff --git a/arch/score/include/asm/system.h b/arch/score/include/asm/system.h
index 589d5c7e171c..a7f40578587c 100644
--- a/arch/score/include/asm/system.h
+++ b/arch/score/include/asm/system.h
@@ -1,90 +1,5 @@
1#ifndef _ASM_SCORE_SYSTEM_H 1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2#define _ASM_SCORE_SYSTEM_H 2#include <asm/barrier.h>
3 3#include <asm/cmpxchg.h>
4#include <linux/types.h> 4#include <asm/exec.h>
5#include <linux/irqflags.h> 5#include <asm/switch_to.h>
6
7struct pt_regs;
8struct task_struct;
9
10extern void *resume(void *last, void *next, void *next_ti);
11
12#define switch_to(prev, next, last) \
13do { \
14 (last) = resume(prev, next, task_thread_info(next)); \
15} while (0)
16
17#define finish_arch_switch(prev) do {} while (0)
18
19typedef void (*vi_handler_t)(void);
20extern unsigned long arch_align_stack(unsigned long sp);
21
22#define mb() barrier()
23#define rmb() barrier()
24#define wmb() barrier()
25#define smp_mb() barrier()
26#define smp_rmb() barrier()
27#define smp_wmb() barrier()
28
29#define read_barrier_depends() do {} while (0)
30#define smp_read_barrier_depends() do {} while (0)
31
32#define set_mb(var, value) do {var = value; wmb(); } while (0)
33
34#define __HAVE_ARCH_CMPXCHG 1
35
36#include <asm-generic/cmpxchg-local.h>
37
38#ifndef __ASSEMBLY__
39
40struct __xchg_dummy { unsigned long a[100]; };
41#define __xg(x) ((struct __xchg_dummy *)(x))
42
43static inline
44unsigned long __xchg(volatile unsigned long *m, unsigned long val)
45{
46 unsigned long retval;
47 unsigned long flags;
48
49 local_irq_save(flags);
50 retval = *m;
51 *m = val;
52 local_irq_restore(flags);
53 return retval;
54}
55
56#define xchg(ptr, v) \
57 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
58 (unsigned long)(v)))
59
60static inline unsigned long __cmpxchg(volatile unsigned long *m,
61 unsigned long old, unsigned long new)
62{
63 unsigned long retval;
64 unsigned long flags;
65
66 local_irq_save(flags);
67 retval = *m;
68 if (retval == old)
69 *m = new;
70 local_irq_restore(flags);
71 return retval;
72}
73
74#define cmpxchg(ptr, o, n) \
75 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
76 (unsigned long)(o), \
77 (unsigned long)(n)))
78
79extern void __die(const char *, struct pt_regs *, const char *,
80 const char *, unsigned long) __attribute__((noreturn));
81extern void __die_if_kernel(const char *, struct pt_regs *, const char *,
82 const char *, unsigned long);
83
84#define die(msg, regs) \
85 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
86#define die_if_kernel(msg, regs) \
87 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
88
89#endif /* !__ASSEMBLY__ */
90#endif /* _ASM_SCORE_SYSTEM_H */