diff options
Diffstat (limited to 'arch/avr32/include')
-rw-r--r-- | arch/avr32/include/asm/atomic.h | 2 | ||||
-rw-r--r-- | arch/avr32/include/asm/barrier.h | 27 | ||||
-rw-r--r-- | arch/avr32/include/asm/bitops.h | 1 | ||||
-rw-r--r-- | arch/avr32/include/asm/bug.h | 5 | ||||
-rw-r--r-- | arch/avr32/include/asm/cmpxchg.h (renamed from arch/avr32/include/asm/system.h) | 79 | ||||
-rw-r--r-- | arch/avr32/include/asm/exec.h | 13 | ||||
-rw-r--r-- | arch/avr32/include/asm/special_insns.h | 13 | ||||
-rw-r--r-- | arch/avr32/include/asm/switch_to.h | 46 |
8 files changed, 114 insertions, 72 deletions
diff --git a/arch/avr32/include/asm/atomic.h b/arch/avr32/include/asm/atomic.h index e0ac2631c87e..61407279208a 100644 --- a/arch/avr32/include/asm/atomic.h +++ b/arch/avr32/include/asm/atomic.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #define __ASM_AVR32_ATOMIC_H | 15 | #define __ASM_AVR32_ATOMIC_H |
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <asm/system.h> | 18 | #include <asm/cmpxchg.h> |
19 | 19 | ||
20 | #define ATOMIC_INIT(i) { (i) } | 20 | #define ATOMIC_INIT(i) { (i) } |
21 | 21 | ||
diff --git a/arch/avr32/include/asm/barrier.h b/arch/avr32/include/asm/barrier.h new file mode 100644 index 000000000000..808001c9cf8c --- /dev/null +++ b/arch/avr32/include/asm/barrier.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_AVR32_BARRIER_H | ||
9 | #define __ASM_AVR32_BARRIER_H | ||
10 | |||
11 | #define mb() asm volatile("" : : : "memory") | ||
12 | #define rmb() mb() | ||
13 | #define wmb() asm volatile("sync 0" : : : "memory") | ||
14 | #define read_barrier_depends() do { } while(0) | ||
15 | #define set_mb(var, value) do { var = value; mb(); } while(0) | ||
16 | |||
17 | #ifdef CONFIG_SMP | ||
18 | # error "The AVR32 port does not support SMP" | ||
19 | #else | ||
20 | # define smp_mb() barrier() | ||
21 | # define smp_rmb() barrier() | ||
22 | # define smp_wmb() barrier() | ||
23 | # define smp_read_barrier_depends() do { } while(0) | ||
24 | #endif | ||
25 | |||
26 | |||
27 | #endif /* __ASM_AVR32_BARRIER_H */ | ||
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h index b70c19bab63a..ebe7ad3f490b 100644 --- a/arch/avr32/include/asm/bitops.h +++ b/arch/avr32/include/asm/bitops.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #include <asm/byteorder.h> | 15 | #include <asm/byteorder.h> |
16 | #include <asm/system.h> | ||
17 | 16 | ||
18 | /* | 17 | /* |
19 | * clear_bit() doesn't provide any barrier for the compiler | 18 | * clear_bit() doesn't provide any barrier for the compiler |
diff --git a/arch/avr32/include/asm/bug.h b/arch/avr32/include/asm/bug.h index 2aa373cc61b5..85a92d099adb 100644 --- a/arch/avr32/include/asm/bug.h +++ b/arch/avr32/include/asm/bug.h | |||
@@ -70,4 +70,9 @@ | |||
70 | 70 | ||
71 | #include <asm-generic/bug.h> | 71 | #include <asm-generic/bug.h> |
72 | 72 | ||
73 | struct pt_regs; | ||
74 | void die(const char *str, struct pt_regs *regs, long err); | ||
75 | void _exception(long signr, struct pt_regs *regs, int code, | ||
76 | unsigned long addr); | ||
77 | |||
73 | #endif /* __ASM_AVR32_BUG_H */ | 78 | #endif /* __ASM_AVR32_BUG_H */ |
diff --git a/arch/avr32/include/asm/system.h b/arch/avr32/include/asm/cmpxchg.h index 62d9ded01635..962a6aeab787 100644 --- a/arch/avr32/include/asm/system.h +++ b/arch/avr32/include/asm/cmpxchg.h | |||
@@ -1,76 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * Atomic operations that C can't guarantee us. Useful for | ||
3 | * resource counting etc. | ||
4 | * | ||
5 | * But use these as seldom as possible since they are slower than | ||
6 | * regular operations. | ||
7 | * | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | 8 | * Copyright (C) 2004-2006 Atmel Corporation |
3 | * | 9 | * |
4 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
7 | */ | 13 | */ |
8 | #ifndef __ASM_AVR32_SYSTEM_H | 14 | #ifndef __ASM_AVR32_CMPXCHG_H |
9 | #define __ASM_AVR32_SYSTEM_H | 15 | #define __ASM_AVR32_CMPXCHG_H |
10 | |||
11 | #include <linux/compiler.h> | ||
12 | #include <linux/linkage.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | #include <asm/ptrace.h> | ||
16 | #include <asm/sysreg.h> | ||
17 | 16 | ||
18 | #define xchg(ptr,x) \ | 17 | #define xchg(ptr,x) \ |
19 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | 18 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) |
20 | 19 | ||
21 | #define nop() asm volatile("nop") | ||
22 | |||
23 | #define mb() asm volatile("" : : : "memory") | ||
24 | #define rmb() mb() | ||
25 | #define wmb() asm volatile("sync 0" : : : "memory") | ||
26 | #define read_barrier_depends() do { } while(0) | ||
27 | #define set_mb(var, value) do { var = value; mb(); } while(0) | ||
28 | |||
29 | /* | ||
30 | * Help PathFinder and other Nexus-compliant debuggers keep track of | ||
31 | * the current PID by emitting an Ownership Trace Message each time we | ||
32 | * switch task. | ||
33 | */ | ||
34 | #ifdef CONFIG_OWNERSHIP_TRACE | ||
35 | #include <asm/ocd.h> | ||
36 | #define finish_arch_switch(prev) \ | ||
37 | do { \ | ||
38 | ocd_write(PID, prev->pid); \ | ||
39 | ocd_write(PID, current->pid); \ | ||
40 | } while(0) | ||
41 | #endif | ||
42 | |||
43 | /* | ||
44 | * switch_to(prev, next, last) should switch from task `prev' to task | ||
45 | * `next'. `prev' will never be the same as `next'. | ||
46 | * | ||
47 | * We just delegate everything to the __switch_to assembly function, | ||
48 | * which is implemented in arch/avr32/kernel/switch_to.S | ||
49 | * | ||
50 | * mb() tells GCC not to cache `current' across this call. | ||
51 | */ | ||
52 | struct cpu_context; | ||
53 | struct task_struct; | ||
54 | extern struct task_struct *__switch_to(struct task_struct *, | ||
55 | struct cpu_context *, | ||
56 | struct cpu_context *); | ||
57 | #define switch_to(prev, next, last) \ | ||
58 | do { \ | ||
59 | last = __switch_to(prev, &prev->thread.cpu_context + 1, \ | ||
60 | &next->thread.cpu_context); \ | ||
61 | } while (0) | ||
62 | |||
63 | #ifdef CONFIG_SMP | ||
64 | # error "The AVR32 port does not support SMP" | ||
65 | #else | ||
66 | # define smp_mb() barrier() | ||
67 | # define smp_rmb() barrier() | ||
68 | # define smp_wmb() barrier() | ||
69 | # define smp_read_barrier_depends() do { } while(0) | ||
70 | #endif | ||
71 | |||
72 | #include <linux/irqflags.h> | ||
73 | |||
74 | extern void __xchg_called_with_bad_pointer(void); | 20 | extern void __xchg_called_with_bad_pointer(void); |
75 | 21 | ||
76 | static inline unsigned long xchg_u32(u32 val, volatile u32 *m) | 22 | static inline unsigned long xchg_u32(u32 val, volatile u32 *m) |
@@ -168,11 +114,4 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, | |||
168 | 114 | ||
169 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | 115 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) |
170 | 116 | ||
171 | struct pt_regs; | 117 | #endif /* __ASM_AVR32_CMPXCHG_H */ |
172 | void die(const char *str, struct pt_regs *regs, long err); | ||
173 | void _exception(long signr, struct pt_regs *regs, int code, | ||
174 | unsigned long addr); | ||
175 | |||
176 | #define arch_align_stack(x) (x) | ||
177 | |||
178 | #endif /* __ASM_AVR32_SYSTEM_H */ | ||
diff --git a/arch/avr32/include/asm/exec.h b/arch/avr32/include/asm/exec.h new file mode 100644 index 000000000000..f467be8bf823 --- /dev/null +++ b/arch/avr32/include/asm/exec.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_AVR32_EXEC_H | ||
9 | #define __ASM_AVR32_EXEC_H | ||
10 | |||
11 | #define arch_align_stack(x) (x) | ||
12 | |||
13 | #endif /* __ASM_AVR32_EXEC_H */ | ||
diff --git a/arch/avr32/include/asm/special_insns.h b/arch/avr32/include/asm/special_insns.h new file mode 100644 index 000000000000..f922218dfaa5 --- /dev/null +++ b/arch/avr32/include/asm/special_insns.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_AVR32_SPECIAL_INSNS_H | ||
9 | #define __ASM_AVR32_SPECIAL_INSNS_H | ||
10 | |||
11 | #define nop() asm volatile("nop") | ||
12 | |||
13 | #endif /* __ASM_AVR32_SPECIAL_INSNS_H */ | ||
diff --git a/arch/avr32/include/asm/switch_to.h b/arch/avr32/include/asm/switch_to.h new file mode 100644 index 000000000000..9a8e9d5208d4 --- /dev/null +++ b/arch/avr32/include/asm/switch_to.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_AVR32_SWITCH_TO_H | ||
9 | #define __ASM_AVR32_SWITCH_TO_H | ||
10 | |||
11 | /* | ||
12 | * Help PathFinder and other Nexus-compliant debuggers keep track of | ||
13 | * the current PID by emitting an Ownership Trace Message each time we | ||
14 | * switch task. | ||
15 | */ | ||
16 | #ifdef CONFIG_OWNERSHIP_TRACE | ||
17 | #include <asm/ocd.h> | ||
18 | #define finish_arch_switch(prev) \ | ||
19 | do { \ | ||
20 | ocd_write(PID, prev->pid); \ | ||
21 | ocd_write(PID, current->pid); \ | ||
22 | } while(0) | ||
23 | #endif | ||
24 | |||
25 | /* | ||
26 | * switch_to(prev, next, last) should switch from task `prev' to task | ||
27 | * `next'. `prev' will never be the same as `next'. | ||
28 | * | ||
29 | * We just delegate everything to the __switch_to assembly function, | ||
30 | * which is implemented in arch/avr32/kernel/switch_to.S | ||
31 | * | ||
32 | * mb() tells GCC not to cache `current' across this call. | ||
33 | */ | ||
34 | struct cpu_context; | ||
35 | struct task_struct; | ||
36 | extern struct task_struct *__switch_to(struct task_struct *, | ||
37 | struct cpu_context *, | ||
38 | struct cpu_context *); | ||
39 | #define switch_to(prev, next, last) \ | ||
40 | do { \ | ||
41 | last = __switch_to(prev, &prev->thread.cpu_context + 1, \ | ||
42 | &next->thread.cpu_context); \ | ||
43 | } while (0) | ||
44 | |||
45 | |||
46 | #endif /* __ASM_AVR32_SWITCH_TO_H */ | ||