diff options
Diffstat (limited to 'arch/cris/include')
25 files changed, 17 insertions, 569 deletions
diff --git a/arch/cris/include/arch-v10/arch/atomic.h b/arch/cris/include/arch-v10/arch/atomic.h deleted file mode 100644 index 6ef5e7d09024..000000000000 --- a/arch/cris/include/arch-v10/arch/atomic.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_CRIS_ARCH_ATOMIC__ | ||
2 | #define __ASM_CRIS_ARCH_ATOMIC__ | ||
3 | |||
4 | #define cris_atomic_save(addr, flags) local_irq_save(flags); | ||
5 | #define cris_atomic_restore(addr, flags) local_irq_restore(flags); | ||
6 | |||
7 | #endif | ||
diff --git a/arch/cris/include/arch-v10/arch/system.h b/arch/cris/include/arch-v10/arch/system.h index 935fde34aa15..9b5580f58b96 100644 --- a/arch/cris/include/arch-v10/arch/system.h +++ b/arch/cris/include/arch-v10/arch/system.h | |||
@@ -36,12 +36,4 @@ static inline unsigned long _get_base(char * addr) | |||
36 | return 0; | 36 | return 0; |
37 | } | 37 | } |
38 | 38 | ||
39 | #define nop() __asm__ __volatile__ ("nop"); | ||
40 | |||
41 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
42 | #define tas(ptr) (xchg((ptr),1)) | ||
43 | |||
44 | struct __xchg_dummy { unsigned long a[100]; }; | ||
45 | #define __xg(x) ((struct __xchg_dummy *)(x)) | ||
46 | |||
47 | #endif | 39 | #endif |
diff --git a/arch/cris/include/arch-v32/arch/atomic.h b/arch/cris/include/arch-v32/arch/atomic.h deleted file mode 100644 index 852ceff8013f..000000000000 --- a/arch/cris/include/arch-v32/arch/atomic.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | #ifndef __ASM_CRIS_ARCH_ATOMIC__ | ||
2 | #define __ASM_CRIS_ARCH_ATOMIC__ | ||
3 | |||
4 | #include <linux/spinlock_types.h> | ||
5 | |||
6 | extern void cris_spin_unlock(void *l, int val); | ||
7 | extern void cris_spin_lock(void *l); | ||
8 | extern int cris_spin_trylock(void* l); | ||
9 | |||
10 | #ifndef CONFIG_SMP | ||
11 | #define cris_atomic_save(addr, flags) local_irq_save(flags); | ||
12 | #define cris_atomic_restore(addr, flags) local_irq_restore(flags); | ||
13 | #else | ||
14 | |||
15 | extern spinlock_t cris_atomic_locks[]; | ||
16 | #define LOCK_COUNT 128 | ||
17 | #define HASH_ADDR(a) (((int)a) & 127) | ||
18 | |||
19 | #define cris_atomic_save(addr, flags) \ | ||
20 | local_irq_save(flags); \ | ||
21 | cris_spin_lock((void *)&cris_atomic_locks[HASH_ADDR(addr)].raw_lock.slock); | ||
22 | |||
23 | #define cris_atomic_restore(addr, flags) \ | ||
24 | { \ | ||
25 | spinlock_t *lock = (void*)&cris_atomic_locks[HASH_ADDR(addr)]; \ | ||
26 | __asm__ volatile ("move.d %1,%0" \ | ||
27 | : "=m" (lock->raw_lock.slock) \ | ||
28 | : "r" (1) \ | ||
29 | : "memory"); \ | ||
30 | local_irq_restore(flags); \ | ||
31 | } | ||
32 | |||
33 | #endif | ||
34 | |||
35 | #endif | ||
36 | |||
diff --git a/arch/cris/include/arch-v32/arch/processor.h b/arch/cris/include/arch-v32/arch/processor.h index a024b7d32fed..568759271ab5 100644 --- a/arch/cris/include/arch-v32/arch/processor.h +++ b/arch/cris/include/arch-v32/arch/processor.h | |||
@@ -25,8 +25,7 @@ struct thread_struct { | |||
25 | */ | 25 | */ |
26 | #define TASK_SIZE (0xB0000000UL) | 26 | #define TASK_SIZE (0xB0000000UL) |
27 | 27 | ||
28 | /* CCS I=1, enable interrupts. */ | 28 | #define INIT_THREAD { } |
29 | #define INIT_THREAD { 0, 0, (1 << I_CCS_BITNR) } | ||
30 | 29 | ||
31 | #define KSTK_EIP(tsk) \ | 30 | #define KSTK_EIP(tsk) \ |
32 | ({ \ | 31 | ({ \ |
diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h deleted file mode 100644 index f13275522f4d..000000000000 --- a/arch/cris/include/arch-v32/arch/spinlock.h +++ /dev/null | |||
@@ -1,131 +0,0 @@ | |||
1 | #ifndef __ASM_ARCH_SPINLOCK_H | ||
2 | #define __ASM_ARCH_SPINLOCK_H | ||
3 | |||
4 | #include <linux/spinlock_types.h> | ||
5 | |||
6 | #define RW_LOCK_BIAS 0x01000000 | ||
7 | |||
8 | extern void cris_spin_unlock(void *l, int val); | ||
9 | extern void cris_spin_lock(void *l); | ||
10 | extern int cris_spin_trylock(void *l); | ||
11 | |||
12 | static inline int arch_spin_is_locked(arch_spinlock_t *x) | ||
13 | { | ||
14 | return *(volatile signed char *)(&(x)->slock) <= 0; | ||
15 | } | ||
16 | |||
17 | static inline void arch_spin_unlock(arch_spinlock_t *lock) | ||
18 | { | ||
19 | __asm__ volatile ("move.d %1,%0" \ | ||
20 | : "=m" (lock->slock) \ | ||
21 | : "r" (1) \ | ||
22 | : "memory"); | ||
23 | } | ||
24 | |||
25 | static inline void arch_spin_unlock_wait(arch_spinlock_t *lock) | ||
26 | { | ||
27 | while (arch_spin_is_locked(lock)) | ||
28 | cpu_relax(); | ||
29 | } | ||
30 | |||
31 | static inline int arch_spin_trylock(arch_spinlock_t *lock) | ||
32 | { | ||
33 | return cris_spin_trylock((void *)&lock->slock); | ||
34 | } | ||
35 | |||
36 | static inline void arch_spin_lock(arch_spinlock_t *lock) | ||
37 | { | ||
38 | cris_spin_lock((void *)&lock->slock); | ||
39 | } | ||
40 | |||
41 | static inline void | ||
42 | arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) | ||
43 | { | ||
44 | arch_spin_lock(lock); | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * Read-write spinlocks, allowing multiple readers | ||
49 | * but only one writer. | ||
50 | * | ||
51 | * NOTE! it is quite common to have readers in interrupts | ||
52 | * but no interrupt writers. For those circumstances we | ||
53 | * can "mix" irq-safe locks - any writer needs to get a | ||
54 | * irq-safe write-lock, but readers can get non-irqsafe | ||
55 | * read-locks. | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | static inline int arch_read_can_lock(arch_rwlock_t *x) | ||
60 | { | ||
61 | return (int)(x)->lock > 0; | ||
62 | } | ||
63 | |||
64 | static inline int arch_write_can_lock(arch_rwlock_t *x) | ||
65 | { | ||
66 | return (x)->lock == RW_LOCK_BIAS; | ||
67 | } | ||
68 | |||
69 | static inline void arch_read_lock(arch_rwlock_t *rw) | ||
70 | { | ||
71 | arch_spin_lock(&rw->slock); | ||
72 | while (rw->lock == 0); | ||
73 | rw->lock--; | ||
74 | arch_spin_unlock(&rw->slock); | ||
75 | } | ||
76 | |||
77 | static inline void arch_write_lock(arch_rwlock_t *rw) | ||
78 | { | ||
79 | arch_spin_lock(&rw->slock); | ||
80 | while (rw->lock != RW_LOCK_BIAS); | ||
81 | rw->lock = 0; | ||
82 | arch_spin_unlock(&rw->slock); | ||
83 | } | ||
84 | |||
85 | static inline void arch_read_unlock(arch_rwlock_t *rw) | ||
86 | { | ||
87 | arch_spin_lock(&rw->slock); | ||
88 | rw->lock++; | ||
89 | arch_spin_unlock(&rw->slock); | ||
90 | } | ||
91 | |||
92 | static inline void arch_write_unlock(arch_rwlock_t *rw) | ||
93 | { | ||
94 | arch_spin_lock(&rw->slock); | ||
95 | while (rw->lock != RW_LOCK_BIAS); | ||
96 | rw->lock = RW_LOCK_BIAS; | ||
97 | arch_spin_unlock(&rw->slock); | ||
98 | } | ||
99 | |||
100 | static inline int arch_read_trylock(arch_rwlock_t *rw) | ||
101 | { | ||
102 | int ret = 0; | ||
103 | arch_spin_lock(&rw->slock); | ||
104 | if (rw->lock != 0) { | ||
105 | rw->lock--; | ||
106 | ret = 1; | ||
107 | } | ||
108 | arch_spin_unlock(&rw->slock); | ||
109 | return ret; | ||
110 | } | ||
111 | |||
112 | static inline int arch_write_trylock(arch_rwlock_t *rw) | ||
113 | { | ||
114 | int ret = 0; | ||
115 | arch_spin_lock(&rw->slock); | ||
116 | if (rw->lock == RW_LOCK_BIAS) { | ||
117 | rw->lock = 0; | ||
118 | ret = 1; | ||
119 | } | ||
120 | arch_spin_unlock(&rw->slock); | ||
121 | return ret; | ||
122 | } | ||
123 | |||
124 | #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock) | ||
125 | #define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock) | ||
126 | |||
127 | #define arch_spin_relax(lock) cpu_relax() | ||
128 | #define arch_read_relax(lock) cpu_relax() | ||
129 | #define arch_write_relax(lock) cpu_relax() | ||
130 | |||
131 | #endif /* __ASM_ARCH_SPINLOCK_H */ | ||
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index 889f2de050a3..057e51859b0a 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild | |||
@@ -1,16 +1,29 @@ | |||
1 | 1 | generic-y += atomic.h | |
2 | generic-y += barrier.h | 2 | generic-y += barrier.h |
3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
4 | generic-y += cmpxchg.h | ||
4 | generic-y += cputime.h | 5 | generic-y += cputime.h |
6 | generic-y += device.h | ||
7 | generic-y += div64.h | ||
5 | generic-y += exec.h | 8 | generic-y += exec.h |
9 | generic-y += emergency-restart.h | ||
10 | generic-y += futex.h | ||
11 | generic-y += hardirq.h | ||
12 | generic-y += irq_regs.h | ||
6 | generic-y += irq_work.h | 13 | generic-y += irq_work.h |
14 | generic-y += kdebug.h | ||
15 | generic-y += kmap_types.h | ||
7 | generic-y += kvm_para.h | 16 | generic-y += kvm_para.h |
8 | generic-y += linkage.h | 17 | generic-y += linkage.h |
18 | generic-y += local.h | ||
19 | generic-y += local64.h | ||
9 | generic-y += mcs_spinlock.h | 20 | generic-y += mcs_spinlock.h |
10 | generic-y += module.h | 21 | generic-y += module.h |
22 | generic-y += percpu.h | ||
11 | generic-y += preempt.h | 23 | generic-y += preempt.h |
12 | generic-y += scatterlist.h | 24 | generic-y += scatterlist.h |
13 | generic-y += sections.h | 25 | generic-y += sections.h |
26 | generic-y += topology.h | ||
14 | generic-y += trace_clock.h | 27 | generic-y += trace_clock.h |
15 | generic-y += vga.h | 28 | generic-y += vga.h |
16 | generic-y += xor.h | 29 | generic-y += xor.h |
diff --git a/arch/cris/include/asm/atomic.h b/arch/cris/include/asm/atomic.h deleted file mode 100644 index 279766a70664..000000000000 --- a/arch/cris/include/asm/atomic.h +++ /dev/null | |||
@@ -1,149 +0,0 @@ | |||
1 | /* $Id: atomic.h,v 1.3 2001/07/25 16:15:19 bjornw Exp $ */ | ||
2 | |||
3 | #ifndef __ASM_CRIS_ATOMIC__ | ||
4 | #define __ASM_CRIS_ATOMIC__ | ||
5 | |||
6 | #include <linux/compiler.h> | ||
7 | #include <linux/types.h> | ||
8 | #include <asm/cmpxchg.h> | ||
9 | #include <arch/atomic.h> | ||
10 | #include <arch/system.h> | ||
11 | #include <asm/barrier.h> | ||
12 | |||
13 | /* | ||
14 | * Atomic operations that C can't guarantee us. Useful for | ||
15 | * resource counting etc.. | ||
16 | */ | ||
17 | |||
18 | #define ATOMIC_INIT(i) { (i) } | ||
19 | |||
20 | #define atomic_read(v) ACCESS_ONCE((v)->counter) | ||
21 | #define atomic_set(v,i) (((v)->counter) = (i)) | ||
22 | |||
23 | /* These should be written in asm but we do it in C for now. */ | ||
24 | |||
25 | #define ATOMIC_OP(op, c_op) \ | ||
26 | static inline void atomic_##op(int i, volatile atomic_t *v) \ | ||
27 | { \ | ||
28 | unsigned long flags; \ | ||
29 | cris_atomic_save(v, flags); \ | ||
30 | v->counter c_op i; \ | ||
31 | cris_atomic_restore(v, flags); \ | ||
32 | } \ | ||
33 | |||
34 | #define ATOMIC_OP_RETURN(op, c_op) \ | ||
35 | static inline int atomic_##op##_return(int i, volatile atomic_t *v) \ | ||
36 | { \ | ||
37 | unsigned long flags; \ | ||
38 | int retval; \ | ||
39 | cris_atomic_save(v, flags); \ | ||
40 | retval = (v->counter c_op i); \ | ||
41 | cris_atomic_restore(v, flags); \ | ||
42 | return retval; \ | ||
43 | } | ||
44 | |||
45 | #define ATOMIC_OPS(op, c_op) ATOMIC_OP(op, c_op) ATOMIC_OP_RETURN(op, c_op) | ||
46 | |||
47 | ATOMIC_OPS(add, +=) | ||
48 | ATOMIC_OPS(sub, -=) | ||
49 | |||
50 | #undef ATOMIC_OPS | ||
51 | #undef ATOMIC_OP_RETURN | ||
52 | #undef ATOMIC_OP | ||
53 | |||
54 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) | ||
55 | |||
56 | static inline int atomic_sub_and_test(int i, volatile atomic_t *v) | ||
57 | { | ||
58 | int retval; | ||
59 | unsigned long flags; | ||
60 | cris_atomic_save(v, flags); | ||
61 | retval = (v->counter -= i) == 0; | ||
62 | cris_atomic_restore(v, flags); | ||
63 | return retval; | ||
64 | } | ||
65 | |||
66 | static inline void atomic_inc(volatile atomic_t *v) | ||
67 | { | ||
68 | unsigned long flags; | ||
69 | cris_atomic_save(v, flags); | ||
70 | (v->counter)++; | ||
71 | cris_atomic_restore(v, flags); | ||
72 | } | ||
73 | |||
74 | static inline void atomic_dec(volatile atomic_t *v) | ||
75 | { | ||
76 | unsigned long flags; | ||
77 | cris_atomic_save(v, flags); | ||
78 | (v->counter)--; | ||
79 | cris_atomic_restore(v, flags); | ||
80 | } | ||
81 | |||
82 | static inline int atomic_inc_return(volatile atomic_t *v) | ||
83 | { | ||
84 | unsigned long flags; | ||
85 | int retval; | ||
86 | cris_atomic_save(v, flags); | ||
87 | retval = ++(v->counter); | ||
88 | cris_atomic_restore(v, flags); | ||
89 | return retval; | ||
90 | } | ||
91 | |||
92 | static inline int atomic_dec_return(volatile atomic_t *v) | ||
93 | { | ||
94 | unsigned long flags; | ||
95 | int retval; | ||
96 | cris_atomic_save(v, flags); | ||
97 | retval = --(v->counter); | ||
98 | cris_atomic_restore(v, flags); | ||
99 | return retval; | ||
100 | } | ||
101 | static inline int atomic_dec_and_test(volatile atomic_t *v) | ||
102 | { | ||
103 | int retval; | ||
104 | unsigned long flags; | ||
105 | cris_atomic_save(v, flags); | ||
106 | retval = --(v->counter) == 0; | ||
107 | cris_atomic_restore(v, flags); | ||
108 | return retval; | ||
109 | } | ||
110 | |||
111 | static inline int atomic_inc_and_test(volatile atomic_t *v) | ||
112 | { | ||
113 | int retval; | ||
114 | unsigned long flags; | ||
115 | cris_atomic_save(v, flags); | ||
116 | retval = ++(v->counter) == 0; | ||
117 | cris_atomic_restore(v, flags); | ||
118 | return retval; | ||
119 | } | ||
120 | |||
121 | static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | ||
122 | { | ||
123 | int ret; | ||
124 | unsigned long flags; | ||
125 | |||
126 | cris_atomic_save(v, flags); | ||
127 | ret = v->counter; | ||
128 | if (likely(ret == old)) | ||
129 | v->counter = new; | ||
130 | cris_atomic_restore(v, flags); | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
135 | |||
136 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) | ||
137 | { | ||
138 | int ret; | ||
139 | unsigned long flags; | ||
140 | |||
141 | cris_atomic_save(v, flags); | ||
142 | ret = v->counter; | ||
143 | if (ret != u) | ||
144 | v->counter += a; | ||
145 | cris_atomic_restore(v, flags); | ||
146 | return ret; | ||
147 | } | ||
148 | |||
149 | #endif | ||
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h index bd49a546f4f5..8062cb52d343 100644 --- a/arch/cris/include/asm/bitops.h +++ b/arch/cris/include/asm/bitops.h | |||
@@ -19,119 +19,10 @@ | |||
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #include <arch/bitops.h> | 21 | #include <arch/bitops.h> |
22 | #include <linux/atomic.h> | ||
23 | #include <linux/compiler.h> | 22 | #include <linux/compiler.h> |
24 | #include <asm/barrier.h> | 23 | #include <asm/barrier.h> |
25 | 24 | ||
26 | /* | 25 | #include <asm-generic/bitops/atomic.h> |
27 | * set_bit - Atomically set a bit in memory | ||
28 | * @nr: the bit to set | ||
29 | * @addr: the address to start counting from | ||
30 | * | ||
31 | * This function is atomic and may not be reordered. See __set_bit() | ||
32 | * if you do not require the atomic guarantees. | ||
33 | * Note that @nr may be almost arbitrarily large; this function is not | ||
34 | * restricted to acting on a single-word quantity. | ||
35 | */ | ||
36 | |||
37 | #define set_bit(nr, addr) (void)test_and_set_bit(nr, addr) | ||
38 | |||
39 | /* | ||
40 | * clear_bit - Clears a bit in memory | ||
41 | * @nr: Bit to clear | ||
42 | * @addr: Address to start counting from | ||
43 | * | ||
44 | * clear_bit() is atomic and may not be reordered. However, it does | ||
45 | * not contain a memory barrier, so if it is used for locking purposes, | ||
46 | * you should call smp_mb__before_atomic() and/or smp_mb__after_atomic() | ||
47 | * in order to ensure changes are visible on other processors. | ||
48 | */ | ||
49 | |||
50 | #define clear_bit(nr, addr) (void)test_and_clear_bit(nr, addr) | ||
51 | |||
52 | /* | ||
53 | * change_bit - Toggle a bit in memory | ||
54 | * @nr: Bit to change | ||
55 | * @addr: Address to start counting from | ||
56 | * | ||
57 | * change_bit() is atomic and may not be reordered. | ||
58 | * Note that @nr may be almost arbitrarily large; this function is not | ||
59 | * restricted to acting on a single-word quantity. | ||
60 | */ | ||
61 | |||
62 | #define change_bit(nr, addr) (void)test_and_change_bit(nr, addr) | ||
63 | |||
64 | /** | ||
65 | * test_and_set_bit - Set a bit and return its old value | ||
66 | * @nr: Bit to set | ||
67 | * @addr: Address to count from | ||
68 | * | ||
69 | * This operation is atomic and cannot be reordered. | ||
70 | * It also implies a memory barrier. | ||
71 | */ | ||
72 | |||
73 | static inline int test_and_set_bit(int nr, volatile unsigned long *addr) | ||
74 | { | ||
75 | unsigned int mask, retval; | ||
76 | unsigned long flags; | ||
77 | unsigned int *adr = (unsigned int *)addr; | ||
78 | |||
79 | adr += nr >> 5; | ||
80 | mask = 1 << (nr & 0x1f); | ||
81 | cris_atomic_save(addr, flags); | ||
82 | retval = (mask & *adr) != 0; | ||
83 | *adr |= mask; | ||
84 | cris_atomic_restore(addr, flags); | ||
85 | return retval; | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * test_and_clear_bit - Clear a bit and return its old value | ||
90 | * @nr: Bit to clear | ||
91 | * @addr: Address to count from | ||
92 | * | ||
93 | * This operation is atomic and cannot be reordered. | ||
94 | * It also implies a memory barrier. | ||
95 | */ | ||
96 | |||
97 | static inline int test_and_clear_bit(int nr, volatile unsigned long *addr) | ||
98 | { | ||
99 | unsigned int mask, retval; | ||
100 | unsigned long flags; | ||
101 | unsigned int *adr = (unsigned int *)addr; | ||
102 | |||
103 | adr += nr >> 5; | ||
104 | mask = 1 << (nr & 0x1f); | ||
105 | cris_atomic_save(addr, flags); | ||
106 | retval = (mask & *adr) != 0; | ||
107 | *adr &= ~mask; | ||
108 | cris_atomic_restore(addr, flags); | ||
109 | return retval; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * test_and_change_bit - Change a bit and return its old value | ||
114 | * @nr: Bit to change | ||
115 | * @addr: Address to count from | ||
116 | * | ||
117 | * This operation is atomic and cannot be reordered. | ||
118 | * It also implies a memory barrier. | ||
119 | */ | ||
120 | |||
121 | static inline int test_and_change_bit(int nr, volatile unsigned long *addr) | ||
122 | { | ||
123 | unsigned int mask, retval; | ||
124 | unsigned long flags; | ||
125 | unsigned int *adr = (unsigned int *)addr; | ||
126 | adr += nr >> 5; | ||
127 | mask = 1 << (nr & 0x1f); | ||
128 | cris_atomic_save(addr, flags); | ||
129 | retval = (mask & *adr) != 0; | ||
130 | *adr ^= mask; | ||
131 | cris_atomic_restore(addr, flags); | ||
132 | return retval; | ||
133 | } | ||
134 | |||
135 | #include <asm-generic/bitops/non-atomic.h> | 26 | #include <asm-generic/bitops/non-atomic.h> |
136 | 27 | ||
137 | /* | 28 | /* |
diff --git a/arch/cris/include/asm/cmpxchg.h b/arch/cris/include/asm/cmpxchg.h deleted file mode 100644 index b756dac8aa3f..000000000000 --- a/arch/cris/include/asm/cmpxchg.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | #ifndef __ASM_CRIS_CMPXCHG__ | ||
2 | #define __ASM_CRIS_CMPXCHG__ | ||
3 | |||
4 | #include <linux/irqflags.h> | ||
5 | |||
6 | static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) | ||
7 | { | ||
8 | /* since Etrax doesn't have any atomic xchg instructions, we need to disable | ||
9 | irq's (if enabled) and do it with move.d's */ | ||
10 | unsigned long flags,temp; | ||
11 | local_irq_save(flags); /* save flags, including irq enable bit and shut off irqs */ | ||
12 | switch (size) { | ||
13 | case 1: | ||
14 | *((unsigned char *)&temp) = x; | ||
15 | x = *(unsigned char *)ptr; | ||
16 | *(unsigned char *)ptr = *((unsigned char *)&temp); | ||
17 | break; | ||
18 | case 2: | ||
19 | *((unsigned short *)&temp) = x; | ||
20 | x = *(unsigned short *)ptr; | ||
21 | *(unsigned short *)ptr = *((unsigned short *)&temp); | ||
22 | break; | ||
23 | case 4: | ||
24 | temp = x; | ||
25 | x = *(unsigned long *)ptr; | ||
26 | *(unsigned long *)ptr = temp; | ||
27 | break; | ||
28 | } | ||
29 | local_irq_restore(flags); /* restore irq enable bit */ | ||
30 | return x; | ||
31 | } | ||
32 | |||
33 | #define xchg(ptr,x) \ | ||
34 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
35 | |||
36 | #define tas(ptr) (xchg((ptr),1)) | ||
37 | |||
38 | #include <asm-generic/cmpxchg-local.h> | ||
39 | |||
40 | /* | ||
41 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
42 | * them available. | ||
43 | */ | ||
44 | #define cmpxchg_local(ptr, o, n) \ | ||
45 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
46 | (unsigned long)(n), sizeof(*(ptr)))) | ||
47 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
48 | |||
49 | #ifndef CONFIG_SMP | ||
50 | #include <asm-generic/cmpxchg.h> | ||
51 | #endif | ||
52 | |||
53 | #endif /* __ASM_CRIS_CMPXCHG__ */ | ||
diff --git a/arch/cris/include/asm/device.h b/arch/cris/include/asm/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/arch/cris/include/asm/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/arch/cris/include/asm/div64.h b/arch/cris/include/asm/div64.h deleted file mode 100644 index 6cd978cefb28..000000000000 --- a/arch/cris/include/asm/div64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/div64.h> | ||
diff --git a/arch/cris/include/asm/elf.h b/arch/cris/include/asm/elf.h index 30ded8fbf592..c2a394ff55ff 100644 --- a/arch/cris/include/asm/elf.h +++ b/arch/cris/include/asm/elf.h | |||
@@ -71,7 +71,7 @@ typedef unsigned long elf_fpregset_t; | |||
71 | the loader. We need to make sure that it is out of the way of the program | 71 | the loader. We need to make sure that it is out of the way of the program |
72 | that it will "exec", and that there is sufficient room for the brk. */ | 72 | that it will "exec", and that there is sufficient room for the brk. */ |
73 | 73 | ||
74 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | 74 | #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) |
75 | 75 | ||
76 | /* This yields a mask that user programs can use to figure out what | 76 | /* This yields a mask that user programs can use to figure out what |
77 | instruction set this CPU supports. This could be done in user space, | 77 | instruction set this CPU supports. This could be done in user space, |
diff --git a/arch/cris/include/asm/emergency-restart.h b/arch/cris/include/asm/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/arch/cris/include/asm/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/cris/include/asm/futex.h b/arch/cris/include/asm/futex.h deleted file mode 100644 index 6a332a9f099c..000000000000 --- a/arch/cris/include/asm/futex.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_FUTEX_H | ||
2 | #define _ASM_FUTEX_H | ||
3 | |||
4 | #include <asm-generic/futex.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/cris/include/asm/hardirq.h b/arch/cris/include/asm/hardirq.h deleted file mode 100644 index 04126f7bfab2..000000000000 --- a/arch/cris/include/asm/hardirq.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_HARDIRQ_H | ||
2 | #define __ASM_HARDIRQ_H | ||
3 | |||
4 | #include <asm/irq.h> | ||
5 | #include <asm-generic/hardirq.h> | ||
6 | |||
7 | #endif /* __ASM_HARDIRQ_H */ | ||
diff --git a/arch/cris/include/asm/irq_regs.h b/arch/cris/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/cris/include/asm/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/arch/cris/include/asm/kdebug.h b/arch/cris/include/asm/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/arch/cris/include/asm/kdebug.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kdebug.h> | ||
diff --git a/arch/cris/include/asm/kmap_types.h b/arch/cris/include/asm/kmap_types.h deleted file mode 100644 index d2d643c4ea59..000000000000 --- a/arch/cris/include/asm/kmap_types.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _ASM_KMAP_TYPES_H | ||
2 | #define _ASM_KMAP_TYPES_H | ||
3 | |||
4 | /* Dummy header just to define km_type. None of this | ||
5 | * is actually used on cris. | ||
6 | */ | ||
7 | |||
8 | #include <asm-generic/kmap_types.h> | ||
9 | |||
10 | #endif | ||
diff --git a/arch/cris/include/asm/local.h b/arch/cris/include/asm/local.h deleted file mode 100644 index c11c530f74d0..000000000000 --- a/arch/cris/include/asm/local.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/local.h> | ||
diff --git a/arch/cris/include/asm/local64.h b/arch/cris/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/cris/include/asm/local64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/local64.h> | ||
diff --git a/arch/cris/include/asm/percpu.h b/arch/cris/include/asm/percpu.h deleted file mode 100644 index 6db9b43cf80a..000000000000 --- a/arch/cris/include/asm/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _CRIS_PERCPU_H | ||
2 | #define _CRIS_PERCPU_H | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* _CRIS_PERCPU_H */ | ||
diff --git a/arch/cris/include/asm/smp.h b/arch/cris/include/asm/smp.h deleted file mode 100644 index c615a06dd757..000000000000 --- a/arch/cris/include/asm/smp.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef __ASM_SMP_H | ||
2 | #define __ASM_SMP_H | ||
3 | |||
4 | #include <linux/cpumask.h> | ||
5 | |||
6 | extern cpumask_t phys_cpu_present_map; | ||
7 | |||
8 | #define raw_smp_processor_id() (current_thread_info()->cpu) | ||
9 | |||
10 | #endif | ||
diff --git a/arch/cris/include/asm/spinlock.h b/arch/cris/include/asm/spinlock.h deleted file mode 100644 index ed816b57face..000000000000 --- a/arch/cris/include/asm/spinlock.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <arch/spinlock.h> | ||
diff --git a/arch/cris/include/asm/tlbflush.h b/arch/cris/include/asm/tlbflush.h index 20697e7ef4f2..b424f43a9fd6 100644 --- a/arch/cris/include/asm/tlbflush.h +++ b/arch/cris/include/asm/tlbflush.h | |||
@@ -22,16 +22,9 @@ extern void __flush_tlb_mm(struct mm_struct *mm); | |||
22 | extern void __flush_tlb_page(struct vm_area_struct *vma, | 22 | extern void __flush_tlb_page(struct vm_area_struct *vma, |
23 | unsigned long addr); | 23 | unsigned long addr); |
24 | 24 | ||
25 | #ifdef CONFIG_SMP | ||
26 | extern void flush_tlb_all(void); | ||
27 | extern void flush_tlb_mm(struct mm_struct *mm); | ||
28 | extern void flush_tlb_page(struct vm_area_struct *vma, | ||
29 | unsigned long addr); | ||
30 | #else | ||
31 | #define flush_tlb_all __flush_tlb_all | 25 | #define flush_tlb_all __flush_tlb_all |
32 | #define flush_tlb_mm __flush_tlb_mm | 26 | #define flush_tlb_mm __flush_tlb_mm |
33 | #define flush_tlb_page __flush_tlb_page | 27 | #define flush_tlb_page __flush_tlb_page |
34 | #endif | ||
35 | 28 | ||
36 | static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end) | 29 | static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end) |
37 | { | 30 | { |
diff --git a/arch/cris/include/asm/topology.h b/arch/cris/include/asm/topology.h deleted file mode 100644 index 2ac613d32a89..000000000000 --- a/arch/cris/include/asm/topology.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_CRIS_TOPOLOGY_H | ||
2 | #define _ASM_CRIS_TOPOLOGY_H | ||
3 | |||
4 | #include <asm-generic/topology.h> | ||
5 | |||
6 | #endif /* _ASM_CRIS_TOPOLOGY_H */ | ||