diff options
Diffstat (limited to 'arch/xtensa')
82 files changed, 1677 insertions, 1620 deletions
diff --git a/arch/xtensa/boot/boot-redboot/bootstrap.S b/arch/xtensa/boot/boot-redboot/bootstrap.S index 4c316cd28a54..86c34dbc9cd0 100644 --- a/arch/xtensa/boot/boot-redboot/bootstrap.S +++ b/arch/xtensa/boot/boot-redboot/bootstrap.S | |||
@@ -51,17 +51,17 @@ _start: | |||
51 | /* 'reset' window registers */ | 51 | /* 'reset' window registers */ |
52 | 52 | ||
53 | movi a4, 1 | 53 | movi a4, 1 |
54 | wsr a4, PS | 54 | wsr a4, ps |
55 | rsync | 55 | rsync |
56 | 56 | ||
57 | rsr a5, WINDOWBASE | 57 | rsr a5, windowbase |
58 | ssl a5 | 58 | ssl a5 |
59 | sll a4, a4 | 59 | sll a4, a4 |
60 | wsr a4, WINDOWSTART | 60 | wsr a4, windowstart |
61 | rsync | 61 | rsync |
62 | 62 | ||
63 | movi a4, 0x00040000 | 63 | movi a4, 0x00040000 |
64 | wsr a4, PS | 64 | wsr a4, ps |
65 | rsync | 65 | rsync |
66 | 66 | ||
67 | /* copy the loader to its address | 67 | /* copy the loader to its address |
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index fccd81eddff1..6d1302789995 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild | |||
@@ -1,4 +1,28 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | generic-y += bitsperlong.h |
2 | 2 | generic-y += bug.h | |
3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
4 | generic-y += cputime.h | ||
5 | generic-y += device.h | ||
6 | generic-y += div64.h | ||
7 | generic-y += emergency-restart.h | ||
8 | generic-y += errno.h | ||
4 | generic-y += exec.h | 9 | generic-y += exec.h |
10 | generic-y += fcntl.h | ||
11 | generic-y += futex.h | ||
12 | generic-y += hardirq.h | ||
13 | generic-y += ioctl.h | ||
14 | generic-y += irq_regs.h | ||
15 | generic-y += kdebug.h | ||
16 | generic-y += kmap_types.h | ||
17 | generic-y += kvm_para.h | ||
18 | generic-y += local.h | ||
19 | generic-y += local64.h | ||
20 | generic-y += percpu.h | ||
21 | generic-y += resource.h | ||
22 | generic-y += scatterlist.h | ||
23 | generic-y += sections.h | ||
24 | generic-y += siginfo.h | ||
25 | generic-y += statfs.h | ||
26 | generic-y += termios.h | ||
27 | generic-y += topology.h | ||
28 | generic-y += xor.h | ||
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h index b40989308775..24f50cada70c 100644 --- a/arch/xtensa/include/asm/atomic.h +++ b/arch/xtensa/include/asm/atomic.h | |||
@@ -73,7 +73,7 @@ static inline void atomic_add(int i, atomic_t * v) | |||
73 | "l32i %0, %2, 0 \n\t" | 73 | "l32i %0, %2, 0 \n\t" |
74 | "add %0, %0, %1 \n\t" | 74 | "add %0, %0, %1 \n\t" |
75 | "s32i %0, %2, 0 \n\t" | 75 | "s32i %0, %2, 0 \n\t" |
76 | "wsr a15, "__stringify(PS)" \n\t" | 76 | "wsr a15, ps \n\t" |
77 | "rsync \n" | 77 | "rsync \n" |
78 | : "=&a" (vval) | 78 | : "=&a" (vval) |
79 | : "a" (i), "a" (v) | 79 | : "a" (i), "a" (v) |
@@ -97,7 +97,7 @@ static inline void atomic_sub(int i, atomic_t *v) | |||
97 | "l32i %0, %2, 0 \n\t" | 97 | "l32i %0, %2, 0 \n\t" |
98 | "sub %0, %0, %1 \n\t" | 98 | "sub %0, %0, %1 \n\t" |
99 | "s32i %0, %2, 0 \n\t" | 99 | "s32i %0, %2, 0 \n\t" |
100 | "wsr a15, "__stringify(PS)" \n\t" | 100 | "wsr a15, ps \n\t" |
101 | "rsync \n" | 101 | "rsync \n" |
102 | : "=&a" (vval) | 102 | : "=&a" (vval) |
103 | : "a" (i), "a" (v) | 103 | : "a" (i), "a" (v) |
@@ -118,7 +118,7 @@ static inline int atomic_add_return(int i, atomic_t * v) | |||
118 | "l32i %0, %2, 0 \n\t" | 118 | "l32i %0, %2, 0 \n\t" |
119 | "add %0, %0, %1 \n\t" | 119 | "add %0, %0, %1 \n\t" |
120 | "s32i %0, %2, 0 \n\t" | 120 | "s32i %0, %2, 0 \n\t" |
121 | "wsr a15, "__stringify(PS)" \n\t" | 121 | "wsr a15, ps \n\t" |
122 | "rsync \n" | 122 | "rsync \n" |
123 | : "=&a" (vval) | 123 | : "=&a" (vval) |
124 | : "a" (i), "a" (v) | 124 | : "a" (i), "a" (v) |
@@ -137,7 +137,7 @@ static inline int atomic_sub_return(int i, atomic_t * v) | |||
137 | "l32i %0, %2, 0 \n\t" | 137 | "l32i %0, %2, 0 \n\t" |
138 | "sub %0, %0, %1 \n\t" | 138 | "sub %0, %0, %1 \n\t" |
139 | "s32i %0, %2, 0 \n\t" | 139 | "s32i %0, %2, 0 \n\t" |
140 | "wsr a15, "__stringify(PS)" \n\t" | 140 | "wsr a15, ps \n\t" |
141 | "rsync \n" | 141 | "rsync \n" |
142 | : "=&a" (vval) | 142 | : "=&a" (vval) |
143 | : "a" (i), "a" (v) | 143 | : "a" (i), "a" (v) |
@@ -260,7 +260,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) | |||
260 | "xor %1, %4, %3 \n\t" | 260 | "xor %1, %4, %3 \n\t" |
261 | "and %0, %0, %4 \n\t" | 261 | "and %0, %0, %4 \n\t" |
262 | "s32i %0, %2, 0 \n\t" | 262 | "s32i %0, %2, 0 \n\t" |
263 | "wsr a15, "__stringify(PS)" \n\t" | 263 | "wsr a15, ps \n\t" |
264 | "rsync \n" | 264 | "rsync \n" |
265 | : "=&a" (vval), "=a" (mask) | 265 | : "=&a" (vval), "=a" (mask) |
266 | : "a" (v), "a" (all_f), "1" (mask) | 266 | : "a" (v), "a" (all_f), "1" (mask) |
@@ -277,7 +277,7 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v) | |||
277 | "l32i %0, %2, 0 \n\t" | 277 | "l32i %0, %2, 0 \n\t" |
278 | "or %0, %0, %1 \n\t" | 278 | "or %0, %0, %1 \n\t" |
279 | "s32i %0, %2, 0 \n\t" | 279 | "s32i %0, %2, 0 \n\t" |
280 | "wsr a15, "__stringify(PS)" \n\t" | 280 | "wsr a15, ps \n\t" |
281 | "rsync \n" | 281 | "rsync \n" |
282 | : "=&a" (vval) | 282 | : "=&a" (vval) |
283 | : "a" (mask), "a" (v) | 283 | : "a" (mask), "a" (v) |
diff --git a/arch/xtensa/include/asm/bitsperlong.h b/arch/xtensa/include/asm/bitsperlong.h deleted file mode 100644 index 6dc0bb0c13b2..000000000000 --- a/arch/xtensa/include/asm/bitsperlong.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/bitsperlong.h> | ||
diff --git a/arch/xtensa/include/asm/bug.h b/arch/xtensa/include/asm/bug.h deleted file mode 100644 index 3e52d72712f1..000000000000 --- a/arch/xtensa/include/asm/bug.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/bug.h | ||
3 | * | ||
4 | * Macros to cause a 'bug' message. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_BUG_H | ||
14 | #define _XTENSA_BUG_H | ||
15 | |||
16 | #include <asm-generic/bug.h> | ||
17 | |||
18 | #endif /* _XTENSA_BUG_H */ | ||
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h index 376cd9d5f455..569fec4f9a20 100644 --- a/arch/xtensa/include/asm/cacheflush.h +++ b/arch/xtensa/include/asm/cacheflush.h | |||
@@ -165,7 +165,7 @@ extern void copy_from_user_page(struct vm_area_struct*, struct page*, | |||
165 | static inline u32 xtensa_get_cacheattr(void) | 165 | static inline u32 xtensa_get_cacheattr(void) |
166 | { | 166 | { |
167 | u32 r; | 167 | u32 r; |
168 | asm volatile(" rsr %0, CACHEATTR" : "=a"(r)); | 168 | asm volatile(" rsr %0, cacheattr" : "=a"(r)); |
169 | return r; | 169 | return r; |
170 | } | 170 | } |
171 | 171 | ||
diff --git a/arch/xtensa/include/asm/cmpxchg.h b/arch/xtensa/include/asm/cmpxchg.h index e32149063d83..64dad04a9d27 100644 --- a/arch/xtensa/include/asm/cmpxchg.h +++ b/arch/xtensa/include/asm/cmpxchg.h | |||
@@ -27,7 +27,7 @@ __cmpxchg_u32(volatile int *p, int old, int new) | |||
27 | "bne %0, %2, 1f \n\t" | 27 | "bne %0, %2, 1f \n\t" |
28 | "s32i %3, %1, 0 \n\t" | 28 | "s32i %3, %1, 0 \n\t" |
29 | "1: \n\t" | 29 | "1: \n\t" |
30 | "wsr a15, "__stringify(PS)" \n\t" | 30 | "wsr a15, ps \n\t" |
31 | "rsync \n\t" | 31 | "rsync \n\t" |
32 | : "=&a" (old) | 32 | : "=&a" (old) |
33 | : "a" (p), "a" (old), "r" (new) | 33 | : "a" (p), "a" (old), "r" (new) |
@@ -97,7 +97,7 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val) | |||
97 | __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" | 97 | __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" |
98 | "l32i %0, %1, 0 \n\t" | 98 | "l32i %0, %1, 0 \n\t" |
99 | "s32i %2, %1, 0 \n\t" | 99 | "s32i %2, %1, 0 \n\t" |
100 | "wsr a15, "__stringify(PS)" \n\t" | 100 | "wsr a15, ps \n\t" |
101 | "rsync \n\t" | 101 | "rsync \n\t" |
102 | : "=&a" (tmp) | 102 | : "=&a" (tmp) |
103 | : "a" (m), "a" (val) | 103 | : "a" (m), "a" (val) |
diff --git a/arch/xtensa/include/asm/coprocessor.h b/arch/xtensa/include/asm/coprocessor.h index 75c94a1658b0..677501b32dfc 100644 --- a/arch/xtensa/include/asm/coprocessor.h +++ b/arch/xtensa/include/asm/coprocessor.h | |||
@@ -94,11 +94,10 @@ | |||
94 | #if XCHAL_HAVE_CP | 94 | #if XCHAL_HAVE_CP |
95 | 95 | ||
96 | #define RSR_CPENABLE(x) do { \ | 96 | #define RSR_CPENABLE(x) do { \ |
97 | __asm__ __volatile__("rsr %0," __stringify(CPENABLE) : "=a" (x)); \ | 97 | __asm__ __volatile__("rsr %0, cpenable" : "=a" (x)); \ |
98 | } while(0); | 98 | } while(0); |
99 | #define WSR_CPENABLE(x) do { \ | 99 | #define WSR_CPENABLE(x) do { \ |
100 | __asm__ __volatile__("wsr %0," __stringify(CPENABLE) "; rsync" \ | 100 | __asm__ __volatile__("wsr %0, cpenable; rsync" :: "a" (x)); \ |
101 | :: "a" (x)); \ | ||
102 | } while(0); | 101 | } while(0); |
103 | 102 | ||
104 | #endif /* XCHAL_HAVE_CP */ | 103 | #endif /* XCHAL_HAVE_CP */ |
diff --git a/arch/xtensa/include/asm/cputime.h b/arch/xtensa/include/asm/cputime.h deleted file mode 100644 index a7fb864a50ae..000000000000 --- a/arch/xtensa/include/asm/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _XTENSA_CPUTIME_H | ||
2 | #define _XTENSA_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* _XTENSA_CPUTIME_H */ | ||
diff --git a/arch/xtensa/include/asm/delay.h b/arch/xtensa/include/asm/delay.h index e1d8c9e010c1..58c0a4fd4003 100644 --- a/arch/xtensa/include/asm/delay.h +++ b/arch/xtensa/include/asm/delay.h | |||
@@ -27,7 +27,7 @@ static inline void __delay(unsigned long loops) | |||
27 | static __inline__ u32 xtensa_get_ccount(void) | 27 | static __inline__ u32 xtensa_get_ccount(void) |
28 | { | 28 | { |
29 | u32 ccount; | 29 | u32 ccount; |
30 | asm volatile ("rsr %0, 234; # CCOUNT\n" : "=r" (ccount)); | 30 | asm volatile ("rsr %0, ccount\n" : "=r" (ccount)); |
31 | return ccount; | 31 | return ccount; |
32 | } | 32 | } |
33 | 33 | ||
diff --git a/arch/xtensa/include/asm/device.h b/arch/xtensa/include/asm/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/arch/xtensa/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/xtensa/include/asm/div64.h b/arch/xtensa/include/asm/div64.h deleted file mode 100644 index f35678cb0a9b..000000000000 --- a/arch/xtensa/include/asm/div64.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/div64.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2007 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_DIV64_H | ||
12 | #define _XTENSA_DIV64_H | ||
13 | |||
14 | #include <asm-generic/div64.h> | ||
15 | |||
16 | #endif /* _XTENSA_DIV64_H */ | ||
diff --git a/arch/xtensa/include/asm/emergency-restart.h b/arch/xtensa/include/asm/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/arch/xtensa/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/xtensa/include/asm/errno.h b/arch/xtensa/include/asm/errno.h deleted file mode 100644 index a0f3b96b79b4..000000000000 --- a/arch/xtensa/include/asm/errno.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/errno.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_ERRNO_H | ||
12 | #define _XTENSA_ERRNO_H | ||
13 | |||
14 | #include <asm-generic/errno.h> | ||
15 | |||
16 | #endif /* _XTENSA_ERRNO_H */ | ||
diff --git a/arch/xtensa/include/asm/fcntl.h b/arch/xtensa/include/asm/fcntl.h deleted file mode 100644 index 46ab12db5739..000000000000 --- a/arch/xtensa/include/asm/fcntl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/fcntl.h> | ||
diff --git a/arch/xtensa/include/asm/futex.h b/arch/xtensa/include/asm/futex.h deleted file mode 100644 index 0b745828f42b..000000000000 --- a/arch/xtensa/include/asm/futex.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/futex.h> | ||
diff --git a/arch/xtensa/include/asm/hardirq.h b/arch/xtensa/include/asm/hardirq.h deleted file mode 100644 index 91695a135498..000000000000 --- a/arch/xtensa/include/asm/hardirq.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/hardirq.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_HARDIRQ_H | ||
12 | #define _XTENSA_HARDIRQ_H | ||
13 | |||
14 | #include <asm-generic/hardirq.h> | ||
15 | |||
16 | #endif /* _XTENSA_HARDIRQ_H */ | ||
diff --git a/arch/xtensa/include/asm/ioctl.h b/arch/xtensa/include/asm/ioctl.h deleted file mode 100644 index b279fe06dfe5..000000000000 --- a/arch/xtensa/include/asm/ioctl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ioctl.h> | ||
diff --git a/arch/xtensa/include/asm/irq_regs.h b/arch/xtensa/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/xtensa/include/asm/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/arch/xtensa/include/asm/irqflags.h b/arch/xtensa/include/asm/irqflags.h index dae9a8bdcb17..f865b1c1eae4 100644 --- a/arch/xtensa/include/asm/irqflags.h +++ b/arch/xtensa/include/asm/irqflags.h | |||
@@ -16,7 +16,7 @@ | |||
16 | static inline unsigned long arch_local_save_flags(void) | 16 | static inline unsigned long arch_local_save_flags(void) |
17 | { | 17 | { |
18 | unsigned long flags; | 18 | unsigned long flags; |
19 | asm volatile("rsr %0,"__stringify(PS) : "=a" (flags)); | 19 | asm volatile("rsr %0, ps" : "=a" (flags)); |
20 | return flags; | 20 | return flags; |
21 | } | 21 | } |
22 | 22 | ||
@@ -41,7 +41,7 @@ static inline void arch_local_irq_enable(void) | |||
41 | 41 | ||
42 | static inline void arch_local_irq_restore(unsigned long flags) | 42 | static inline void arch_local_irq_restore(unsigned long flags) |
43 | { | 43 | { |
44 | asm volatile("wsr %0, "__stringify(PS)" ; rsync" | 44 | asm volatile("wsr %0, ps; rsync" |
45 | :: "a" (flags) : "memory"); | 45 | :: "a" (flags) : "memory"); |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/arch/xtensa/include/asm/kdebug.h b/arch/xtensa/include/asm/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/arch/xtensa/include/asm/kdebug.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kdebug.h> | ||
diff --git a/arch/xtensa/include/asm/kmap_types.h b/arch/xtensa/include/asm/kmap_types.h deleted file mode 100644 index 11c687e527f1..000000000000 --- a/arch/xtensa/include/asm/kmap_types.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _XTENSA_KMAP_TYPES_H | ||
2 | #define _XTENSA_KMAP_TYPES_H | ||
3 | |||
4 | #include <asm-generic/kmap_types.h> | ||
5 | |||
6 | #endif /* _XTENSA_KMAP_TYPES_H */ | ||
diff --git a/arch/xtensa/include/asm/kvm_para.h b/arch/xtensa/include/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b957..000000000000 --- a/arch/xtensa/include/asm/kvm_para.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kvm_para.h> | ||
diff --git a/arch/xtensa/include/asm/local.h b/arch/xtensa/include/asm/local.h deleted file mode 100644 index 48723e550d14..000000000000 --- a/arch/xtensa/include/asm/local.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/local.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_LOCAL_H | ||
12 | #define _XTENSA_LOCAL_H | ||
13 | |||
14 | #include <asm-generic/local.h> | ||
15 | |||
16 | #endif /* _XTENSA_LOCAL_H */ | ||
diff --git a/arch/xtensa/include/asm/local64.h b/arch/xtensa/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/xtensa/include/asm/local64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/local64.h> | ||
diff --git a/arch/xtensa/include/asm/mmu_context.h b/arch/xtensa/include/asm/mmu_context.h index dbd8731a876a..feb10af96519 100644 --- a/arch/xtensa/include/asm/mmu_context.h +++ b/arch/xtensa/include/asm/mmu_context.h | |||
@@ -51,14 +51,14 @@ extern unsigned long asid_cache; | |||
51 | 51 | ||
52 | static inline void set_rasid_register (unsigned long val) | 52 | static inline void set_rasid_register (unsigned long val) |
53 | { | 53 | { |
54 | __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t" | 54 | __asm__ __volatile__ (" wsr %0, rasid\n\t" |
55 | " isync\n" : : "a" (val)); | 55 | " isync\n" : : "a" (val)); |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline unsigned long get_rasid_register (void) | 58 | static inline unsigned long get_rasid_register (void) |
59 | { | 59 | { |
60 | unsigned long tmp; | 60 | unsigned long tmp; |
61 | __asm__ __volatile__ (" rsr %0,"__stringify(RASID)"\n\t" : "=a" (tmp)); | 61 | __asm__ __volatile__ (" rsr %0, rasid\n\t" : "=a" (tmp)); |
62 | return tmp; | 62 | return tmp; |
63 | } | 63 | } |
64 | 64 | ||
diff --git a/arch/xtensa/include/asm/param.h b/arch/xtensa/include/asm/param.h index ba03d5aeab6b..0a70e780ef2a 100644 --- a/arch/xtensa/include/asm/param.h +++ b/arch/xtensa/include/asm/param.h | |||
@@ -7,28 +7,12 @@ | |||
7 | * | 7 | * |
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 8 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
9 | */ | 9 | */ |
10 | |||
11 | #ifndef _XTENSA_PARAM_H | 10 | #ifndef _XTENSA_PARAM_H |
12 | #define _XTENSA_PARAM_H | 11 | #define _XTENSA_PARAM_H |
13 | 12 | ||
14 | #ifdef __KERNEL__ | 13 | #include <uapi/asm/param.h> |
14 | |||
15 | # define HZ CONFIG_HZ /* internal timer frequency */ | 15 | # define HZ CONFIG_HZ /* internal timer frequency */ |
16 | # define USER_HZ 100 /* for user interfaces in "ticks" */ | 16 | # define USER_HZ 100 /* for user interfaces in "ticks" */ |
17 | # define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */ | 17 | # define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */ |
18 | #else | ||
19 | # define HZ 100 | ||
20 | #endif | ||
21 | |||
22 | #define EXEC_PAGESIZE 4096 | ||
23 | |||
24 | #ifndef NGROUPS | ||
25 | #define NGROUPS 32 | ||
26 | #endif | ||
27 | |||
28 | #ifndef NOGROUP | ||
29 | #define NOGROUP (-1) | ||
30 | #endif | ||
31 | |||
32 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
33 | |||
34 | #endif /* _XTENSA_PARAM_H */ | 18 | #endif /* _XTENSA_PARAM_H */ |
diff --git a/arch/xtensa/include/asm/percpu.h b/arch/xtensa/include/asm/percpu.h deleted file mode 100644 index 6d2bc2ada9d1..000000000000 --- a/arch/xtensa/include/asm/percpu.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-xtensa/percpu.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_PERCPU__ | ||
12 | #define _XTENSA_PERCPU__ | ||
13 | |||
14 | #include <asm-generic/percpu.h> | ||
15 | |||
16 | #endif /* _XTENSA_PERCPU__ */ | ||
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h index d85d38da8eec..da21c17f23aa 100644 --- a/arch/xtensa/include/asm/ptrace.h +++ b/arch/xtensa/include/asm/ptrace.h | |||
@@ -7,73 +7,11 @@ | |||
7 | * | 7 | * |
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 8 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
9 | */ | 9 | */ |
10 | |||
11 | #ifndef _XTENSA_PTRACE_H | 10 | #ifndef _XTENSA_PTRACE_H |
12 | #define _XTENSA_PTRACE_H | 11 | #define _XTENSA_PTRACE_H |
13 | 12 | ||
14 | /* | 13 | #include <uapi/asm/ptrace.h> |
15 | * Kernel stack | ||
16 | * | ||
17 | * +-----------------------+ -------- STACK_SIZE | ||
18 | * | register file | | | ||
19 | * +-----------------------+ | | ||
20 | * | struct pt_regs | | | ||
21 | * +-----------------------+ | ------ PT_REGS_OFFSET | ||
22 | * double : 16 bytes spill area : | ^ | ||
23 | * excetion :- - - - - - - - - - - -: | | | ||
24 | * frame : struct pt_regs : | | | ||
25 | * :- - - - - - - - - - - -: | | | ||
26 | * | | | | | ||
27 | * | memory stack | | | | ||
28 | * | | | | | ||
29 | * ~ ~ ~ ~ | ||
30 | * ~ ~ ~ ~ | ||
31 | * | | | | | ||
32 | * | | | | | ||
33 | * +-----------------------+ | | --- STACK_BIAS | ||
34 | * | struct task_struct | | | ^ | ||
35 | * current --> +-----------------------+ | | | | ||
36 | * | struct thread_info | | | | | ||
37 | * +-----------------------+ -------- | ||
38 | */ | ||
39 | |||
40 | #define KERNEL_STACK_SIZE (2 * PAGE_SIZE) | ||
41 | |||
42 | /* Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */ | ||
43 | |||
44 | #define EXC_TABLE_KSTK 0x004 /* Kernel Stack */ | ||
45 | #define EXC_TABLE_DOUBLE_SAVE 0x008 /* Double exception save area for a0 */ | ||
46 | #define EXC_TABLE_FIXUP 0x00c /* Fixup handler */ | ||
47 | #define EXC_TABLE_PARAM 0x010 /* For passing a parameter to fixup */ | ||
48 | #define EXC_TABLE_SYSCALL_SAVE 0x014 /* For fast syscall handler */ | ||
49 | #define EXC_TABLE_FAST_USER 0x100 /* Fast user exception handler */ | ||
50 | #define EXC_TABLE_FAST_KERNEL 0x200 /* Fast kernel exception handler */ | ||
51 | #define EXC_TABLE_DEFAULT 0x300 /* Default C-Handler */ | ||
52 | #define EXC_TABLE_SIZE 0x400 | ||
53 | 14 | ||
54 | /* Registers used by strace */ | ||
55 | |||
56 | #define REG_A_BASE 0x0000 | ||
57 | #define REG_AR_BASE 0x0100 | ||
58 | #define REG_PC 0x0020 | ||
59 | #define REG_PS 0x02e6 | ||
60 | #define REG_WB 0x0248 | ||
61 | #define REG_WS 0x0249 | ||
62 | #define REG_LBEG 0x0200 | ||
63 | #define REG_LEND 0x0201 | ||
64 | #define REG_LCOUNT 0x0202 | ||
65 | #define REG_SAR 0x0203 | ||
66 | |||
67 | #define SYSCALL_NR 0x00ff | ||
68 | |||
69 | /* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */ | ||
70 | |||
71 | #define PTRACE_GETREGS 12 | ||
72 | #define PTRACE_SETREGS 13 | ||
73 | #define PTRACE_GETXTREGS 18 | ||
74 | #define PTRACE_SETXTREGS 19 | ||
75 | |||
76 | #ifdef __KERNEL__ | ||
77 | 15 | ||
78 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
79 | 17 | ||
@@ -132,6 +70,4 @@ struct pt_regs { | |||
132 | 70 | ||
133 | #endif /* !__ASSEMBLY__ */ | 71 | #endif /* !__ASSEMBLY__ */ |
134 | 72 | ||
135 | #endif /* __KERNEL__ */ | ||
136 | |||
137 | #endif /* _XTENSA_PTRACE_H */ | 73 | #endif /* _XTENSA_PTRACE_H */ |
diff --git a/arch/xtensa/include/asm/regs.h b/arch/xtensa/include/asm/regs.h index a3075b12aff1..8a8aa61ccc8d 100644 --- a/arch/xtensa/include/asm/regs.h +++ b/arch/xtensa/include/asm/regs.h | |||
@@ -27,52 +27,15 @@ | |||
27 | 27 | ||
28 | /* Special registers. */ | 28 | /* Special registers. */ |
29 | 29 | ||
30 | #define LBEG 0 | 30 | #define SREG_MR 32 |
31 | #define LEND 1 | 31 | #define SREG_IBREAKA 128 |
32 | #define LCOUNT 2 | 32 | #define SREG_DBREAKA 144 |
33 | #define SAR 3 | 33 | #define SREG_DBREAKC 160 |
34 | #define BR 4 | 34 | #define SREG_EPC 176 |
35 | #define SCOMPARE1 12 | 35 | #define SREG_EPS 192 |
36 | #define ACCHI 16 | 36 | #define SREG_EXCSAVE 208 |
37 | #define ACCLO 17 | 37 | #define SREG_CCOMPARE 240 |
38 | #define MR 32 | 38 | #define SREG_MISC 244 |
39 | #define WINDOWBASE 72 | ||
40 | #define WINDOWSTART 73 | ||
41 | #define PTEVADDR 83 | ||
42 | #define RASID 90 | ||
43 | #define ITLBCFG 91 | ||
44 | #define DTLBCFG 92 | ||
45 | #define IBREAKENABLE 96 | ||
46 | #define DDR 104 | ||
47 | #define IBREAKA 128 | ||
48 | #define DBREAKA 144 | ||
49 | #define DBREAKC 160 | ||
50 | #define EPC 176 | ||
51 | #define EPC_1 177 | ||
52 | #define DEPC 192 | ||
53 | #define EPS 192 | ||
54 | #define EPS_1 193 | ||
55 | #define EXCSAVE 208 | ||
56 | #define EXCSAVE_1 209 | ||
57 | #define INTERRUPT 226 | ||
58 | #define INTENABLE 228 | ||
59 | #define PS 230 | ||
60 | #define THREADPTR 231 | ||
61 | #define EXCCAUSE 232 | ||
62 | #define DEBUGCAUSE 233 | ||
63 | #define CCOUNT 234 | ||
64 | #define PRID 235 | ||
65 | #define ICOUNT 236 | ||
66 | #define ICOUNTLEVEL 237 | ||
67 | #define EXCVADDR 238 | ||
68 | #define CCOMPARE 240 | ||
69 | #define MISC_SR 244 | ||
70 | |||
71 | /* Special names for read-only and write-only interrupt registers. */ | ||
72 | |||
73 | #define INTREAD 226 | ||
74 | #define INTSET 226 | ||
75 | #define INTCLEAR 227 | ||
76 | 39 | ||
77 | /* EXCCAUSE register fields */ | 40 | /* EXCCAUSE register fields */ |
78 | 41 | ||
diff --git a/arch/xtensa/include/asm/resource.h b/arch/xtensa/include/asm/resource.h deleted file mode 100644 index 17b5ab311771..000000000000 --- a/arch/xtensa/include/asm/resource.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/resource.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_RESOURCE_H | ||
12 | #define _XTENSA_RESOURCE_H | ||
13 | |||
14 | #include <asm-generic/resource.h> | ||
15 | |||
16 | #endif /* _XTENSA_RESOURCE_H */ | ||
diff --git a/arch/xtensa/include/asm/scatterlist.h b/arch/xtensa/include/asm/scatterlist.h deleted file mode 100644 index a0421a61d9e1..000000000000 --- a/arch/xtensa/include/asm/scatterlist.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/scatterlist.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SCATTERLIST_H | ||
12 | #define _XTENSA_SCATTERLIST_H | ||
13 | |||
14 | #include <asm-generic/scatterlist.h> | ||
15 | |||
16 | #endif /* _XTENSA_SCATTERLIST_H */ | ||
diff --git a/arch/xtensa/include/asm/sections.h b/arch/xtensa/include/asm/sections.h deleted file mode 100644 index 40b5191b55a2..000000000000 --- a/arch/xtensa/include/asm/sections.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/sections.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SECTIONS_H | ||
12 | #define _XTENSA_SECTIONS_H | ||
13 | |||
14 | #include <asm-generic/sections.h> | ||
15 | |||
16 | #endif /* _XTENSA_SECTIONS_H */ | ||
diff --git a/arch/xtensa/include/asm/siginfo.h b/arch/xtensa/include/asm/siginfo.h deleted file mode 100644 index 6916248295df..000000000000 --- a/arch/xtensa/include/asm/siginfo.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/siginfo.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SIGINFO_H | ||
12 | #define _XTENSA_SIGINFO_H | ||
13 | |||
14 | #include <asm-generic/siginfo.h> | ||
15 | |||
16 | #endif /* _XTENSA_SIGINFO_H */ | ||
diff --git a/arch/xtensa/include/asm/signal.h b/arch/xtensa/include/asm/signal.h index 7f201b9d4195..72fd44c85b70 100644 --- a/arch/xtensa/include/asm/signal.h +++ b/arch/xtensa/include/asm/signal.h | |||
@@ -9,117 +9,12 @@ | |||
9 | * | 9 | * |
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 10 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
11 | */ | 11 | */ |
12 | |||
13 | #ifndef _XTENSA_SIGNAL_H | 12 | #ifndef _XTENSA_SIGNAL_H |
14 | #define _XTENSA_SIGNAL_H | 13 | #define _XTENSA_SIGNAL_H |
15 | 14 | ||
16 | 15 | #include <uapi/asm/signal.h> | |
17 | #define _NSIG 64 | ||
18 | #define _NSIG_BPW 32 | ||
19 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | /* Avoid too many header ordering problems. */ | ||
26 | struct siginfo; | ||
27 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
28 | typedef struct { | ||
29 | unsigned long sig[_NSIG_WORDS]; | ||
30 | } sigset_t; | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define SIGHUP 1 | ||
35 | #define SIGINT 2 | ||
36 | #define SIGQUIT 3 | ||
37 | #define SIGILL 4 | ||
38 | #define SIGTRAP 5 | ||
39 | #define SIGABRT 6 | ||
40 | #define SIGIOT 6 | ||
41 | #define SIGBUS 7 | ||
42 | #define SIGFPE 8 | ||
43 | #define SIGKILL 9 | ||
44 | #define SIGUSR1 10 | ||
45 | #define SIGSEGV 11 | ||
46 | #define SIGUSR2 12 | ||
47 | #define SIGPIPE 13 | ||
48 | #define SIGALRM 14 | ||
49 | #define SIGTERM 15 | ||
50 | #define SIGSTKFLT 16 | ||
51 | #define SIGCHLD 17 | ||
52 | #define SIGCONT 18 | ||
53 | #define SIGSTOP 19 | ||
54 | #define SIGTSTP 20 | ||
55 | #define SIGTTIN 21 | ||
56 | #define SIGTTOU 22 | ||
57 | #define SIGURG 23 | ||
58 | #define SIGXCPU 24 | ||
59 | #define SIGXFSZ 25 | ||
60 | #define SIGVTALRM 26 | ||
61 | #define SIGPROF 27 | ||
62 | #define SIGWINCH 28 | ||
63 | #define SIGIO 29 | ||
64 | #define SIGPOLL SIGIO | ||
65 | /* #define SIGLOST 29 */ | ||
66 | #define SIGPWR 30 | ||
67 | #define SIGSYS 31 | ||
68 | #define SIGUNUSED 31 | ||
69 | |||
70 | /* These should not be considered constants from userland. */ | ||
71 | #define SIGRTMIN 32 | ||
72 | #define SIGRTMAX (_NSIG-1) | ||
73 | |||
74 | /* | ||
75 | * SA_FLAGS values: | ||
76 | * | ||
77 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
80 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
81 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
82 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
83 | * | ||
84 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
85 | * Unix names RESETHAND and NODEFER respectively. | ||
86 | */ | ||
87 | #define SA_NOCLDSTOP 0x00000001 | ||
88 | #define SA_NOCLDWAIT 0x00000002 /* not supported yet */ | ||
89 | #define SA_SIGINFO 0x00000004 | ||
90 | #define SA_ONSTACK 0x08000000 | ||
91 | #define SA_RESTART 0x10000000 | ||
92 | #define SA_NODEFER 0x40000000 | ||
93 | #define SA_RESETHAND 0x80000000 | ||
94 | |||
95 | #define SA_NOMASK SA_NODEFER | ||
96 | #define SA_ONESHOT SA_RESETHAND | ||
97 | |||
98 | #define SA_RESTORER 0x04000000 | ||
99 | |||
100 | /* | ||
101 | * sigaltstack controls | ||
102 | */ | ||
103 | #define SS_ONSTACK 1 | ||
104 | #define SS_DISABLE 2 | ||
105 | |||
106 | #define MINSIGSTKSZ 2048 | ||
107 | #define SIGSTKSZ 8192 | ||
108 | 16 | ||
109 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
110 | |||
111 | #define SIG_BLOCK 0 /* for blocking signals */ | ||
112 | #define SIG_UNBLOCK 1 /* for unblocking signals */ | ||
113 | #define SIG_SETMASK 2 /* for setting the signal mask */ | ||
114 | |||
115 | /* Type of a signal handler. */ | ||
116 | typedef void (*__sighandler_t)(int); | ||
117 | |||
118 | #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ | ||
119 | #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ | ||
120 | #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ | ||
121 | |||
122 | #ifdef __KERNEL__ | ||
123 | struct sigaction { | 18 | struct sigaction { |
124 | __sighandler_t sa_handler; | 19 | __sighandler_t sa_handler; |
125 | unsigned long sa_flags; | 20 | unsigned long sa_flags; |
@@ -131,35 +26,8 @@ struct k_sigaction { | |||
131 | struct sigaction sa; | 26 | struct sigaction sa; |
132 | }; | 27 | }; |
133 | 28 | ||
134 | #else | ||
135 | |||
136 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
137 | |||
138 | struct sigaction { | ||
139 | union { | ||
140 | __sighandler_t _sa_handler; | ||
141 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
142 | } _u; | ||
143 | sigset_t sa_mask; | ||
144 | unsigned long sa_flags; | ||
145 | void (*sa_restorer)(void); | ||
146 | }; | ||
147 | |||
148 | #define sa_handler _u._sa_handler | ||
149 | #define sa_sigaction _u._sa_sigaction | ||
150 | |||
151 | #endif /* __KERNEL__ */ | ||
152 | |||
153 | typedef struct sigaltstack { | ||
154 | void *ss_sp; | ||
155 | int ss_flags; | ||
156 | size_t ss_size; | ||
157 | } stack_t; | ||
158 | |||
159 | #ifdef __KERNEL__ | ||
160 | #include <asm/sigcontext.h> | 29 | #include <asm/sigcontext.h> |
161 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | 30 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) |
162 | 31 | ||
163 | #endif /* __KERNEL__ */ | ||
164 | #endif /* __ASSEMBLY__ */ | 32 | #endif /* __ASSEMBLY__ */ |
165 | #endif /* _XTENSA_SIGNAL_H */ | 33 | #endif /* _XTENSA_SIGNAL_H */ |
diff --git a/arch/xtensa/include/asm/statfs.h b/arch/xtensa/include/asm/statfs.h deleted file mode 100644 index 9c3d1a213136..000000000000 --- a/arch/xtensa/include/asm/statfs.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/statfs.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_STATFS_H | ||
12 | #define _XTENSA_STATFS_H | ||
13 | |||
14 | #include <asm-generic/statfs.h> | ||
15 | |||
16 | #endif /* _XTENSA_STATFS_H */ | ||
17 | |||
diff --git a/arch/xtensa/include/asm/termios.h b/arch/xtensa/include/asm/termios.h deleted file mode 100644 index 4673f42f88a7..000000000000 --- a/arch/xtensa/include/asm/termios.h +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/termios.h | ||
3 | * | ||
4 | * Copied from SH. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_TERMIOS_H | ||
14 | #define _XTENSA_TERMIOS_H | ||
15 | |||
16 | #include <asm/termbits.h> | ||
17 | #include <asm/ioctls.h> | ||
18 | |||
19 | struct winsize { | ||
20 | unsigned short ws_row; | ||
21 | unsigned short ws_col; | ||
22 | unsigned short ws_xpixel; | ||
23 | unsigned short ws_ypixel; | ||
24 | }; | ||
25 | |||
26 | #define NCC 8 | ||
27 | struct termio { | ||
28 | unsigned short c_iflag; /* input mode flags */ | ||
29 | unsigned short c_oflag; /* output mode flags */ | ||
30 | unsigned short c_cflag; /* control mode flags */ | ||
31 | unsigned short c_lflag; /* local mode flags */ | ||
32 | unsigned char c_line; /* line discipline */ | ||
33 | unsigned char c_cc[NCC]; /* control characters */ | ||
34 | }; | ||
35 | |||
36 | /* Modem lines */ | ||
37 | |||
38 | #define TIOCM_LE 0x001 | ||
39 | #define TIOCM_DTR 0x002 | ||
40 | #define TIOCM_RTS 0x004 | ||
41 | #define TIOCM_ST 0x008 | ||
42 | #define TIOCM_SR 0x010 | ||
43 | #define TIOCM_CTS 0x020 | ||
44 | #define TIOCM_CAR 0x040 | ||
45 | #define TIOCM_RNG 0x080 | ||
46 | #define TIOCM_DSR 0x100 | ||
47 | #define TIOCM_CD TIOCM_CAR | ||
48 | #define TIOCM_RI TIOCM_RNG | ||
49 | #define TIOCM_OUT1 0x2000 | ||
50 | #define TIOCM_OUT2 0x4000 | ||
51 | #define TIOCM_LOOP 0x8000 | ||
52 | |||
53 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
54 | |||
55 | #ifdef __KERNEL__ | ||
56 | |||
57 | /* intr=^C quit=^\ erase=del kill=^U | ||
58 | eof=^D vtime=\0 vmin=\1 sxtc=\0 | ||
59 | start=^Q stop=^S susp=^Z eol=\0 | ||
60 | reprint=^R discard=^U werase=^W lnext=^V | ||
61 | eol2=\0 | ||
62 | */ | ||
63 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | ||
64 | |||
65 | /* | ||
66 | * Translate a "termio" structure into a "termios". Ugh. | ||
67 | */ | ||
68 | |||
69 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
70 | unsigned short __tmp; \ | ||
71 | get_user(__tmp,&(termio)->x); \ | ||
72 | *(unsigned short *) &(termios)->x = __tmp; \ | ||
73 | } | ||
74 | |||
75 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
76 | ({ \ | ||
77 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
78 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
79 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
80 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
81 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
82 | }) | ||
83 | |||
84 | /* | ||
85 | * Translate a "termios" structure into a "termio". Ugh. | ||
86 | */ | ||
87 | |||
88 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
89 | ({ \ | ||
90 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
91 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
92 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
93 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
94 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
95 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
96 | }) | ||
97 | |||
98 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) | ||
99 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) | ||
100 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
101 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
102 | |||
103 | #endif /* __KERNEL__ */ | ||
104 | |||
105 | #endif /* _XTENSA_TERMIOS_H */ | ||
diff --git a/arch/xtensa/include/asm/timex.h b/arch/xtensa/include/asm/timex.h index 053bc4272106..175b3d5e1b01 100644 --- a/arch/xtensa/include/asm/timex.h +++ b/arch/xtensa/include/asm/timex.h | |||
@@ -63,10 +63,10 @@ extern cycles_t cacheflush_time; | |||
63 | * Register access. | 63 | * Register access. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | #define WSR_CCOUNT(r) asm volatile ("wsr %0,"__stringify(CCOUNT) :: "a" (r)) | 66 | #define WSR_CCOUNT(r) asm volatile ("wsr %0, ccount" :: "a" (r)) |
67 | #define RSR_CCOUNT(r) asm volatile ("rsr %0,"__stringify(CCOUNT) : "=a" (r)) | 67 | #define RSR_CCOUNT(r) asm volatile ("rsr %0, ccount" : "=a" (r)) |
68 | #define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r)) | 68 | #define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) :: "a"(r)) |
69 | #define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r)) | 69 | #define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) : "=a"(r)) |
70 | 70 | ||
71 | static inline unsigned long get_ccount (void) | 71 | static inline unsigned long get_ccount (void) |
72 | { | 72 | { |
diff --git a/arch/xtensa/include/asm/tlbflush.h b/arch/xtensa/include/asm/tlbflush.h index 46d240074f74..43dd348a5a47 100644 --- a/arch/xtensa/include/asm/tlbflush.h +++ b/arch/xtensa/include/asm/tlbflush.h | |||
@@ -86,26 +86,26 @@ static inline void invalidate_dtlb_entry_no_isync (unsigned entry) | |||
86 | 86 | ||
87 | static inline void set_itlbcfg_register (unsigned long val) | 87 | static inline void set_itlbcfg_register (unsigned long val) |
88 | { | 88 | { |
89 | __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t" | 89 | __asm__ __volatile__("wsr %0, itlbcfg\n\t" "isync\n\t" |
90 | : : "a" (val)); | 90 | : : "a" (val)); |
91 | } | 91 | } |
92 | 92 | ||
93 | static inline void set_dtlbcfg_register (unsigned long val) | 93 | static inline void set_dtlbcfg_register (unsigned long val) |
94 | { | 94 | { |
95 | __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t" | 95 | __asm__ __volatile__("wsr %0, dtlbcfg; dsync\n\t" |
96 | : : "a" (val)); | 96 | : : "a" (val)); |
97 | } | 97 | } |
98 | 98 | ||
99 | static inline void set_ptevaddr_register (unsigned long val) | 99 | static inline void set_ptevaddr_register (unsigned long val) |
100 | { | 100 | { |
101 | __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n" | 101 | __asm__ __volatile__(" wsr %0, ptevaddr; isync\n" |
102 | : : "a" (val)); | 102 | : : "a" (val)); |
103 | } | 103 | } |
104 | 104 | ||
105 | static inline unsigned long read_ptevaddr_register (void) | 105 | static inline unsigned long read_ptevaddr_register (void) |
106 | { | 106 | { |
107 | unsigned long tmp; | 107 | unsigned long tmp; |
108 | __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp)); | 108 | __asm__ __volatile__("rsr %0, ptevaddr\n\t" : "=a" (tmp)); |
109 | return tmp; | 109 | return tmp; |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/arch/xtensa/include/asm/topology.h b/arch/xtensa/include/asm/topology.h deleted file mode 100644 index 7309e38a0ccb..000000000000 --- a/arch/xtensa/include/asm/topology.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/topology.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_TOPOLOGY_H | ||
12 | #define _XTENSA_TOPOLOGY_H | ||
13 | |||
14 | #include <asm-generic/topology.h> | ||
15 | |||
16 | #endif /* _XTENSA_TOPOLOGY_H */ | ||
diff --git a/arch/xtensa/include/asm/types.h b/arch/xtensa/include/asm/types.h index 6d4db7e8ffac..2b410b8c7f79 100644 --- a/arch/xtensa/include/asm/types.h +++ b/arch/xtensa/include/asm/types.h | |||
@@ -7,30 +7,17 @@ | |||
7 | * | 7 | * |
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 8 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
9 | */ | 9 | */ |
10 | |||
11 | #ifndef _XTENSA_TYPES_H | 10 | #ifndef _XTENSA_TYPES_H |
12 | #define _XTENSA_TYPES_H | 11 | #define _XTENSA_TYPES_H |
13 | 12 | ||
14 | #include <asm-generic/int-ll64.h> | 13 | #include <uapi/asm/types.h> |
15 | |||
16 | #ifdef __ASSEMBLY__ | ||
17 | # define __XTENSA_UL(x) (x) | ||
18 | # define __XTENSA_UL_CONST(x) x | ||
19 | #else | ||
20 | # define __XTENSA_UL(x) ((unsigned long)(x)) | ||
21 | # define __XTENSA_UL_CONST(x) x##UL | ||
22 | #endif | ||
23 | 14 | ||
24 | #ifndef __ASSEMBLY__ | 15 | #ifndef __ASSEMBLY__ |
25 | |||
26 | /* | 16 | /* |
27 | * These aren't exported outside the kernel to avoid name space clashes | 17 | * These aren't exported outside the kernel to avoid name space clashes |
28 | */ | 18 | */ |
29 | #ifdef __KERNEL__ | ||
30 | 19 | ||
31 | #define BITS_PER_LONG 32 | 20 | #define BITS_PER_LONG 32 |
32 | 21 | ||
33 | #endif /* __KERNEL__ */ | ||
34 | #endif | 22 | #endif |
35 | |||
36 | #endif /* _XTENSA_TYPES_H */ | 23 | #endif /* _XTENSA_TYPES_H */ |
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index bc7e005faa60..9ef1c31d2c83 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h | |||
@@ -8,705 +8,8 @@ | |||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 8 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef _XTENSA_UNISTD_H | 11 | #include <uapi/asm/unistd.h> |
12 | #define _XTENSA_UNISTD_H | ||
13 | 12 | ||
14 | #ifndef __SYSCALL | ||
15 | # define __SYSCALL(nr,func,nargs) | ||
16 | #endif | ||
17 | |||
18 | #define __NR_spill 0 | ||
19 | __SYSCALL( 0, sys_ni_syscall, 0) | ||
20 | #define __NR_xtensa 1 | ||
21 | __SYSCALL( 1, sys_ni_syscall, 0) | ||
22 | #define __NR_available4 2 | ||
23 | __SYSCALL( 2, sys_ni_syscall, 0) | ||
24 | #define __NR_available5 3 | ||
25 | __SYSCALL( 3, sys_ni_syscall, 0) | ||
26 | #define __NR_available6 4 | ||
27 | __SYSCALL( 4, sys_ni_syscall, 0) | ||
28 | #define __NR_available7 5 | ||
29 | __SYSCALL( 5, sys_ni_syscall, 0) | ||
30 | #define __NR_available8 6 | ||
31 | __SYSCALL( 6, sys_ni_syscall, 0) | ||
32 | #define __NR_available9 7 | ||
33 | __SYSCALL( 7, sys_ni_syscall, 0) | ||
34 | |||
35 | /* File Operations */ | ||
36 | |||
37 | #define __NR_open 8 | ||
38 | __SYSCALL( 8, sys_open, 3) | ||
39 | #define __NR_close 9 | ||
40 | __SYSCALL( 9, sys_close, 1) | ||
41 | #define __NR_dup 10 | ||
42 | __SYSCALL( 10, sys_dup, 1) | ||
43 | #define __NR_dup2 11 | ||
44 | __SYSCALL( 11, sys_dup2, 2) | ||
45 | #define __NR_read 12 | ||
46 | __SYSCALL( 12, sys_read, 3) | ||
47 | #define __NR_write 13 | ||
48 | __SYSCALL( 13, sys_write, 3) | ||
49 | #define __NR_select 14 | ||
50 | __SYSCALL( 14, sys_select, 5) | ||
51 | #define __NR_lseek 15 | ||
52 | __SYSCALL( 15, sys_lseek, 3) | ||
53 | #define __NR_poll 16 | ||
54 | __SYSCALL( 16, sys_poll, 3) | ||
55 | #define __NR__llseek 17 | ||
56 | __SYSCALL( 17, sys_llseek, 5) | ||
57 | #define __NR_epoll_wait 18 | ||
58 | __SYSCALL( 18, sys_epoll_wait, 4) | ||
59 | #define __NR_epoll_ctl 19 | ||
60 | __SYSCALL( 19, sys_epoll_ctl, 4) | ||
61 | #define __NR_epoll_create 20 | ||
62 | __SYSCALL( 20, sys_epoll_create, 1) | ||
63 | #define __NR_creat 21 | ||
64 | __SYSCALL( 21, sys_creat, 2) | ||
65 | #define __NR_truncate 22 | ||
66 | __SYSCALL( 22, sys_truncate, 2) | ||
67 | #define __NR_ftruncate 23 | ||
68 | __SYSCALL( 23, sys_ftruncate, 2) | ||
69 | #define __NR_readv 24 | ||
70 | __SYSCALL( 24, sys_readv, 3) | ||
71 | #define __NR_writev 25 | ||
72 | __SYSCALL( 25, sys_writev, 3) | ||
73 | #define __NR_fsync 26 | ||
74 | __SYSCALL( 26, sys_fsync, 1) | ||
75 | #define __NR_fdatasync 27 | ||
76 | __SYSCALL( 27, sys_fdatasync, 1) | ||
77 | #define __NR_truncate64 28 | ||
78 | __SYSCALL( 28, sys_truncate64, 2) | ||
79 | #define __NR_ftruncate64 29 | ||
80 | __SYSCALL( 29, sys_ftruncate64, 2) | ||
81 | #define __NR_pread64 30 | ||
82 | __SYSCALL( 30, sys_pread64, 6) | ||
83 | #define __NR_pwrite64 31 | ||
84 | __SYSCALL( 31, sys_pwrite64, 6) | ||
85 | |||
86 | #define __NR_link 32 | ||
87 | __SYSCALL( 32, sys_link, 2) | ||
88 | #define __NR_rename 33 | ||
89 | __SYSCALL( 33, sys_rename, 2) | ||
90 | #define __NR_symlink 34 | ||
91 | __SYSCALL( 34, sys_symlink, 2) | ||
92 | #define __NR_readlink 35 | ||
93 | __SYSCALL( 35, sys_readlink, 3) | ||
94 | #define __NR_mknod 36 | ||
95 | __SYSCALL( 36, sys_mknod, 3) | ||
96 | #define __NR_pipe 37 | ||
97 | __SYSCALL( 37, sys_pipe, 1) | ||
98 | #define __NR_unlink 38 | ||
99 | __SYSCALL( 38, sys_unlink, 1) | ||
100 | #define __NR_rmdir 39 | ||
101 | __SYSCALL( 39, sys_rmdir, 1) | ||
102 | |||
103 | #define __NR_mkdir 40 | ||
104 | __SYSCALL( 40, sys_mkdir, 2) | ||
105 | #define __NR_chdir 41 | ||
106 | __SYSCALL( 41, sys_chdir, 1) | ||
107 | #define __NR_fchdir 42 | ||
108 | __SYSCALL( 42, sys_fchdir, 1) | ||
109 | #define __NR_getcwd 43 | ||
110 | __SYSCALL( 43, sys_getcwd, 2) | ||
111 | |||
112 | #define __NR_chmod 44 | ||
113 | __SYSCALL( 44, sys_chmod, 2) | ||
114 | #define __NR_chown 45 | ||
115 | __SYSCALL( 45, sys_chown, 3) | ||
116 | #define __NR_stat 46 | ||
117 | __SYSCALL( 46, sys_newstat, 2) | ||
118 | #define __NR_stat64 47 | ||
119 | __SYSCALL( 47, sys_stat64, 2) | ||
120 | |||
121 | #define __NR_lchown 48 | ||
122 | __SYSCALL( 48, sys_lchown, 3) | ||
123 | #define __NR_lstat 49 | ||
124 | __SYSCALL( 49, sys_newlstat, 2) | ||
125 | #define __NR_lstat64 50 | ||
126 | __SYSCALL( 50, sys_lstat64, 2) | ||
127 | #define __NR_available51 51 | ||
128 | __SYSCALL( 51, sys_ni_syscall, 0) | ||
129 | |||
130 | #define __NR_fchmod 52 | ||
131 | __SYSCALL( 52, sys_fchmod, 2) | ||
132 | #define __NR_fchown 53 | ||
133 | __SYSCALL( 53, sys_fchown, 3) | ||
134 | #define __NR_fstat 54 | ||
135 | __SYSCALL( 54, sys_newfstat, 2) | ||
136 | #define __NR_fstat64 55 | ||
137 | __SYSCALL( 55, sys_fstat64, 2) | ||
138 | |||
139 | #define __NR_flock 56 | ||
140 | __SYSCALL( 56, sys_flock, 2) | ||
141 | #define __NR_access 57 | ||
142 | __SYSCALL( 57, sys_access, 2) | ||
143 | #define __NR_umask 58 | ||
144 | __SYSCALL( 58, sys_umask, 1) | ||
145 | #define __NR_getdents 59 | ||
146 | __SYSCALL( 59, sys_getdents, 3) | ||
147 | #define __NR_getdents64 60 | ||
148 | __SYSCALL( 60, sys_getdents64, 3) | ||
149 | #define __NR_fcntl64 61 | ||
150 | __SYSCALL( 61, sys_fcntl64, 3) | ||
151 | #define __NR_available62 62 | ||
152 | __SYSCALL( 62, sys_ni_syscall, 0) | ||
153 | #define __NR_fadvise64_64 63 | ||
154 | __SYSCALL( 63, xtensa_fadvise64_64, 6) | ||
155 | #define __NR_utime 64 /* glibc 2.3.3 ?? */ | ||
156 | __SYSCALL( 64, sys_utime, 2) | ||
157 | #define __NR_utimes 65 | ||
158 | __SYSCALL( 65, sys_utimes, 2) | ||
159 | #define __NR_ioctl 66 | ||
160 | __SYSCALL( 66, sys_ioctl, 3) | ||
161 | #define __NR_fcntl 67 | ||
162 | __SYSCALL( 67, sys_fcntl, 3) | ||
163 | |||
164 | #define __NR_setxattr 68 | ||
165 | __SYSCALL( 68, sys_setxattr, 5) | ||
166 | #define __NR_getxattr 69 | ||
167 | __SYSCALL( 69, sys_getxattr, 4) | ||
168 | #define __NR_listxattr 70 | ||
169 | __SYSCALL( 70, sys_listxattr, 3) | ||
170 | #define __NR_removexattr 71 | ||
171 | __SYSCALL( 71, sys_removexattr, 2) | ||
172 | #define __NR_lsetxattr 72 | ||
173 | __SYSCALL( 72, sys_lsetxattr, 5) | ||
174 | #define __NR_lgetxattr 73 | ||
175 | __SYSCALL( 73, sys_lgetxattr, 4) | ||
176 | #define __NR_llistxattr 74 | ||
177 | __SYSCALL( 74, sys_llistxattr, 3) | ||
178 | #define __NR_lremovexattr 75 | ||
179 | __SYSCALL( 75, sys_lremovexattr, 2) | ||
180 | #define __NR_fsetxattr 76 | ||
181 | __SYSCALL( 76, sys_fsetxattr, 5) | ||
182 | #define __NR_fgetxattr 77 | ||
183 | __SYSCALL( 77, sys_fgetxattr, 4) | ||
184 | #define __NR_flistxattr 78 | ||
185 | __SYSCALL( 78, sys_flistxattr, 3) | ||
186 | #define __NR_fremovexattr 79 | ||
187 | __SYSCALL( 79, sys_fremovexattr, 2) | ||
188 | |||
189 | /* File Map / Shared Memory Operations */ | ||
190 | |||
191 | #define __NR_mmap2 80 | ||
192 | __SYSCALL( 80, sys_mmap_pgoff, 6) | ||
193 | #define __NR_munmap 81 | ||
194 | __SYSCALL( 81, sys_munmap, 2) | ||
195 | #define __NR_mprotect 82 | ||
196 | __SYSCALL( 82, sys_mprotect, 3) | ||
197 | #define __NR_brk 83 | ||
198 | __SYSCALL( 83, sys_brk, 1) | ||
199 | #define __NR_mlock 84 | ||
200 | __SYSCALL( 84, sys_mlock, 2) | ||
201 | #define __NR_munlock 85 | ||
202 | __SYSCALL( 85, sys_munlock, 2) | ||
203 | #define __NR_mlockall 86 | ||
204 | __SYSCALL( 86, sys_mlockall, 1) | ||
205 | #define __NR_munlockall 87 | ||
206 | __SYSCALL( 87, sys_munlockall, 0) | ||
207 | #define __NR_mremap 88 | ||
208 | __SYSCALL( 88, sys_mremap, 4) | ||
209 | #define __NR_msync 89 | ||
210 | __SYSCALL( 89, sys_msync, 3) | ||
211 | #define __NR_mincore 90 | ||
212 | __SYSCALL( 90, sys_mincore, 3) | ||
213 | #define __NR_madvise 91 | ||
214 | __SYSCALL( 91, sys_madvise, 3) | ||
215 | #define __NR_shmget 92 | ||
216 | __SYSCALL( 92, sys_shmget, 4) | ||
217 | #define __NR_shmat 93 | ||
218 | __SYSCALL( 93, xtensa_shmat, 4) | ||
219 | #define __NR_shmctl 94 | ||
220 | __SYSCALL( 94, sys_shmctl, 4) | ||
221 | #define __NR_shmdt 95 | ||
222 | __SYSCALL( 95, sys_shmdt, 4) | ||
223 | |||
224 | /* Socket Operations */ | ||
225 | |||
226 | #define __NR_socket 96 | ||
227 | __SYSCALL( 96, sys_socket, 3) | ||
228 | #define __NR_setsockopt 97 | ||
229 | __SYSCALL( 97, sys_setsockopt, 5) | ||
230 | #define __NR_getsockopt 98 | ||
231 | __SYSCALL( 98, sys_getsockopt, 5) | ||
232 | #define __NR_shutdown 99 | ||
233 | __SYSCALL( 99, sys_shutdown, 2) | ||
234 | |||
235 | #define __NR_bind 100 | ||
236 | __SYSCALL(100, sys_bind, 3) | ||
237 | #define __NR_connect 101 | ||
238 | __SYSCALL(101, sys_connect, 3) | ||
239 | #define __NR_listen 102 | ||
240 | __SYSCALL(102, sys_listen, 2) | ||
241 | #define __NR_accept 103 | ||
242 | __SYSCALL(103, sys_accept, 3) | ||
243 | |||
244 | #define __NR_getsockname 104 | ||
245 | __SYSCALL(104, sys_getsockname, 3) | ||
246 | #define __NR_getpeername 105 | ||
247 | __SYSCALL(105, sys_getpeername, 3) | ||
248 | #define __NR_sendmsg 106 | ||
249 | __SYSCALL(106, sys_sendmsg, 3) | ||
250 | #define __NR_recvmsg 107 | ||
251 | __SYSCALL(107, sys_recvmsg, 3) | ||
252 | #define __NR_send 108 | ||
253 | __SYSCALL(108, sys_send, 4) | ||
254 | #define __NR_recv 109 | ||
255 | __SYSCALL(109, sys_recv, 4) | ||
256 | #define __NR_sendto 110 | ||
257 | __SYSCALL(110, sys_sendto, 6) | ||
258 | #define __NR_recvfrom 111 | ||
259 | __SYSCALL(111, sys_recvfrom, 6) | ||
260 | |||
261 | #define __NR_socketpair 112 | ||
262 | __SYSCALL(112, sys_socketpair, 4) | ||
263 | #define __NR_sendfile 113 | ||
264 | __SYSCALL(113, sys_sendfile, 4) | ||
265 | #define __NR_sendfile64 114 | ||
266 | __SYSCALL(114, sys_sendfile64, 4) | ||
267 | #define __NR_available115 115 | ||
268 | __SYSCALL(115, sys_ni_syscall, 0) | ||
269 | |||
270 | /* Process Operations */ | ||
271 | |||
272 | #define __NR_clone 116 | ||
273 | __SYSCALL(116, xtensa_clone, 5) | ||
274 | #define __NR_execve 117 | ||
275 | __SYSCALL(117, xtensa_execve, 3) | ||
276 | #define __NR_exit 118 | ||
277 | __SYSCALL(118, sys_exit, 1) | ||
278 | #define __NR_exit_group 119 | ||
279 | __SYSCALL(119, sys_exit_group, 1) | ||
280 | #define __NR_getpid 120 | ||
281 | __SYSCALL(120, sys_getpid, 0) | ||
282 | #define __NR_wait4 121 | ||
283 | __SYSCALL(121, sys_wait4, 4) | ||
284 | #define __NR_waitid 122 | ||
285 | __SYSCALL(122, sys_waitid, 5) | ||
286 | #define __NR_kill 123 | ||
287 | __SYSCALL(123, sys_kill, 2) | ||
288 | #define __NR_tkill 124 | ||
289 | __SYSCALL(124, sys_tkill, 2) | ||
290 | #define __NR_tgkill 125 | ||
291 | __SYSCALL(125, sys_tgkill, 3) | ||
292 | #define __NR_set_tid_address 126 | ||
293 | __SYSCALL(126, sys_set_tid_address, 1) | ||
294 | #define __NR_gettid 127 | ||
295 | __SYSCALL(127, sys_gettid, 0) | ||
296 | #define __NR_setsid 128 | ||
297 | __SYSCALL(128, sys_setsid, 0) | ||
298 | #define __NR_getsid 129 | ||
299 | __SYSCALL(129, sys_getsid, 1) | ||
300 | #define __NR_prctl 130 | ||
301 | __SYSCALL(130, sys_prctl, 5) | ||
302 | #define __NR_personality 131 | ||
303 | __SYSCALL(131, sys_personality, 1) | ||
304 | #define __NR_getpriority 132 | ||
305 | __SYSCALL(132, sys_getpriority, 2) | ||
306 | #define __NR_setpriority 133 | ||
307 | __SYSCALL(133, sys_setpriority, 3) | ||
308 | #define __NR_setitimer 134 | ||
309 | __SYSCALL(134, sys_setitimer, 3) | ||
310 | #define __NR_getitimer 135 | ||
311 | __SYSCALL(135, sys_getitimer, 2) | ||
312 | #define __NR_setuid 136 | ||
313 | __SYSCALL(136, sys_setuid, 1) | ||
314 | #define __NR_getuid 137 | ||
315 | __SYSCALL(137, sys_getuid, 0) | ||
316 | #define __NR_setgid 138 | ||
317 | __SYSCALL(138, sys_setgid, 1) | ||
318 | #define __NR_getgid 139 | ||
319 | __SYSCALL(139, sys_getgid, 0) | ||
320 | #define __NR_geteuid 140 | ||
321 | __SYSCALL(140, sys_geteuid, 0) | ||
322 | #define __NR_getegid 141 | ||
323 | __SYSCALL(141, sys_getegid, 0) | ||
324 | #define __NR_setreuid 142 | ||
325 | __SYSCALL(142, sys_setreuid, 2) | ||
326 | #define __NR_setregid 143 | ||
327 | __SYSCALL(143, sys_setregid, 2) | ||
328 | #define __NR_setresuid 144 | ||
329 | __SYSCALL(144, sys_setresuid, 3) | ||
330 | #define __NR_getresuid 145 | ||
331 | __SYSCALL(145, sys_getresuid, 3) | ||
332 | #define __NR_setresgid 146 | ||
333 | __SYSCALL(146, sys_setresgid, 3) | ||
334 | #define __NR_getresgid 147 | ||
335 | __SYSCALL(147, sys_getresgid, 3) | ||
336 | #define __NR_setpgid 148 | ||
337 | __SYSCALL(148, sys_setpgid, 2) | ||
338 | #define __NR_getpgid 149 | ||
339 | __SYSCALL(149, sys_getpgid, 1) | ||
340 | #define __NR_getppid 150 | ||
341 | __SYSCALL(150, sys_getppid, 0) | ||
342 | #define __NR_getpgrp 151 | ||
343 | __SYSCALL(151, sys_getpgrp, 0) | ||
344 | |||
345 | #define __NR_reserved152 152 /* set_thread_area */ | ||
346 | __SYSCALL(152, sys_ni_syscall, 0) | ||
347 | #define __NR_reserved153 153 /* get_thread_area */ | ||
348 | __SYSCALL(153, sys_ni_syscall, 0) | ||
349 | #define __NR_times 154 | ||
350 | __SYSCALL(154, sys_times, 1) | ||
351 | #define __NR_acct 155 | ||
352 | __SYSCALL(155, sys_acct, 1) | ||
353 | #define __NR_sched_setaffinity 156 | ||
354 | __SYSCALL(156, sys_sched_setaffinity, 3) | ||
355 | #define __NR_sched_getaffinity 157 | ||
356 | __SYSCALL(157, sys_sched_getaffinity, 3) | ||
357 | #define __NR_capget 158 | ||
358 | __SYSCALL(158, sys_capget, 2) | ||
359 | #define __NR_capset 159 | ||
360 | __SYSCALL(159, sys_capset, 2) | ||
361 | #define __NR_ptrace 160 | ||
362 | __SYSCALL(160, sys_ptrace, 4) | ||
363 | #define __NR_semtimedop 161 | ||
364 | __SYSCALL(161, sys_semtimedop, 5) | ||
365 | #define __NR_semget 162 | ||
366 | __SYSCALL(162, sys_semget, 4) | ||
367 | #define __NR_semop 163 | ||
368 | __SYSCALL(163, sys_semop, 4) | ||
369 | #define __NR_semctl 164 | ||
370 | __SYSCALL(164, sys_semctl, 4) | ||
371 | #define __NR_available165 165 | ||
372 | __SYSCALL(165, sys_ni_syscall, 0) | ||
373 | #define __NR_msgget 166 | ||
374 | __SYSCALL(166, sys_msgget, 4) | ||
375 | #define __NR_msgsnd 167 | ||
376 | __SYSCALL(167, sys_msgsnd, 4) | ||
377 | #define __NR_msgrcv 168 | ||
378 | __SYSCALL(168, sys_msgrcv, 4) | ||
379 | #define __NR_msgctl 169 | ||
380 | __SYSCALL(169, sys_msgctl, 4) | ||
381 | #define __NR_available170 170 | ||
382 | __SYSCALL(170, sys_ni_syscall, 0) | ||
383 | #define __NR_available171 171 | ||
384 | __SYSCALL(171, sys_ni_syscall, 0) | ||
385 | |||
386 | /* File System */ | ||
387 | |||
388 | #define __NR_mount 172 | ||
389 | __SYSCALL(172, sys_mount, 5) | ||
390 | #define __NR_swapon 173 | ||
391 | __SYSCALL(173, sys_swapon, 2) | ||
392 | #define __NR_chroot 174 | ||
393 | __SYSCALL(174, sys_chroot, 1) | ||
394 | #define __NR_pivot_root 175 | ||
395 | __SYSCALL(175, sys_pivot_root, 2) | ||
396 | #define __NR_umount 176 | ||
397 | __SYSCALL(176, sys_umount, 2) | ||
398 | #define __NR_swapoff 177 | ||
399 | __SYSCALL(177, sys_swapoff, 1) | ||
400 | #define __NR_sync 178 | ||
401 | __SYSCALL(178, sys_sync, 0) | ||
402 | #define __NR_available179 179 | ||
403 | __SYSCALL(179, sys_ni_syscall, 0) | ||
404 | #define __NR_setfsuid 180 | ||
405 | __SYSCALL(180, sys_setfsuid, 1) | ||
406 | #define __NR_setfsgid 181 | ||
407 | __SYSCALL(181, sys_setfsgid, 1) | ||
408 | #define __NR_sysfs 182 | ||
409 | __SYSCALL(182, sys_sysfs, 3) | ||
410 | #define __NR_ustat 183 | ||
411 | __SYSCALL(183, sys_ustat, 2) | ||
412 | #define __NR_statfs 184 | ||
413 | __SYSCALL(184, sys_statfs, 2) | ||
414 | #define __NR_fstatfs 185 | ||
415 | __SYSCALL(185, sys_fstatfs, 2) | ||
416 | #define __NR_statfs64 186 | ||
417 | __SYSCALL(186, sys_statfs64, 3) | ||
418 | #define __NR_fstatfs64 187 | ||
419 | __SYSCALL(187, sys_fstatfs64, 3) | ||
420 | |||
421 | /* System */ | ||
422 | |||
423 | #define __NR_setrlimit 188 | ||
424 | __SYSCALL(188, sys_setrlimit, 2) | ||
425 | #define __NR_getrlimit 189 | ||
426 | __SYSCALL(189, sys_getrlimit, 2) | ||
427 | #define __NR_getrusage 190 | ||
428 | __SYSCALL(190, sys_getrusage, 2) | ||
429 | #define __NR_futex 191 | ||
430 | __SYSCALL(191, sys_futex, 5) | ||
431 | #define __NR_gettimeofday 192 | ||
432 | __SYSCALL(192, sys_gettimeofday, 2) | ||
433 | #define __NR_settimeofday 193 | ||
434 | __SYSCALL(193, sys_settimeofday, 2) | ||
435 | #define __NR_adjtimex 194 | ||
436 | __SYSCALL(194, sys_adjtimex, 1) | ||
437 | #define __NR_nanosleep 195 | ||
438 | __SYSCALL(195, sys_nanosleep, 2) | ||
439 | #define __NR_getgroups 196 | ||
440 | __SYSCALL(196, sys_getgroups, 2) | ||
441 | #define __NR_setgroups 197 | ||
442 | __SYSCALL(197, sys_setgroups, 2) | ||
443 | #define __NR_sethostname 198 | ||
444 | __SYSCALL(198, sys_sethostname, 2) | ||
445 | #define __NR_setdomainname 199 | ||
446 | __SYSCALL(199, sys_setdomainname, 2) | ||
447 | #define __NR_syslog 200 | ||
448 | __SYSCALL(200, sys_syslog, 3) | ||
449 | #define __NR_vhangup 201 | ||
450 | __SYSCALL(201, sys_vhangup, 0) | ||
451 | #define __NR_uselib 202 | ||
452 | __SYSCALL(202, sys_uselib, 1) | ||
453 | #define __NR_reboot 203 | ||
454 | __SYSCALL(203, sys_reboot, 3) | ||
455 | #define __NR_quotactl 204 | ||
456 | __SYSCALL(204, sys_quotactl, 4) | ||
457 | #define __NR_nfsservctl 205 | ||
458 | __SYSCALL(205, sys_ni_syscall, 0) | ||
459 | #define __NR__sysctl 206 | ||
460 | __SYSCALL(206, sys_sysctl, 1) | ||
461 | #define __NR_bdflush 207 | ||
462 | __SYSCALL(207, sys_bdflush, 2) | ||
463 | #define __NR_uname 208 | ||
464 | __SYSCALL(208, sys_newuname, 1) | ||
465 | #define __NR_sysinfo 209 | ||
466 | __SYSCALL(209, sys_sysinfo, 1) | ||
467 | #define __NR_init_module 210 | ||
468 | __SYSCALL(210, sys_init_module, 2) | ||
469 | #define __NR_delete_module 211 | ||
470 | __SYSCALL(211, sys_delete_module, 1) | ||
471 | |||
472 | #define __NR_sched_setparam 212 | ||
473 | __SYSCALL(212, sys_sched_setparam, 2) | ||
474 | #define __NR_sched_getparam 213 | ||
475 | __SYSCALL(213, sys_sched_getparam, 2) | ||
476 | #define __NR_sched_setscheduler 214 | ||
477 | __SYSCALL(214, sys_sched_setscheduler, 3) | ||
478 | #define __NR_sched_getscheduler 215 | ||
479 | __SYSCALL(215, sys_sched_getscheduler, 1) | ||
480 | #define __NR_sched_get_priority_max 216 | ||
481 | __SYSCALL(216, sys_sched_get_priority_max, 1) | ||
482 | #define __NR_sched_get_priority_min 217 | ||
483 | __SYSCALL(217, sys_sched_get_priority_min, 1) | ||
484 | #define __NR_sched_rr_get_interval 218 | ||
485 | __SYSCALL(218, sys_sched_rr_get_interval, 2) | ||
486 | #define __NR_sched_yield 219 | ||
487 | __SYSCALL(219, sys_sched_yield, 0) | ||
488 | #define __NR_available222 222 | ||
489 | __SYSCALL(222, sys_ni_syscall, 0) | ||
490 | |||
491 | /* Signal Handling */ | ||
492 | |||
493 | #define __NR_restart_syscall 223 | ||
494 | __SYSCALL(223, sys_restart_syscall, 0) | ||
495 | #define __NR_sigaltstack 224 | ||
496 | __SYSCALL(224, xtensa_sigaltstack, 2) | ||
497 | #define __NR_rt_sigreturn 225 | ||
498 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | ||
499 | #define __NR_rt_sigaction 226 | ||
500 | __SYSCALL(226, sys_rt_sigaction, 4) | ||
501 | #define __NR_rt_sigprocmask 227 | ||
502 | __SYSCALL(227, sys_rt_sigprocmask, 4) | ||
503 | #define __NR_rt_sigpending 228 | ||
504 | __SYSCALL(228, sys_rt_sigpending, 2) | ||
505 | #define __NR_rt_sigtimedwait 229 | ||
506 | __SYSCALL(229, sys_rt_sigtimedwait, 4) | ||
507 | #define __NR_rt_sigqueueinfo 230 | ||
508 | __SYSCALL(230, sys_rt_sigqueueinfo, 3) | ||
509 | #define __NR_rt_sigsuspend 231 | ||
510 | __SYSCALL(231, sys_rt_sigsuspend, 2) | ||
511 | |||
512 | /* Message */ | ||
513 | |||
514 | #define __NR_mq_open 232 | ||
515 | __SYSCALL(232, sys_mq_open, 4) | ||
516 | #define __NR_mq_unlink 233 | ||
517 | __SYSCALL(233, sys_mq_unlink, 1) | ||
518 | #define __NR_mq_timedsend 234 | ||
519 | __SYSCALL(234, sys_mq_timedsend, 5) | ||
520 | #define __NR_mq_timedreceive 235 | ||
521 | __SYSCALL(235, sys_mq_timedreceive, 5) | ||
522 | #define __NR_mq_notify 236 | ||
523 | __SYSCALL(236, sys_mq_notify, 2) | ||
524 | #define __NR_mq_getsetattr 237 | ||
525 | __SYSCALL(237, sys_mq_getsetattr, 3) | ||
526 | #define __NR_available238 238 | ||
527 | __SYSCALL(238, sys_ni_syscall, 0) | ||
528 | |||
529 | /* IO */ | ||
530 | |||
531 | #define __NR_io_setup 239 | ||
532 | __SYSCALL(239, sys_io_setup, 2) | ||
533 | #define __NR_io_destroy 240 | ||
534 | __SYSCALL(240, sys_io_destroy, 1) | ||
535 | #define __NR_io_submit 241 | ||
536 | __SYSCALL(241, sys_io_submit, 3) | ||
537 | #define __NR_io_getevents 242 | ||
538 | __SYSCALL(242, sys_io_getevents, 5) | ||
539 | #define __NR_io_cancel 243 | ||
540 | __SYSCALL(243, sys_io_cancel, 3) | ||
541 | #define __NR_clock_settime 244 | ||
542 | __SYSCALL(244, sys_clock_settime, 2) | ||
543 | #define __NR_clock_gettime 245 | ||
544 | __SYSCALL(245, sys_clock_gettime, 2) | ||
545 | #define __NR_clock_getres 246 | ||
546 | __SYSCALL(246, sys_clock_getres, 2) | ||
547 | #define __NR_clock_nanosleep 247 | ||
548 | __SYSCALL(247, sys_clock_nanosleep, 4) | ||
549 | |||
550 | /* Timer */ | ||
551 | |||
552 | #define __NR_timer_create 248 | ||
553 | __SYSCALL(248, sys_timer_create, 3) | ||
554 | #define __NR_timer_delete 249 | ||
555 | __SYSCALL(249, sys_timer_delete, 1) | ||
556 | #define __NR_timer_settime 250 | ||
557 | __SYSCALL(250, sys_timer_settime, 4) | ||
558 | #define __NR_timer_gettime 251 | ||
559 | __SYSCALL(251, sys_timer_gettime, 2) | ||
560 | #define __NR_timer_getoverrun 252 | ||
561 | __SYSCALL(252, sys_timer_getoverrun, 1) | ||
562 | |||
563 | /* System */ | ||
564 | |||
565 | #define __NR_reserved244 253 | ||
566 | __SYSCALL(253, sys_ni_syscall, 0) | ||
567 | #define __NR_lookup_dcookie 254 | ||
568 | __SYSCALL(254, sys_lookup_dcookie, 4) | ||
569 | #define __NR_available255 255 | ||
570 | __SYSCALL(255, sys_ni_syscall, 0) | ||
571 | #define __NR_add_key 256 | ||
572 | __SYSCALL(256, sys_add_key, 5) | ||
573 | #define __NR_request_key 257 | ||
574 | __SYSCALL(257, sys_request_key, 5) | ||
575 | #define __NR_keyctl 258 | ||
576 | __SYSCALL(258, sys_keyctl, 5) | ||
577 | #define __NR_available259 259 | ||
578 | __SYSCALL(259, sys_ni_syscall, 0) | ||
579 | |||
580 | |||
581 | #define __NR_readahead 260 | ||
582 | __SYSCALL(260, sys_readahead, 5) | ||
583 | #define __NR_remap_file_pages 261 | ||
584 | __SYSCALL(261, sys_remap_file_pages, 5) | ||
585 | #define __NR_migrate_pages 262 | ||
586 | __SYSCALL(262, sys_migrate_pages, 0) | ||
587 | #define __NR_mbind 263 | ||
588 | __SYSCALL(263, sys_mbind, 6) | ||
589 | #define __NR_get_mempolicy 264 | ||
590 | __SYSCALL(264, sys_get_mempolicy, 5) | ||
591 | #define __NR_set_mempolicy 265 | ||
592 | __SYSCALL(265, sys_set_mempolicy, 3) | ||
593 | #define __NR_unshare 266 | ||
594 | __SYSCALL(266, sys_unshare, 1) | ||
595 | #define __NR_move_pages 267 | ||
596 | __SYSCALL(267, sys_move_pages, 0) | ||
597 | #define __NR_splice 268 | ||
598 | __SYSCALL(268, sys_splice, 0) | ||
599 | #define __NR_tee 269 | ||
600 | __SYSCALL(269, sys_tee, 0) | ||
601 | #define __NR_vmsplice 270 | ||
602 | __SYSCALL(270, sys_vmsplice, 0) | ||
603 | #define __NR_available271 271 | ||
604 | __SYSCALL(271, sys_ni_syscall, 0) | ||
605 | |||
606 | #define __NR_pselect6 272 | ||
607 | __SYSCALL(272, sys_pselect6, 0) | ||
608 | #define __NR_ppoll 273 | ||
609 | __SYSCALL(273, sys_ppoll, 0) | ||
610 | #define __NR_epoll_pwait 274 | ||
611 | __SYSCALL(274, sys_epoll_pwait, 0) | ||
612 | #define __NR_available275 275 | ||
613 | __SYSCALL(275, sys_ni_syscall, 0) | ||
614 | |||
615 | #define __NR_inotify_init 276 | ||
616 | __SYSCALL(276, sys_inotify_init, 0) | ||
617 | #define __NR_inotify_add_watch 277 | ||
618 | __SYSCALL(277, sys_inotify_add_watch, 3) | ||
619 | #define __NR_inotify_rm_watch 278 | ||
620 | __SYSCALL(278, sys_inotify_rm_watch, 2) | ||
621 | #define __NR_available279 279 | ||
622 | __SYSCALL(279, sys_ni_syscall, 0) | ||
623 | |||
624 | #define __NR_getcpu 280 | ||
625 | __SYSCALL(280, sys_getcpu, 0) | ||
626 | #define __NR_kexec_load 281 | ||
627 | __SYSCALL(281, sys_ni_syscall, 0) | ||
628 | |||
629 | #define __NR_ioprio_set 282 | ||
630 | __SYSCALL(282, sys_ioprio_set, 2) | ||
631 | #define __NR_ioprio_get 283 | ||
632 | __SYSCALL(283, sys_ioprio_get, 3) | ||
633 | |||
634 | #define __NR_set_robust_list 284 | ||
635 | __SYSCALL(284, sys_set_robust_list, 3) | ||
636 | #define __NR_get_robust_list 285 | ||
637 | __SYSCALL(285, sys_get_robust_list, 3) | ||
638 | #define __NR_reserved286 286 /* sync_file_rangeX */ | ||
639 | __SYSCALL(286, sys_ni_syscall, 3) | ||
640 | #define __NR_available287 287 | ||
641 | __SYSCALL(287, sys_faccessat, 0) | ||
642 | |||
643 | /* Relative File Operations */ | ||
644 | |||
645 | #define __NR_openat 288 | ||
646 | __SYSCALL(288, sys_openat, 4) | ||
647 | #define __NR_mkdirat 289 | ||
648 | __SYSCALL(289, sys_mkdirat, 3) | ||
649 | #define __NR_mknodat 290 | ||
650 | __SYSCALL(290, sys_mknodat, 4) | ||
651 | #define __NR_unlinkat 291 | ||
652 | __SYSCALL(291, sys_unlinkat, 3) | ||
653 | #define __NR_renameat 292 | ||
654 | __SYSCALL(292, sys_renameat, 4) | ||
655 | #define __NR_linkat 293 | ||
656 | __SYSCALL(293, sys_linkat, 5) | ||
657 | #define __NR_symlinkat 294 | ||
658 | __SYSCALL(294, sys_symlinkat, 3) | ||
659 | #define __NR_readlinkat 295 | ||
660 | __SYSCALL(295, sys_readlinkat, 4) | ||
661 | #define __NR_utimensat 296 | ||
662 | __SYSCALL(296, sys_utimensat, 0) | ||
663 | #define __NR_fchownat 297 | ||
664 | __SYSCALL(297, sys_fchownat, 5) | ||
665 | #define __NR_futimesat 298 | ||
666 | __SYSCALL(298, sys_futimesat, 4) | ||
667 | #define __NR_fstatat64 299 | ||
668 | __SYSCALL(299, sys_fstatat64, 0) | ||
669 | #define __NR_fchmodat 300 | ||
670 | __SYSCALL(300, sys_fchmodat, 4) | ||
671 | #define __NR_faccessat 301 | ||
672 | __SYSCALL(301, sys_faccessat, 4) | ||
673 | #define __NR_available302 302 | ||
674 | __SYSCALL(302, sys_ni_syscall, 0) | ||
675 | #define __NR_available303 303 | ||
676 | __SYSCALL(303, sys_ni_syscall, 0) | ||
677 | |||
678 | #define __NR_signalfd 304 | ||
679 | __SYSCALL(304, sys_signalfd, 3) | ||
680 | /* 305 was __NR_timerfd */ | ||
681 | __SYSCALL(305, sys_ni_syscall, 0) | ||
682 | #define __NR_eventfd 306 | ||
683 | __SYSCALL(306, sys_eventfd, 1) | ||
684 | #define __NR_recvmmsg 307 | ||
685 | __SYSCALL(307, sys_recvmmsg, 5) | ||
686 | #define __NR_setns 308 | ||
687 | __SYSCALL(308, sys_setns, 2) | ||
688 | |||
689 | #define __NR_syscall_count 309 | ||
690 | |||
691 | /* | ||
692 | * sysxtensa syscall handler | ||
693 | * | ||
694 | * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused); | ||
695 | * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused); | ||
696 | * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused); | ||
697 | * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval); | ||
698 | * a2 a6 a3 a4 a5 | ||
699 | */ | ||
700 | |||
701 | #define SYS_XTENSA_RESERVED 0 /* don't use this */ | ||
702 | #define SYS_XTENSA_ATOMIC_SET 1 /* set variable */ | ||
703 | #define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ | ||
704 | #define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */ | ||
705 | #define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ | ||
706 | |||
707 | #define SYS_XTENSA_COUNT 5 /* count */ | ||
708 | |||
709 | #ifdef __KERNEL__ | ||
710 | 13 | ||
711 | /* | 14 | /* |
712 | * "Conditional" syscalls | 15 | * "Conditional" syscalls |
@@ -734,6 +37,3 @@ __SYSCALL(308, sys_setns, 2) | |||
734 | #define __IGNORE_mmap /* use mmap2 */ | 37 | #define __IGNORE_mmap /* use mmap2 */ |
735 | #define __IGNORE_vfork /* use clone */ | 38 | #define __IGNORE_vfork /* use clone */ |
736 | #define __IGNORE_fadvise64 /* use fadvise64_64 */ | 39 | #define __IGNORE_fadvise64 /* use fadvise64_64 */ |
737 | |||
738 | #endif /* __KERNEL__ */ | ||
739 | #endif /* _XTENSA_UNISTD_H */ | ||
diff --git a/arch/xtensa/include/asm/xor.h b/arch/xtensa/include/asm/xor.h deleted file mode 100644 index e7b1f083991d..000000000000 --- a/arch/xtensa/include/asm/xor.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/xor.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_XOR_H | ||
12 | #define _XTENSA_XOR_H | ||
13 | |||
14 | #include <asm-generic/xor.h> | ||
15 | |||
16 | #endif | ||
diff --git a/arch/xtensa/include/uapi/asm/Kbuild b/arch/xtensa/include/uapi/asm/Kbuild index baebb3da1d44..56aad54e7fb7 100644 --- a/arch/xtensa/include/uapi/asm/Kbuild +++ b/arch/xtensa/include/uapi/asm/Kbuild | |||
@@ -1,3 +1,25 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | header-y += auxvec.h | ||
5 | header-y += byteorder.h | ||
6 | header-y += ioctls.h | ||
7 | header-y += ipcbuf.h | ||
8 | header-y += mman.h | ||
9 | header-y += msgbuf.h | ||
10 | header-y += param.h | ||
11 | header-y += poll.h | ||
12 | header-y += posix_types.h | ||
13 | header-y += ptrace.h | ||
14 | header-y += sembuf.h | ||
15 | header-y += setup.h | ||
16 | header-y += shmbuf.h | ||
17 | header-y += sigcontext.h | ||
18 | header-y += signal.h | ||
19 | header-y += socket.h | ||
20 | header-y += sockios.h | ||
21 | header-y += stat.h | ||
22 | header-y += swab.h | ||
23 | header-y += termbits.h | ||
24 | header-y += types.h | ||
25 | header-y += unistd.h | ||
diff --git a/arch/xtensa/include/asm/auxvec.h b/arch/xtensa/include/uapi/asm/auxvec.h index 257dec75c5af..257dec75c5af 100644 --- a/arch/xtensa/include/asm/auxvec.h +++ b/arch/xtensa/include/uapi/asm/auxvec.h | |||
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/uapi/asm/byteorder.h index 54eb6315349c..54eb6315349c 100644 --- a/arch/xtensa/include/asm/byteorder.h +++ b/arch/xtensa/include/uapi/asm/byteorder.h | |||
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/uapi/asm/ioctls.h index 2aa4cd9f0cec..2aa4cd9f0cec 100644 --- a/arch/xtensa/include/asm/ioctls.h +++ b/arch/xtensa/include/uapi/asm/ioctls.h | |||
diff --git a/arch/xtensa/include/asm/ipcbuf.h b/arch/xtensa/include/uapi/asm/ipcbuf.h index c33aa6a42145..c33aa6a42145 100644 --- a/arch/xtensa/include/asm/ipcbuf.h +++ b/arch/xtensa/include/uapi/asm/ipcbuf.h | |||
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h index 25bc6c1309c3..25bc6c1309c3 100644 --- a/arch/xtensa/include/asm/mman.h +++ b/arch/xtensa/include/uapi/asm/mman.h | |||
diff --git a/arch/xtensa/include/asm/msgbuf.h b/arch/xtensa/include/uapi/asm/msgbuf.h index 693c96755280..693c96755280 100644 --- a/arch/xtensa/include/asm/msgbuf.h +++ b/arch/xtensa/include/uapi/asm/msgbuf.h | |||
diff --git a/arch/xtensa/include/uapi/asm/param.h b/arch/xtensa/include/uapi/asm/param.h new file mode 100644 index 000000000000..87bc2eae630e --- /dev/null +++ b/arch/xtensa/include/uapi/asm/param.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/param.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_XTENSA_PARAM_H | ||
12 | #define _UAPI_XTENSA_PARAM_H | ||
13 | |||
14 | #ifndef __KERNEL__ | ||
15 | # define HZ 100 | ||
16 | #endif | ||
17 | |||
18 | #define EXEC_PAGESIZE 4096 | ||
19 | |||
20 | #ifndef NGROUPS | ||
21 | #define NGROUPS 32 | ||
22 | #endif | ||
23 | |||
24 | #ifndef NOGROUP | ||
25 | #define NOGROUP (-1) | ||
26 | #endif | ||
27 | |||
28 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
29 | |||
30 | #endif /* _UAPI_XTENSA_PARAM_H */ | ||
diff --git a/arch/xtensa/include/asm/poll.h b/arch/xtensa/include/uapi/asm/poll.h index 9d2d5993f068..9d2d5993f068 100644 --- a/arch/xtensa/include/asm/poll.h +++ b/arch/xtensa/include/uapi/asm/poll.h | |||
diff --git a/arch/xtensa/include/asm/posix_types.h b/arch/xtensa/include/uapi/asm/posix_types.h index 6e96be0d02d3..6e96be0d02d3 100644 --- a/arch/xtensa/include/asm/posix_types.h +++ b/arch/xtensa/include/uapi/asm/posix_types.h | |||
diff --git a/arch/xtensa/include/uapi/asm/ptrace.h b/arch/xtensa/include/uapi/asm/ptrace.h new file mode 100644 index 000000000000..ee17aa842fdf --- /dev/null +++ b/arch/xtensa/include/uapi/asm/ptrace.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/ptrace.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_XTENSA_PTRACE_H | ||
12 | #define _UAPI_XTENSA_PTRACE_H | ||
13 | |||
14 | /* | ||
15 | * Kernel stack | ||
16 | * | ||
17 | * +-----------------------+ -------- STACK_SIZE | ||
18 | * | register file | | | ||
19 | * +-----------------------+ | | ||
20 | * | struct pt_regs | | | ||
21 | * +-----------------------+ | ------ PT_REGS_OFFSET | ||
22 | * double : 16 bytes spill area : | ^ | ||
23 | * excetion :- - - - - - - - - - - -: | | | ||
24 | * frame : struct pt_regs : | | | ||
25 | * :- - - - - - - - - - - -: | | | ||
26 | * | | | | | ||
27 | * | memory stack | | | | ||
28 | * | | | | | ||
29 | * ~ ~ ~ ~ | ||
30 | * ~ ~ ~ ~ | ||
31 | * | | | | | ||
32 | * | | | | | ||
33 | * +-----------------------+ | | --- STACK_BIAS | ||
34 | * | struct task_struct | | | ^ | ||
35 | * current --> +-----------------------+ | | | | ||
36 | * | struct thread_info | | | | | ||
37 | * +-----------------------+ -------- | ||
38 | */ | ||
39 | |||
40 | #define KERNEL_STACK_SIZE (2 * PAGE_SIZE) | ||
41 | |||
42 | /* Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */ | ||
43 | |||
44 | #define EXC_TABLE_KSTK 0x004 /* Kernel Stack */ | ||
45 | #define EXC_TABLE_DOUBLE_SAVE 0x008 /* Double exception save area for a0 */ | ||
46 | #define EXC_TABLE_FIXUP 0x00c /* Fixup handler */ | ||
47 | #define EXC_TABLE_PARAM 0x010 /* For passing a parameter to fixup */ | ||
48 | #define EXC_TABLE_SYSCALL_SAVE 0x014 /* For fast syscall handler */ | ||
49 | #define EXC_TABLE_FAST_USER 0x100 /* Fast user exception handler */ | ||
50 | #define EXC_TABLE_FAST_KERNEL 0x200 /* Fast kernel exception handler */ | ||
51 | #define EXC_TABLE_DEFAULT 0x300 /* Default C-Handler */ | ||
52 | #define EXC_TABLE_SIZE 0x400 | ||
53 | |||
54 | /* Registers used by strace */ | ||
55 | |||
56 | #define REG_A_BASE 0x0000 | ||
57 | #define REG_AR_BASE 0x0100 | ||
58 | #define REG_PC 0x0020 | ||
59 | #define REG_PS 0x02e6 | ||
60 | #define REG_WB 0x0248 | ||
61 | #define REG_WS 0x0249 | ||
62 | #define REG_LBEG 0x0200 | ||
63 | #define REG_LEND 0x0201 | ||
64 | #define REG_LCOUNT 0x0202 | ||
65 | #define REG_SAR 0x0203 | ||
66 | |||
67 | #define SYSCALL_NR 0x00ff | ||
68 | |||
69 | /* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */ | ||
70 | |||
71 | #define PTRACE_GETREGS 12 | ||
72 | #define PTRACE_SETREGS 13 | ||
73 | #define PTRACE_GETXTREGS 18 | ||
74 | #define PTRACE_SETXTREGS 19 | ||
75 | |||
76 | |||
77 | #endif /* _UAPI_XTENSA_PTRACE_H */ | ||
diff --git a/arch/xtensa/include/asm/sembuf.h b/arch/xtensa/include/uapi/asm/sembuf.h index c15870493b33..c15870493b33 100644 --- a/arch/xtensa/include/asm/sembuf.h +++ b/arch/xtensa/include/uapi/asm/sembuf.h | |||
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/uapi/asm/setup.h index 9fa8ad979361..9fa8ad979361 100644 --- a/arch/xtensa/include/asm/setup.h +++ b/arch/xtensa/include/uapi/asm/setup.h | |||
diff --git a/arch/xtensa/include/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h index ad4b0121782c..ad4b0121782c 100644 --- a/arch/xtensa/include/asm/shmbuf.h +++ b/arch/xtensa/include/uapi/asm/shmbuf.h | |||
diff --git a/arch/xtensa/include/asm/sigcontext.h b/arch/xtensa/include/uapi/asm/sigcontext.h index 03383af8c3b7..03383af8c3b7 100644 --- a/arch/xtensa/include/asm/sigcontext.h +++ b/arch/xtensa/include/uapi/asm/sigcontext.h | |||
diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h new file mode 100644 index 000000000000..b88ce96f2af9 --- /dev/null +++ b/arch/xtensa/include/uapi/asm/signal.h | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/signal.h | ||
3 | * | ||
4 | * Swiped from SH. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _UAPI_XTENSA_SIGNAL_H | ||
14 | #define _UAPI_XTENSA_SIGNAL_H | ||
15 | |||
16 | |||
17 | #define _NSIG 64 | ||
18 | #define _NSIG_BPW 32 | ||
19 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | /* Avoid too many header ordering problems. */ | ||
26 | struct siginfo; | ||
27 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
28 | typedef struct { | ||
29 | unsigned long sig[_NSIG_WORDS]; | ||
30 | } sigset_t; | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define SIGHUP 1 | ||
35 | #define SIGINT 2 | ||
36 | #define SIGQUIT 3 | ||
37 | #define SIGILL 4 | ||
38 | #define SIGTRAP 5 | ||
39 | #define SIGABRT 6 | ||
40 | #define SIGIOT 6 | ||
41 | #define SIGBUS 7 | ||
42 | #define SIGFPE 8 | ||
43 | #define SIGKILL 9 | ||
44 | #define SIGUSR1 10 | ||
45 | #define SIGSEGV 11 | ||
46 | #define SIGUSR2 12 | ||
47 | #define SIGPIPE 13 | ||
48 | #define SIGALRM 14 | ||
49 | #define SIGTERM 15 | ||
50 | #define SIGSTKFLT 16 | ||
51 | #define SIGCHLD 17 | ||
52 | #define SIGCONT 18 | ||
53 | #define SIGSTOP 19 | ||
54 | #define SIGTSTP 20 | ||
55 | #define SIGTTIN 21 | ||
56 | #define SIGTTOU 22 | ||
57 | #define SIGURG 23 | ||
58 | #define SIGXCPU 24 | ||
59 | #define SIGXFSZ 25 | ||
60 | #define SIGVTALRM 26 | ||
61 | #define SIGPROF 27 | ||
62 | #define SIGWINCH 28 | ||
63 | #define SIGIO 29 | ||
64 | #define SIGPOLL SIGIO | ||
65 | /* #define SIGLOST 29 */ | ||
66 | #define SIGPWR 30 | ||
67 | #define SIGSYS 31 | ||
68 | #define SIGUNUSED 31 | ||
69 | |||
70 | /* These should not be considered constants from userland. */ | ||
71 | #define SIGRTMIN 32 | ||
72 | #define SIGRTMAX (_NSIG-1) | ||
73 | |||
74 | /* | ||
75 | * SA_FLAGS values: | ||
76 | * | ||
77 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
78 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
79 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
80 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
81 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
82 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
83 | * | ||
84 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
85 | * Unix names RESETHAND and NODEFER respectively. | ||
86 | */ | ||
87 | #define SA_NOCLDSTOP 0x00000001 | ||
88 | #define SA_NOCLDWAIT 0x00000002 /* not supported yet */ | ||
89 | #define SA_SIGINFO 0x00000004 | ||
90 | #define SA_ONSTACK 0x08000000 | ||
91 | #define SA_RESTART 0x10000000 | ||
92 | #define SA_NODEFER 0x40000000 | ||
93 | #define SA_RESETHAND 0x80000000 | ||
94 | |||
95 | #define SA_NOMASK SA_NODEFER | ||
96 | #define SA_ONESHOT SA_RESETHAND | ||
97 | |||
98 | #define SA_RESTORER 0x04000000 | ||
99 | |||
100 | /* | ||
101 | * sigaltstack controls | ||
102 | */ | ||
103 | #define SS_ONSTACK 1 | ||
104 | #define SS_DISABLE 2 | ||
105 | |||
106 | #define MINSIGSTKSZ 2048 | ||
107 | #define SIGSTKSZ 8192 | ||
108 | |||
109 | #ifndef __ASSEMBLY__ | ||
110 | |||
111 | #define SIG_BLOCK 0 /* for blocking signals */ | ||
112 | #define SIG_UNBLOCK 1 /* for unblocking signals */ | ||
113 | #define SIG_SETMASK 2 /* for setting the signal mask */ | ||
114 | |||
115 | /* Type of a signal handler. */ | ||
116 | typedef void (*__sighandler_t)(int); | ||
117 | |||
118 | #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ | ||
119 | #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ | ||
120 | #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ | ||
121 | |||
122 | #ifndef __KERNEL__ | ||
123 | |||
124 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
125 | |||
126 | struct sigaction { | ||
127 | union { | ||
128 | __sighandler_t _sa_handler; | ||
129 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
130 | } _u; | ||
131 | sigset_t sa_mask; | ||
132 | unsigned long sa_flags; | ||
133 | void (*sa_restorer)(void); | ||
134 | }; | ||
135 | |||
136 | #define sa_handler _u._sa_handler | ||
137 | #define sa_sigaction _u._sa_sigaction | ||
138 | |||
139 | #endif /* __KERNEL__ */ | ||
140 | |||
141 | typedef struct sigaltstack { | ||
142 | void *ss_sp; | ||
143 | int ss_flags; | ||
144 | size_t ss_size; | ||
145 | } stack_t; | ||
146 | |||
147 | #endif /* __ASSEMBLY__ */ | ||
148 | #endif /* _UAPI_XTENSA_SIGNAL_H */ | ||
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h index e36c68184920..e36c68184920 100644 --- a/arch/xtensa/include/asm/socket.h +++ b/arch/xtensa/include/uapi/asm/socket.h | |||
diff --git a/arch/xtensa/include/asm/sockios.h b/arch/xtensa/include/uapi/asm/sockios.h index efe0af379f01..efe0af379f01 100644 --- a/arch/xtensa/include/asm/sockios.h +++ b/arch/xtensa/include/uapi/asm/sockios.h | |||
diff --git a/arch/xtensa/include/asm/stat.h b/arch/xtensa/include/uapi/asm/stat.h index c4992038cee0..c4992038cee0 100644 --- a/arch/xtensa/include/asm/stat.h +++ b/arch/xtensa/include/uapi/asm/stat.h | |||
diff --git a/arch/xtensa/include/asm/swab.h b/arch/xtensa/include/uapi/asm/swab.h index 226a39162310..226a39162310 100644 --- a/arch/xtensa/include/asm/swab.h +++ b/arch/xtensa/include/uapi/asm/swab.h | |||
diff --git a/arch/xtensa/include/asm/termbits.h b/arch/xtensa/include/uapi/asm/termbits.h index 0d6c8715b24f..0d6c8715b24f 100644 --- a/arch/xtensa/include/asm/termbits.h +++ b/arch/xtensa/include/uapi/asm/termbits.h | |||
diff --git a/arch/xtensa/include/uapi/asm/types.h b/arch/xtensa/include/uapi/asm/types.h new file mode 100644 index 000000000000..87ec7ae73cb1 --- /dev/null +++ b/arch/xtensa/include/uapi/asm/types.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/types.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_XTENSA_TYPES_H | ||
12 | #define _UAPI_XTENSA_TYPES_H | ||
13 | |||
14 | #include <asm-generic/int-ll64.h> | ||
15 | |||
16 | #ifdef __ASSEMBLY__ | ||
17 | # define __XTENSA_UL(x) (x) | ||
18 | # define __XTENSA_UL_CONST(x) x | ||
19 | #else | ||
20 | # define __XTENSA_UL(x) ((unsigned long)(x)) | ||
21 | # define __XTENSA_UL_CONST(x) x##UL | ||
22 | #endif | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | #endif | ||
27 | |||
28 | #endif /* _UAPI_XTENSA_TYPES_H */ | ||
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h new file mode 100644 index 000000000000..479abaea5aae --- /dev/null +++ b/arch/xtensa/include/uapi/asm/unistd.h | |||
@@ -0,0 +1,762 @@ | |||
1 | /* | ||
2 | * include/asm-xtensa/unistd.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2012 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_XTENSA_UNISTD_H | ||
12 | #define _UAPI_XTENSA_UNISTD_H | ||
13 | |||
14 | #ifndef __SYSCALL | ||
15 | # define __SYSCALL(nr,func,nargs) | ||
16 | #endif | ||
17 | |||
18 | #define __NR_spill 0 | ||
19 | __SYSCALL( 0, sys_ni_syscall, 0) | ||
20 | #define __NR_xtensa 1 | ||
21 | __SYSCALL( 1, sys_ni_syscall, 0) | ||
22 | #define __NR_available4 2 | ||
23 | __SYSCALL( 2, sys_ni_syscall, 0) | ||
24 | #define __NR_available5 3 | ||
25 | __SYSCALL( 3, sys_ni_syscall, 0) | ||
26 | #define __NR_available6 4 | ||
27 | __SYSCALL( 4, sys_ni_syscall, 0) | ||
28 | #define __NR_available7 5 | ||
29 | __SYSCALL( 5, sys_ni_syscall, 0) | ||
30 | #define __NR_available8 6 | ||
31 | __SYSCALL( 6, sys_ni_syscall, 0) | ||
32 | #define __NR_available9 7 | ||
33 | __SYSCALL( 7, sys_ni_syscall, 0) | ||
34 | |||
35 | /* File Operations */ | ||
36 | |||
37 | #define __NR_open 8 | ||
38 | __SYSCALL( 8, sys_open, 3) | ||
39 | #define __NR_close 9 | ||
40 | __SYSCALL( 9, sys_close, 1) | ||
41 | #define __NR_dup 10 | ||
42 | __SYSCALL( 10, sys_dup, 1) | ||
43 | #define __NR_dup2 11 | ||
44 | __SYSCALL( 11, sys_dup2, 2) | ||
45 | #define __NR_read 12 | ||
46 | __SYSCALL( 12, sys_read, 3) | ||
47 | #define __NR_write 13 | ||
48 | __SYSCALL( 13, sys_write, 3) | ||
49 | #define __NR_select 14 | ||
50 | __SYSCALL( 14, sys_select, 5) | ||
51 | #define __NR_lseek 15 | ||
52 | __SYSCALL( 15, sys_lseek, 3) | ||
53 | #define __NR_poll 16 | ||
54 | __SYSCALL( 16, sys_poll, 3) | ||
55 | #define __NR__llseek 17 | ||
56 | __SYSCALL( 17, sys_llseek, 5) | ||
57 | #define __NR_epoll_wait 18 | ||
58 | __SYSCALL( 18, sys_epoll_wait, 4) | ||
59 | #define __NR_epoll_ctl 19 | ||
60 | __SYSCALL( 19, sys_epoll_ctl, 4) | ||
61 | #define __NR_epoll_create 20 | ||
62 | __SYSCALL( 20, sys_epoll_create, 1) | ||
63 | #define __NR_creat 21 | ||
64 | __SYSCALL( 21, sys_creat, 2) | ||
65 | #define __NR_truncate 22 | ||
66 | __SYSCALL( 22, sys_truncate, 2) | ||
67 | #define __NR_ftruncate 23 | ||
68 | __SYSCALL( 23, sys_ftruncate, 2) | ||
69 | #define __NR_readv 24 | ||
70 | __SYSCALL( 24, sys_readv, 3) | ||
71 | #define __NR_writev 25 | ||
72 | __SYSCALL( 25, sys_writev, 3) | ||
73 | #define __NR_fsync 26 | ||
74 | __SYSCALL( 26, sys_fsync, 1) | ||
75 | #define __NR_fdatasync 27 | ||
76 | __SYSCALL( 27, sys_fdatasync, 1) | ||
77 | #define __NR_truncate64 28 | ||
78 | __SYSCALL( 28, sys_truncate64, 2) | ||
79 | #define __NR_ftruncate64 29 | ||
80 | __SYSCALL( 29, sys_ftruncate64, 2) | ||
81 | #define __NR_pread64 30 | ||
82 | __SYSCALL( 30, sys_pread64, 6) | ||
83 | #define __NR_pwrite64 31 | ||
84 | __SYSCALL( 31, sys_pwrite64, 6) | ||
85 | |||
86 | #define __NR_link 32 | ||
87 | __SYSCALL( 32, sys_link, 2) | ||
88 | #define __NR_rename 33 | ||
89 | __SYSCALL( 33, sys_rename, 2) | ||
90 | #define __NR_symlink 34 | ||
91 | __SYSCALL( 34, sys_symlink, 2) | ||
92 | #define __NR_readlink 35 | ||
93 | __SYSCALL( 35, sys_readlink, 3) | ||
94 | #define __NR_mknod 36 | ||
95 | __SYSCALL( 36, sys_mknod, 3) | ||
96 | #define __NR_pipe 37 | ||
97 | __SYSCALL( 37, sys_pipe, 1) | ||
98 | #define __NR_unlink 38 | ||
99 | __SYSCALL( 38, sys_unlink, 1) | ||
100 | #define __NR_rmdir 39 | ||
101 | __SYSCALL( 39, sys_rmdir, 1) | ||
102 | |||
103 | #define __NR_mkdir 40 | ||
104 | __SYSCALL( 40, sys_mkdir, 2) | ||
105 | #define __NR_chdir 41 | ||
106 | __SYSCALL( 41, sys_chdir, 1) | ||
107 | #define __NR_fchdir 42 | ||
108 | __SYSCALL( 42, sys_fchdir, 1) | ||
109 | #define __NR_getcwd 43 | ||
110 | __SYSCALL( 43, sys_getcwd, 2) | ||
111 | |||
112 | #define __NR_chmod 44 | ||
113 | __SYSCALL( 44, sys_chmod, 2) | ||
114 | #define __NR_chown 45 | ||
115 | __SYSCALL( 45, sys_chown, 3) | ||
116 | #define __NR_stat 46 | ||
117 | __SYSCALL( 46, sys_newstat, 2) | ||
118 | #define __NR_stat64 47 | ||
119 | __SYSCALL( 47, sys_stat64, 2) | ||
120 | |||
121 | #define __NR_lchown 48 | ||
122 | __SYSCALL( 48, sys_lchown, 3) | ||
123 | #define __NR_lstat 49 | ||
124 | __SYSCALL( 49, sys_newlstat, 2) | ||
125 | #define __NR_lstat64 50 | ||
126 | __SYSCALL( 50, sys_lstat64, 2) | ||
127 | #define __NR_available51 51 | ||
128 | __SYSCALL( 51, sys_ni_syscall, 0) | ||
129 | |||
130 | #define __NR_fchmod 52 | ||
131 | __SYSCALL( 52, sys_fchmod, 2) | ||
132 | #define __NR_fchown 53 | ||
133 | __SYSCALL( 53, sys_fchown, 3) | ||
134 | #define __NR_fstat 54 | ||
135 | __SYSCALL( 54, sys_newfstat, 2) | ||
136 | #define __NR_fstat64 55 | ||
137 | __SYSCALL( 55, sys_fstat64, 2) | ||
138 | |||
139 | #define __NR_flock 56 | ||
140 | __SYSCALL( 56, sys_flock, 2) | ||
141 | #define __NR_access 57 | ||
142 | __SYSCALL( 57, sys_access, 2) | ||
143 | #define __NR_umask 58 | ||
144 | __SYSCALL( 58, sys_umask, 1) | ||
145 | #define __NR_getdents 59 | ||
146 | __SYSCALL( 59, sys_getdents, 3) | ||
147 | #define __NR_getdents64 60 | ||
148 | __SYSCALL( 60, sys_getdents64, 3) | ||
149 | #define __NR_fcntl64 61 | ||
150 | __SYSCALL( 61, sys_fcntl64, 3) | ||
151 | #define __NR_fallocate 62 | ||
152 | __SYSCALL( 62, sys_fallocate, 6) | ||
153 | #define __NR_fadvise64_64 63 | ||
154 | __SYSCALL( 63, xtensa_fadvise64_64, 6) | ||
155 | #define __NR_utime 64 /* glibc 2.3.3 ?? */ | ||
156 | __SYSCALL( 64, sys_utime, 2) | ||
157 | #define __NR_utimes 65 | ||
158 | __SYSCALL( 65, sys_utimes, 2) | ||
159 | #define __NR_ioctl 66 | ||
160 | __SYSCALL( 66, sys_ioctl, 3) | ||
161 | #define __NR_fcntl 67 | ||
162 | __SYSCALL( 67, sys_fcntl, 3) | ||
163 | |||
164 | #define __NR_setxattr 68 | ||
165 | __SYSCALL( 68, sys_setxattr, 5) | ||
166 | #define __NR_getxattr 69 | ||
167 | __SYSCALL( 69, sys_getxattr, 4) | ||
168 | #define __NR_listxattr 70 | ||
169 | __SYSCALL( 70, sys_listxattr, 3) | ||
170 | #define __NR_removexattr 71 | ||
171 | __SYSCALL( 71, sys_removexattr, 2) | ||
172 | #define __NR_lsetxattr 72 | ||
173 | __SYSCALL( 72, sys_lsetxattr, 5) | ||
174 | #define __NR_lgetxattr 73 | ||
175 | __SYSCALL( 73, sys_lgetxattr, 4) | ||
176 | #define __NR_llistxattr 74 | ||
177 | __SYSCALL( 74, sys_llistxattr, 3) | ||
178 | #define __NR_lremovexattr 75 | ||
179 | __SYSCALL( 75, sys_lremovexattr, 2) | ||
180 | #define __NR_fsetxattr 76 | ||
181 | __SYSCALL( 76, sys_fsetxattr, 5) | ||
182 | #define __NR_fgetxattr 77 | ||
183 | __SYSCALL( 77, sys_fgetxattr, 4) | ||
184 | #define __NR_flistxattr 78 | ||
185 | __SYSCALL( 78, sys_flistxattr, 3) | ||
186 | #define __NR_fremovexattr 79 | ||
187 | __SYSCALL( 79, sys_fremovexattr, 2) | ||
188 | |||
189 | /* File Map / Shared Memory Operations */ | ||
190 | |||
191 | #define __NR_mmap2 80 | ||
192 | __SYSCALL( 80, sys_mmap_pgoff, 6) | ||
193 | #define __NR_munmap 81 | ||
194 | __SYSCALL( 81, sys_munmap, 2) | ||
195 | #define __NR_mprotect 82 | ||
196 | __SYSCALL( 82, sys_mprotect, 3) | ||
197 | #define __NR_brk 83 | ||
198 | __SYSCALL( 83, sys_brk, 1) | ||
199 | #define __NR_mlock 84 | ||
200 | __SYSCALL( 84, sys_mlock, 2) | ||
201 | #define __NR_munlock 85 | ||
202 | __SYSCALL( 85, sys_munlock, 2) | ||
203 | #define __NR_mlockall 86 | ||
204 | __SYSCALL( 86, sys_mlockall, 1) | ||
205 | #define __NR_munlockall 87 | ||
206 | __SYSCALL( 87, sys_munlockall, 0) | ||
207 | #define __NR_mremap 88 | ||
208 | __SYSCALL( 88, sys_mremap, 4) | ||
209 | #define __NR_msync 89 | ||
210 | __SYSCALL( 89, sys_msync, 3) | ||
211 | #define __NR_mincore 90 | ||
212 | __SYSCALL( 90, sys_mincore, 3) | ||
213 | #define __NR_madvise 91 | ||
214 | __SYSCALL( 91, sys_madvise, 3) | ||
215 | #define __NR_shmget 92 | ||
216 | __SYSCALL( 92, sys_shmget, 4) | ||
217 | #define __NR_shmat 93 | ||
218 | __SYSCALL( 93, xtensa_shmat, 4) | ||
219 | #define __NR_shmctl 94 | ||
220 | __SYSCALL( 94, sys_shmctl, 4) | ||
221 | #define __NR_shmdt 95 | ||
222 | __SYSCALL( 95, sys_shmdt, 4) | ||
223 | |||
224 | /* Socket Operations */ | ||
225 | |||
226 | #define __NR_socket 96 | ||
227 | __SYSCALL( 96, sys_socket, 3) | ||
228 | #define __NR_setsockopt 97 | ||
229 | __SYSCALL( 97, sys_setsockopt, 5) | ||
230 | #define __NR_getsockopt 98 | ||
231 | __SYSCALL( 98, sys_getsockopt, 5) | ||
232 | #define __NR_shutdown 99 | ||
233 | __SYSCALL( 99, sys_shutdown, 2) | ||
234 | |||
235 | #define __NR_bind 100 | ||
236 | __SYSCALL(100, sys_bind, 3) | ||
237 | #define __NR_connect 101 | ||
238 | __SYSCALL(101, sys_connect, 3) | ||
239 | #define __NR_listen 102 | ||
240 | __SYSCALL(102, sys_listen, 2) | ||
241 | #define __NR_accept 103 | ||
242 | __SYSCALL(103, sys_accept, 3) | ||
243 | |||
244 | #define __NR_getsockname 104 | ||
245 | __SYSCALL(104, sys_getsockname, 3) | ||
246 | #define __NR_getpeername 105 | ||
247 | __SYSCALL(105, sys_getpeername, 3) | ||
248 | #define __NR_sendmsg 106 | ||
249 | __SYSCALL(106, sys_sendmsg, 3) | ||
250 | #define __NR_recvmsg 107 | ||
251 | __SYSCALL(107, sys_recvmsg, 3) | ||
252 | #define __NR_send 108 | ||
253 | __SYSCALL(108, sys_send, 4) | ||
254 | #define __NR_recv 109 | ||
255 | __SYSCALL(109, sys_recv, 4) | ||
256 | #define __NR_sendto 110 | ||
257 | __SYSCALL(110, sys_sendto, 6) | ||
258 | #define __NR_recvfrom 111 | ||
259 | __SYSCALL(111, sys_recvfrom, 6) | ||
260 | |||
261 | #define __NR_socketpair 112 | ||
262 | __SYSCALL(112, sys_socketpair, 4) | ||
263 | #define __NR_sendfile 113 | ||
264 | __SYSCALL(113, sys_sendfile, 4) | ||
265 | #define __NR_sendfile64 114 | ||
266 | __SYSCALL(114, sys_sendfile64, 4) | ||
267 | #define __NR_sendmmsg 115 | ||
268 | __SYSCALL(115, sys_sendmmsg, 4) | ||
269 | |||
270 | /* Process Operations */ | ||
271 | |||
272 | #define __NR_clone 116 | ||
273 | __SYSCALL(116, xtensa_clone, 5) | ||
274 | #define __NR_execve 117 | ||
275 | __SYSCALL(117, xtensa_execve, 3) | ||
276 | #define __NR_exit 118 | ||
277 | __SYSCALL(118, sys_exit, 1) | ||
278 | #define __NR_exit_group 119 | ||
279 | __SYSCALL(119, sys_exit_group, 1) | ||
280 | #define __NR_getpid 120 | ||
281 | __SYSCALL(120, sys_getpid, 0) | ||
282 | #define __NR_wait4 121 | ||
283 | __SYSCALL(121, sys_wait4, 4) | ||
284 | #define __NR_waitid 122 | ||
285 | __SYSCALL(122, sys_waitid, 5) | ||
286 | #define __NR_kill 123 | ||
287 | __SYSCALL(123, sys_kill, 2) | ||
288 | #define __NR_tkill 124 | ||
289 | __SYSCALL(124, sys_tkill, 2) | ||
290 | #define __NR_tgkill 125 | ||
291 | __SYSCALL(125, sys_tgkill, 3) | ||
292 | #define __NR_set_tid_address 126 | ||
293 | __SYSCALL(126, sys_set_tid_address, 1) | ||
294 | #define __NR_gettid 127 | ||
295 | __SYSCALL(127, sys_gettid, 0) | ||
296 | #define __NR_setsid 128 | ||
297 | __SYSCALL(128, sys_setsid, 0) | ||
298 | #define __NR_getsid 129 | ||
299 | __SYSCALL(129, sys_getsid, 1) | ||
300 | #define __NR_prctl 130 | ||
301 | __SYSCALL(130, sys_prctl, 5) | ||
302 | #define __NR_personality 131 | ||
303 | __SYSCALL(131, sys_personality, 1) | ||
304 | #define __NR_getpriority 132 | ||
305 | __SYSCALL(132, sys_getpriority, 2) | ||
306 | #define __NR_setpriority 133 | ||
307 | __SYSCALL(133, sys_setpriority, 3) | ||
308 | #define __NR_setitimer 134 | ||
309 | __SYSCALL(134, sys_setitimer, 3) | ||
310 | #define __NR_getitimer 135 | ||
311 | __SYSCALL(135, sys_getitimer, 2) | ||
312 | #define __NR_setuid 136 | ||
313 | __SYSCALL(136, sys_setuid, 1) | ||
314 | #define __NR_getuid 137 | ||
315 | __SYSCALL(137, sys_getuid, 0) | ||
316 | #define __NR_setgid 138 | ||
317 | __SYSCALL(138, sys_setgid, 1) | ||
318 | #define __NR_getgid 139 | ||
319 | __SYSCALL(139, sys_getgid, 0) | ||
320 | #define __NR_geteuid 140 | ||
321 | __SYSCALL(140, sys_geteuid, 0) | ||
322 | #define __NR_getegid 141 | ||
323 | __SYSCALL(141, sys_getegid, 0) | ||
324 | #define __NR_setreuid 142 | ||
325 | __SYSCALL(142, sys_setreuid, 2) | ||
326 | #define __NR_setregid 143 | ||
327 | __SYSCALL(143, sys_setregid, 2) | ||
328 | #define __NR_setresuid 144 | ||
329 | __SYSCALL(144, sys_setresuid, 3) | ||
330 | #define __NR_getresuid 145 | ||
331 | __SYSCALL(145, sys_getresuid, 3) | ||
332 | #define __NR_setresgid 146 | ||
333 | __SYSCALL(146, sys_setresgid, 3) | ||
334 | #define __NR_getresgid 147 | ||
335 | __SYSCALL(147, sys_getresgid, 3) | ||
336 | #define __NR_setpgid 148 | ||
337 | __SYSCALL(148, sys_setpgid, 2) | ||
338 | #define __NR_getpgid 149 | ||
339 | __SYSCALL(149, sys_getpgid, 1) | ||
340 | #define __NR_getppid 150 | ||
341 | __SYSCALL(150, sys_getppid, 0) | ||
342 | #define __NR_getpgrp 151 | ||
343 | __SYSCALL(151, sys_getpgrp, 0) | ||
344 | |||
345 | #define __NR_reserved152 152 /* set_thread_area */ | ||
346 | __SYSCALL(152, sys_ni_syscall, 0) | ||
347 | #define __NR_reserved153 153 /* get_thread_area */ | ||
348 | __SYSCALL(153, sys_ni_syscall, 0) | ||
349 | #define __NR_times 154 | ||
350 | __SYSCALL(154, sys_times, 1) | ||
351 | #define __NR_acct 155 | ||
352 | __SYSCALL(155, sys_acct, 1) | ||
353 | #define __NR_sched_setaffinity 156 | ||
354 | __SYSCALL(156, sys_sched_setaffinity, 3) | ||
355 | #define __NR_sched_getaffinity 157 | ||
356 | __SYSCALL(157, sys_sched_getaffinity, 3) | ||
357 | #define __NR_capget 158 | ||
358 | __SYSCALL(158, sys_capget, 2) | ||
359 | #define __NR_capset 159 | ||
360 | __SYSCALL(159, sys_capset, 2) | ||
361 | #define __NR_ptrace 160 | ||
362 | __SYSCALL(160, sys_ptrace, 4) | ||
363 | #define __NR_semtimedop 161 | ||
364 | __SYSCALL(161, sys_semtimedop, 5) | ||
365 | #define __NR_semget 162 | ||
366 | __SYSCALL(162, sys_semget, 4) | ||
367 | #define __NR_semop 163 | ||
368 | __SYSCALL(163, sys_semop, 4) | ||
369 | #define __NR_semctl 164 | ||
370 | __SYSCALL(164, sys_semctl, 4) | ||
371 | #define __NR_available165 165 | ||
372 | __SYSCALL(165, sys_ni_syscall, 0) | ||
373 | #define __NR_msgget 166 | ||
374 | __SYSCALL(166, sys_msgget, 4) | ||
375 | #define __NR_msgsnd 167 | ||
376 | __SYSCALL(167, sys_msgsnd, 4) | ||
377 | #define __NR_msgrcv 168 | ||
378 | __SYSCALL(168, sys_msgrcv, 4) | ||
379 | #define __NR_msgctl 169 | ||
380 | __SYSCALL(169, sys_msgctl, 4) | ||
381 | #define __NR_available170 170 | ||
382 | __SYSCALL(170, sys_ni_syscall, 0) | ||
383 | |||
384 | /* File System */ | ||
385 | |||
386 | #define __NR_umount2 171 | ||
387 | __SYSCALL(171, sys_umount, 2) | ||
388 | #define __NR_mount 172 | ||
389 | __SYSCALL(172, sys_mount, 5) | ||
390 | #define __NR_swapon 173 | ||
391 | __SYSCALL(173, sys_swapon, 2) | ||
392 | #define __NR_chroot 174 | ||
393 | __SYSCALL(174, sys_chroot, 1) | ||
394 | #define __NR_pivot_root 175 | ||
395 | __SYSCALL(175, sys_pivot_root, 2) | ||
396 | #define __NR_umount 176 | ||
397 | __SYSCALL(176, sys_umount, 2) | ||
398 | #define __NR_swapoff 177 | ||
399 | __SYSCALL(177, sys_swapoff, 1) | ||
400 | #define __NR_sync 178 | ||
401 | __SYSCALL(178, sys_sync, 0) | ||
402 | #define __NR_syncfs 179 | ||
403 | __SYSCALL(179, sys_syncfs, 1) | ||
404 | #define __NR_setfsuid 180 | ||
405 | __SYSCALL(180, sys_setfsuid, 1) | ||
406 | #define __NR_setfsgid 181 | ||
407 | __SYSCALL(181, sys_setfsgid, 1) | ||
408 | #define __NR_sysfs 182 | ||
409 | __SYSCALL(182, sys_sysfs, 3) | ||
410 | #define __NR_ustat 183 | ||
411 | __SYSCALL(183, sys_ustat, 2) | ||
412 | #define __NR_statfs 184 | ||
413 | __SYSCALL(184, sys_statfs, 2) | ||
414 | #define __NR_fstatfs 185 | ||
415 | __SYSCALL(185, sys_fstatfs, 2) | ||
416 | #define __NR_statfs64 186 | ||
417 | __SYSCALL(186, sys_statfs64, 3) | ||
418 | #define __NR_fstatfs64 187 | ||
419 | __SYSCALL(187, sys_fstatfs64, 3) | ||
420 | |||
421 | /* System */ | ||
422 | |||
423 | #define __NR_setrlimit 188 | ||
424 | __SYSCALL(188, sys_setrlimit, 2) | ||
425 | #define __NR_getrlimit 189 | ||
426 | __SYSCALL(189, sys_getrlimit, 2) | ||
427 | #define __NR_getrusage 190 | ||
428 | __SYSCALL(190, sys_getrusage, 2) | ||
429 | #define __NR_futex 191 | ||
430 | __SYSCALL(191, sys_futex, 5) | ||
431 | #define __NR_gettimeofday 192 | ||
432 | __SYSCALL(192, sys_gettimeofday, 2) | ||
433 | #define __NR_settimeofday 193 | ||
434 | __SYSCALL(193, sys_settimeofday, 2) | ||
435 | #define __NR_adjtimex 194 | ||
436 | __SYSCALL(194, sys_adjtimex, 1) | ||
437 | #define __NR_nanosleep 195 | ||
438 | __SYSCALL(195, sys_nanosleep, 2) | ||
439 | #define __NR_getgroups 196 | ||
440 | __SYSCALL(196, sys_getgroups, 2) | ||
441 | #define __NR_setgroups 197 | ||
442 | __SYSCALL(197, sys_setgroups, 2) | ||
443 | #define __NR_sethostname 198 | ||
444 | __SYSCALL(198, sys_sethostname, 2) | ||
445 | #define __NR_setdomainname 199 | ||
446 | __SYSCALL(199, sys_setdomainname, 2) | ||
447 | #define __NR_syslog 200 | ||
448 | __SYSCALL(200, sys_syslog, 3) | ||
449 | #define __NR_vhangup 201 | ||
450 | __SYSCALL(201, sys_vhangup, 0) | ||
451 | #define __NR_uselib 202 | ||
452 | __SYSCALL(202, sys_uselib, 1) | ||
453 | #define __NR_reboot 203 | ||
454 | __SYSCALL(203, sys_reboot, 3) | ||
455 | #define __NR_quotactl 204 | ||
456 | __SYSCALL(204, sys_quotactl, 4) | ||
457 | #define __NR_nfsservctl 205 | ||
458 | __SYSCALL(205, sys_ni_syscall, 0) /* old nfsservctl */ | ||
459 | #define __NR__sysctl 206 | ||
460 | __SYSCALL(206, sys_sysctl, 1) | ||
461 | #define __NR_bdflush 207 | ||
462 | __SYSCALL(207, sys_bdflush, 2) | ||
463 | #define __NR_uname 208 | ||
464 | __SYSCALL(208, sys_newuname, 1) | ||
465 | #define __NR_sysinfo 209 | ||
466 | __SYSCALL(209, sys_sysinfo, 1) | ||
467 | #define __NR_init_module 210 | ||
468 | __SYSCALL(210, sys_init_module, 2) | ||
469 | #define __NR_delete_module 211 | ||
470 | __SYSCALL(211, sys_delete_module, 1) | ||
471 | |||
472 | #define __NR_sched_setparam 212 | ||
473 | __SYSCALL(212, sys_sched_setparam, 2) | ||
474 | #define __NR_sched_getparam 213 | ||
475 | __SYSCALL(213, sys_sched_getparam, 2) | ||
476 | #define __NR_sched_setscheduler 214 | ||
477 | __SYSCALL(214, sys_sched_setscheduler, 3) | ||
478 | #define __NR_sched_getscheduler 215 | ||
479 | __SYSCALL(215, sys_sched_getscheduler, 1) | ||
480 | #define __NR_sched_get_priority_max 216 | ||
481 | __SYSCALL(216, sys_sched_get_priority_max, 1) | ||
482 | #define __NR_sched_get_priority_min 217 | ||
483 | __SYSCALL(217, sys_sched_get_priority_min, 1) | ||
484 | #define __NR_sched_rr_get_interval 218 | ||
485 | __SYSCALL(218, sys_sched_rr_get_interval, 2) | ||
486 | #define __NR_sched_yield 219 | ||
487 | __SYSCALL(219, sys_sched_yield, 0) | ||
488 | #define __NR_available222 222 | ||
489 | __SYSCALL(222, sys_ni_syscall, 0) | ||
490 | |||
491 | /* Signal Handling */ | ||
492 | |||
493 | #define __NR_restart_syscall 223 | ||
494 | __SYSCALL(223, sys_restart_syscall, 0) | ||
495 | #define __NR_sigaltstack 224 | ||
496 | __SYSCALL(224, xtensa_sigaltstack, 2) | ||
497 | #define __NR_rt_sigreturn 225 | ||
498 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | ||
499 | #define __NR_rt_sigaction 226 | ||
500 | __SYSCALL(226, sys_rt_sigaction, 4) | ||
501 | #define __NR_rt_sigprocmask 227 | ||
502 | __SYSCALL(227, sys_rt_sigprocmask, 4) | ||
503 | #define __NR_rt_sigpending 228 | ||
504 | __SYSCALL(228, sys_rt_sigpending, 2) | ||
505 | #define __NR_rt_sigtimedwait 229 | ||
506 | __SYSCALL(229, sys_rt_sigtimedwait, 4) | ||
507 | #define __NR_rt_sigqueueinfo 230 | ||
508 | __SYSCALL(230, sys_rt_sigqueueinfo, 3) | ||
509 | #define __NR_rt_sigsuspend 231 | ||
510 | __SYSCALL(231, sys_rt_sigsuspend, 2) | ||
511 | |||
512 | /* Message */ | ||
513 | |||
514 | #define __NR_mq_open 232 | ||
515 | __SYSCALL(232, sys_mq_open, 4) | ||
516 | #define __NR_mq_unlink 233 | ||
517 | __SYSCALL(233, sys_mq_unlink, 1) | ||
518 | #define __NR_mq_timedsend 234 | ||
519 | __SYSCALL(234, sys_mq_timedsend, 5) | ||
520 | #define __NR_mq_timedreceive 235 | ||
521 | __SYSCALL(235, sys_mq_timedreceive, 5) | ||
522 | #define __NR_mq_notify 236 | ||
523 | __SYSCALL(236, sys_mq_notify, 2) | ||
524 | #define __NR_mq_getsetattr 237 | ||
525 | __SYSCALL(237, sys_mq_getsetattr, 3) | ||
526 | #define __NR_available238 238 | ||
527 | __SYSCALL(238, sys_ni_syscall, 0) | ||
528 | |||
529 | /* IO */ | ||
530 | |||
531 | #define __NR_io_setup 239 | ||
532 | __SYSCALL(239, sys_io_setup, 2) | ||
533 | #define __NR_io_destroy 240 | ||
534 | __SYSCALL(240, sys_io_destroy, 1) | ||
535 | #define __NR_io_submit 241 | ||
536 | __SYSCALL(241, sys_io_submit, 3) | ||
537 | #define __NR_io_getevents 242 | ||
538 | __SYSCALL(242, sys_io_getevents, 5) | ||
539 | #define __NR_io_cancel 243 | ||
540 | __SYSCALL(243, sys_io_cancel, 3) | ||
541 | #define __NR_clock_settime 244 | ||
542 | __SYSCALL(244, sys_clock_settime, 2) | ||
543 | #define __NR_clock_gettime 245 | ||
544 | __SYSCALL(245, sys_clock_gettime, 2) | ||
545 | #define __NR_clock_getres 246 | ||
546 | __SYSCALL(246, sys_clock_getres, 2) | ||
547 | #define __NR_clock_nanosleep 247 | ||
548 | __SYSCALL(247, sys_clock_nanosleep, 4) | ||
549 | |||
550 | /* Timer */ | ||
551 | |||
552 | #define __NR_timer_create 248 | ||
553 | __SYSCALL(248, sys_timer_create, 3) | ||
554 | #define __NR_timer_delete 249 | ||
555 | __SYSCALL(249, sys_timer_delete, 1) | ||
556 | #define __NR_timer_settime 250 | ||
557 | __SYSCALL(250, sys_timer_settime, 4) | ||
558 | #define __NR_timer_gettime 251 | ||
559 | __SYSCALL(251, sys_timer_gettime, 2) | ||
560 | #define __NR_timer_getoverrun 252 | ||
561 | __SYSCALL(252, sys_timer_getoverrun, 1) | ||
562 | |||
563 | /* System */ | ||
564 | |||
565 | #define __NR_reserved253 253 | ||
566 | __SYSCALL(253, sys_ni_syscall, 0) | ||
567 | #define __NR_lookup_dcookie 254 | ||
568 | __SYSCALL(254, sys_lookup_dcookie, 4) | ||
569 | #define __NR_available255 255 | ||
570 | __SYSCALL(255, sys_ni_syscall, 0) | ||
571 | #define __NR_add_key 256 | ||
572 | __SYSCALL(256, sys_add_key, 5) | ||
573 | #define __NR_request_key 257 | ||
574 | __SYSCALL(257, sys_request_key, 5) | ||
575 | #define __NR_keyctl 258 | ||
576 | __SYSCALL(258, sys_keyctl, 5) | ||
577 | #define __NR_available259 259 | ||
578 | __SYSCALL(259, sys_ni_syscall, 0) | ||
579 | |||
580 | |||
581 | #define __NR_readahead 260 | ||
582 | __SYSCALL(260, sys_readahead, 5) | ||
583 | #define __NR_remap_file_pages 261 | ||
584 | __SYSCALL(261, sys_remap_file_pages, 5) | ||
585 | #define __NR_migrate_pages 262 | ||
586 | __SYSCALL(262, sys_migrate_pages, 0) | ||
587 | #define __NR_mbind 263 | ||
588 | __SYSCALL(263, sys_mbind, 6) | ||
589 | #define __NR_get_mempolicy 264 | ||
590 | __SYSCALL(264, sys_get_mempolicy, 5) | ||
591 | #define __NR_set_mempolicy 265 | ||
592 | __SYSCALL(265, sys_set_mempolicy, 3) | ||
593 | #define __NR_unshare 266 | ||
594 | __SYSCALL(266, sys_unshare, 1) | ||
595 | #define __NR_move_pages 267 | ||
596 | __SYSCALL(267, sys_move_pages, 0) | ||
597 | #define __NR_splice 268 | ||
598 | __SYSCALL(268, sys_splice, 0) | ||
599 | #define __NR_tee 269 | ||
600 | __SYSCALL(269, sys_tee, 0) | ||
601 | #define __NR_vmsplice 270 | ||
602 | __SYSCALL(270, sys_vmsplice, 0) | ||
603 | #define __NR_available271 271 | ||
604 | __SYSCALL(271, sys_ni_syscall, 0) | ||
605 | |||
606 | #define __NR_pselect6 272 | ||
607 | __SYSCALL(272, sys_pselect6, 0) | ||
608 | #define __NR_ppoll 273 | ||
609 | __SYSCALL(273, sys_ppoll, 0) | ||
610 | #define __NR_epoll_pwait 274 | ||
611 | __SYSCALL(274, sys_epoll_pwait, 0) | ||
612 | #define __NR_epoll_create1 275 | ||
613 | __SYSCALL(275, sys_epoll_create1, 1) | ||
614 | |||
615 | #define __NR_inotify_init 276 | ||
616 | __SYSCALL(276, sys_inotify_init, 0) | ||
617 | #define __NR_inotify_add_watch 277 | ||
618 | __SYSCALL(277, sys_inotify_add_watch, 3) | ||
619 | #define __NR_inotify_rm_watch 278 | ||
620 | __SYSCALL(278, sys_inotify_rm_watch, 2) | ||
621 | #define __NR_inotify_init1 279 | ||
622 | __SYSCALL(279, sys_inotify_init1, 1) | ||
623 | |||
624 | #define __NR_getcpu 280 | ||
625 | __SYSCALL(280, sys_getcpu, 0) | ||
626 | #define __NR_kexec_load 281 | ||
627 | __SYSCALL(281, sys_ni_syscall, 0) | ||
628 | |||
629 | #define __NR_ioprio_set 282 | ||
630 | __SYSCALL(282, sys_ioprio_set, 2) | ||
631 | #define __NR_ioprio_get 283 | ||
632 | __SYSCALL(283, sys_ioprio_get, 3) | ||
633 | |||
634 | #define __NR_set_robust_list 284 | ||
635 | __SYSCALL(284, sys_set_robust_list, 3) | ||
636 | #define __NR_get_robust_list 285 | ||
637 | __SYSCALL(285, sys_get_robust_list, 3) | ||
638 | #define __NR_available286 286 | ||
639 | __SYSCALL(286, sys_ni_syscall, 0) | ||
640 | #define __NR_available287 287 | ||
641 | __SYSCALL(287, sys_ni_syscall, 0) | ||
642 | |||
643 | /* Relative File Operations */ | ||
644 | |||
645 | #define __NR_openat 288 | ||
646 | __SYSCALL(288, sys_openat, 4) | ||
647 | #define __NR_mkdirat 289 | ||
648 | __SYSCALL(289, sys_mkdirat, 3) | ||
649 | #define __NR_mknodat 290 | ||
650 | __SYSCALL(290, sys_mknodat, 4) | ||
651 | #define __NR_unlinkat 291 | ||
652 | __SYSCALL(291, sys_unlinkat, 3) | ||
653 | #define __NR_renameat 292 | ||
654 | __SYSCALL(292, sys_renameat, 4) | ||
655 | #define __NR_linkat 293 | ||
656 | __SYSCALL(293, sys_linkat, 5) | ||
657 | #define __NR_symlinkat 294 | ||
658 | __SYSCALL(294, sys_symlinkat, 3) | ||
659 | #define __NR_readlinkat 295 | ||
660 | __SYSCALL(295, sys_readlinkat, 4) | ||
661 | #define __NR_utimensat 296 | ||
662 | __SYSCALL(296, sys_utimensat, 0) | ||
663 | #define __NR_fchownat 297 | ||
664 | __SYSCALL(297, sys_fchownat, 5) | ||
665 | #define __NR_futimesat 298 | ||
666 | __SYSCALL(298, sys_futimesat, 4) | ||
667 | #define __NR_fstatat64 299 | ||
668 | __SYSCALL(299, sys_fstatat64, 0) | ||
669 | #define __NR_fchmodat 300 | ||
670 | __SYSCALL(300, sys_fchmodat, 4) | ||
671 | #define __NR_faccessat 301 | ||
672 | __SYSCALL(301, sys_faccessat, 4) | ||
673 | #define __NR_available302 302 | ||
674 | __SYSCALL(302, sys_ni_syscall, 0) | ||
675 | #define __NR_available303 303 | ||
676 | __SYSCALL(303, sys_ni_syscall, 0) | ||
677 | |||
678 | #define __NR_signalfd 304 | ||
679 | __SYSCALL(304, sys_signalfd, 3) | ||
680 | /* 305 was __NR_timerfd */ | ||
681 | __SYSCALL(305, sys_ni_syscall, 0) | ||
682 | #define __NR_eventfd 306 | ||
683 | __SYSCALL(306, sys_eventfd, 1) | ||
684 | #define __NR_recvmmsg 307 | ||
685 | __SYSCALL(307, sys_recvmmsg, 5) | ||
686 | |||
687 | #define __NR_setns 308 | ||
688 | __SYSCALL(308, sys_setns, 2) | ||
689 | #define __NR_signalfd4 309 | ||
690 | __SYSCALL(309, sys_signalfd4, 4) | ||
691 | #define __NR_dup3 310 | ||
692 | __SYSCALL(310, sys_dup3, 3) | ||
693 | #define __NR_pipe2 311 | ||
694 | __SYSCALL(311, sys_pipe2, 2) | ||
695 | |||
696 | #define __NR_timerfd_create 312 | ||
697 | __SYSCALL(312, sys_timerfd_create, 2) | ||
698 | #define __NR_timerfd_settime 313 | ||
699 | __SYSCALL(313, sys_timerfd_settime, 4) | ||
700 | #define __NR_timerfd_gettime 314 | ||
701 | __SYSCALL(314, sys_timerfd_gettime, 2) | ||
702 | #define __NR_available315 315 | ||
703 | __SYSCALL(315, sys_ni_syscall, 0) | ||
704 | |||
705 | #define __NR_eventfd2 316 | ||
706 | __SYSCALL(316, sys_eventfd2, 2) | ||
707 | #define __NR_preadv 317 | ||
708 | __SYSCALL(317, sys_preadv, 5) | ||
709 | #define __NR_pwritev 318 | ||
710 | __SYSCALL(318, sys_pwritev, 5) | ||
711 | #define __NR_available319 319 | ||
712 | __SYSCALL(319, sys_ni_syscall, 0) | ||
713 | |||
714 | #define __NR_fanotify_init 320 | ||
715 | __SYSCALL(320, sys_fanotify_init, 2) | ||
716 | #define __NR_fanotify_mark 321 | ||
717 | __SYSCALL(321, sys_fanotify_mark, 6) | ||
718 | #define __NR_process_vm_readv 322 | ||
719 | __SYSCALL(322, sys_process_vm_readv, 6) | ||
720 | #define __NR_process_vm_writev 323 | ||
721 | __SYSCALL(323, sys_process_vm_writev, 6) | ||
722 | |||
723 | #define __NR_name_to_handle_at 324 | ||
724 | __SYSCALL(324, sys_name_to_handle_at, 5) | ||
725 | #define __NR_open_by_handle_at 325 | ||
726 | __SYSCALL(325, sys_open_by_handle_at, 3) | ||
727 | #define __NR_sync_file_range 326 | ||
728 | __SYSCALL(326, sys_sync_file_range2, 6) | ||
729 | #define __NR_perf_event_open 327 | ||
730 | __SYSCALL(327, sys_perf_event_open, 5) | ||
731 | |||
732 | #define __NR_rt_tgsigqueueinfo 328 | ||
733 | __SYSCALL(328, sys_rt_tgsigqueueinfo, 4) | ||
734 | #define __NR_clock_adjtime 329 | ||
735 | __SYSCALL(329, sys_clock_adjtime, 2) | ||
736 | #define __NR_prlimit64 330 | ||
737 | __SYSCALL(330, sys_prlimit64, 4) | ||
738 | #define __NR_kcmp 331 | ||
739 | __SYSCALL(331, sys_kcmp, 5) | ||
740 | |||
741 | |||
742 | #define __NR_syscall_count 332 | ||
743 | |||
744 | /* | ||
745 | * sysxtensa syscall handler | ||
746 | * | ||
747 | * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused); | ||
748 | * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused); | ||
749 | * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused); | ||
750 | * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval); | ||
751 | * a2 a6 a3 a4 a5 | ||
752 | */ | ||
753 | |||
754 | #define SYS_XTENSA_RESERVED 0 /* don't use this */ | ||
755 | #define SYS_XTENSA_ATOMIC_SET 1 /* set variable */ | ||
756 | #define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ | ||
757 | #define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */ | ||
758 | #define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ | ||
759 | |||
760 | #define SYS_XTENSA_COUNT 5 /* count */ | ||
761 | |||
762 | #endif /* _UAPI_XTENSA_UNISTD_H */ | ||
diff --git a/arch/xtensa/kernel/align.S b/arch/xtensa/kernel/align.S index 33d6e9d2e83c..934ae58e2c79 100644 --- a/arch/xtensa/kernel/align.S +++ b/arch/xtensa/kernel/align.S | |||
@@ -170,15 +170,15 @@ ENTRY(fast_unaligned) | |||
170 | s32i a7, a2, PT_AREG7 | 170 | s32i a7, a2, PT_AREG7 |
171 | s32i a8, a2, PT_AREG8 | 171 | s32i a8, a2, PT_AREG8 |
172 | 172 | ||
173 | rsr a0, DEPC | 173 | rsr a0, depc |
174 | xsr a3, EXCSAVE_1 | 174 | xsr a3, excsave1 |
175 | s32i a0, a2, PT_AREG2 | 175 | s32i a0, a2, PT_AREG2 |
176 | s32i a3, a2, PT_AREG3 | 176 | s32i a3, a2, PT_AREG3 |
177 | 177 | ||
178 | /* Keep value of SAR in a0 */ | 178 | /* Keep value of SAR in a0 */ |
179 | 179 | ||
180 | rsr a0, SAR | 180 | rsr a0, sar |
181 | rsr a8, EXCVADDR # load unaligned memory address | 181 | rsr a8, excvaddr # load unaligned memory address |
182 | 182 | ||
183 | /* Now, identify one of the following load/store instructions. | 183 | /* Now, identify one of the following load/store instructions. |
184 | * | 184 | * |
@@ -197,7 +197,7 @@ ENTRY(fast_unaligned) | |||
197 | 197 | ||
198 | /* Extract the instruction that caused the unaligned access. */ | 198 | /* Extract the instruction that caused the unaligned access. */ |
199 | 199 | ||
200 | rsr a7, EPC_1 # load exception address | 200 | rsr a7, epc1 # load exception address |
201 | movi a3, ~3 | 201 | movi a3, ~3 |
202 | and a3, a3, a7 # mask lower bits | 202 | and a3, a3, a7 # mask lower bits |
203 | 203 | ||
@@ -275,16 +275,16 @@ ENTRY(fast_unaligned) | |||
275 | 1: | 275 | 1: |
276 | 276 | ||
277 | #if XCHAL_HAVE_LOOPS | 277 | #if XCHAL_HAVE_LOOPS |
278 | rsr a5, LEND # check if we reached LEND | 278 | rsr a5, lend # check if we reached LEND |
279 | bne a7, a5, 1f | 279 | bne a7, a5, 1f |
280 | rsr a5, LCOUNT # and LCOUNT != 0 | 280 | rsr a5, lcount # and LCOUNT != 0 |
281 | beqz a5, 1f | 281 | beqz a5, 1f |
282 | addi a5, a5, -1 # decrement LCOUNT and set | 282 | addi a5, a5, -1 # decrement LCOUNT and set |
283 | rsr a7, LBEG # set PC to LBEGIN | 283 | rsr a7, lbeg # set PC to LBEGIN |
284 | wsr a5, LCOUNT | 284 | wsr a5, lcount |
285 | #endif | 285 | #endif |
286 | 286 | ||
287 | 1: wsr a7, EPC_1 # skip load instruction | 287 | 1: wsr a7, epc1 # skip load instruction |
288 | extui a4, a4, INSN_T, 4 # extract target register | 288 | extui a4, a4, INSN_T, 4 # extract target register |
289 | movi a5, .Lload_table | 289 | movi a5, .Lload_table |
290 | addx8 a4, a4, a5 | 290 | addx8 a4, a4, a5 |
@@ -355,16 +355,16 @@ ENTRY(fast_unaligned) | |||
355 | 355 | ||
356 | 1: | 356 | 1: |
357 | #if XCHAL_HAVE_LOOPS | 357 | #if XCHAL_HAVE_LOOPS |
358 | rsr a4, LEND # check if we reached LEND | 358 | rsr a4, lend # check if we reached LEND |
359 | bne a7, a4, 1f | 359 | bne a7, a4, 1f |
360 | rsr a4, LCOUNT # and LCOUNT != 0 | 360 | rsr a4, lcount # and LCOUNT != 0 |
361 | beqz a4, 1f | 361 | beqz a4, 1f |
362 | addi a4, a4, -1 # decrement LCOUNT and set | 362 | addi a4, a4, -1 # decrement LCOUNT and set |
363 | rsr a7, LBEG # set PC to LBEGIN | 363 | rsr a7, lbeg # set PC to LBEGIN |
364 | wsr a4, LCOUNT | 364 | wsr a4, lcount |
365 | #endif | 365 | #endif |
366 | 366 | ||
367 | 1: wsr a7, EPC_1 # skip store instruction | 367 | 1: wsr a7, epc1 # skip store instruction |
368 | movi a4, ~3 | 368 | movi a4, ~3 |
369 | and a4, a4, a8 # align memory address | 369 | and a4, a4, a8 # align memory address |
370 | 370 | ||
@@ -406,7 +406,7 @@ ENTRY(fast_unaligned) | |||
406 | 406 | ||
407 | .Lexit: | 407 | .Lexit: |
408 | movi a4, 0 | 408 | movi a4, 0 |
409 | rsr a3, EXCSAVE_1 | 409 | rsr a3, excsave1 |
410 | s32i a4, a3, EXC_TABLE_FIXUP | 410 | s32i a4, a3, EXC_TABLE_FIXUP |
411 | 411 | ||
412 | /* Restore working register */ | 412 | /* Restore working register */ |
@@ -420,7 +420,7 @@ ENTRY(fast_unaligned) | |||
420 | 420 | ||
421 | /* restore SAR and return */ | 421 | /* restore SAR and return */ |
422 | 422 | ||
423 | wsr a0, SAR | 423 | wsr a0, sar |
424 | l32i a0, a2, PT_AREG0 | 424 | l32i a0, a2, PT_AREG0 |
425 | l32i a2, a2, PT_AREG2 | 425 | l32i a2, a2, PT_AREG2 |
426 | rfe | 426 | rfe |
@@ -438,10 +438,10 @@ ENTRY(fast_unaligned) | |||
438 | l32i a6, a2, PT_AREG6 | 438 | l32i a6, a2, PT_AREG6 |
439 | l32i a5, a2, PT_AREG5 | 439 | l32i a5, a2, PT_AREG5 |
440 | l32i a4, a2, PT_AREG4 | 440 | l32i a4, a2, PT_AREG4 |
441 | wsr a0, SAR | 441 | wsr a0, sar |
442 | mov a1, a2 | 442 | mov a1, a2 |
443 | 443 | ||
444 | rsr a0, PS | 444 | rsr a0, ps |
445 | bbsi.l a2, PS_UM_BIT, 1f # jump if user mode | 445 | bbsi.l a2, PS_UM_BIT, 1f # jump if user mode |
446 | 446 | ||
447 | movi a0, _kernel_exception | 447 | movi a0, _kernel_exception |
diff --git a/arch/xtensa/kernel/coprocessor.S b/arch/xtensa/kernel/coprocessor.S index 2bc1e145c0a4..54c3be313bfa 100644 --- a/arch/xtensa/kernel/coprocessor.S +++ b/arch/xtensa/kernel/coprocessor.S | |||
@@ -43,7 +43,7 @@ | |||
43 | /* IO protection is currently unsupported. */ | 43 | /* IO protection is currently unsupported. */ |
44 | 44 | ||
45 | ENTRY(fast_io_protect) | 45 | ENTRY(fast_io_protect) |
46 | wsr a0, EXCSAVE_1 | 46 | wsr a0, excsave1 |
47 | movi a0, unrecoverable_exception | 47 | movi a0, unrecoverable_exception |
48 | callx0 a0 | 48 | callx0 a0 |
49 | 49 | ||
@@ -220,7 +220,7 @@ ENTRY(coprocessor_restore) | |||
220 | */ | 220 | */ |
221 | 221 | ||
222 | ENTRY(fast_coprocessor_double) | 222 | ENTRY(fast_coprocessor_double) |
223 | wsr a0, EXCSAVE_1 | 223 | wsr a0, excsave1 |
224 | movi a0, unrecoverable_exception | 224 | movi a0, unrecoverable_exception |
225 | callx0 a0 | 225 | callx0 a0 |
226 | 226 | ||
@@ -229,13 +229,13 @@ ENTRY(fast_coprocessor) | |||
229 | 229 | ||
230 | /* Save remaining registers a1-a3 and SAR */ | 230 | /* Save remaining registers a1-a3 and SAR */ |
231 | 231 | ||
232 | xsr a3, EXCSAVE_1 | 232 | xsr a3, excsave1 |
233 | s32i a3, a2, PT_AREG3 | 233 | s32i a3, a2, PT_AREG3 |
234 | rsr a3, SAR | 234 | rsr a3, sar |
235 | s32i a1, a2, PT_AREG1 | 235 | s32i a1, a2, PT_AREG1 |
236 | s32i a3, a2, PT_SAR | 236 | s32i a3, a2, PT_SAR |
237 | mov a1, a2 | 237 | mov a1, a2 |
238 | rsr a2, DEPC | 238 | rsr a2, depc |
239 | s32i a2, a1, PT_AREG2 | 239 | s32i a2, a1, PT_AREG2 |
240 | 240 | ||
241 | /* | 241 | /* |
@@ -248,17 +248,17 @@ ENTRY(fast_coprocessor) | |||
248 | 248 | ||
249 | /* Find coprocessor number. Subtract first CP EXCCAUSE from EXCCAUSE */ | 249 | /* Find coprocessor number. Subtract first CP EXCCAUSE from EXCCAUSE */ |
250 | 250 | ||
251 | rsr a3, EXCCAUSE | 251 | rsr a3, exccause |
252 | addi a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED | 252 | addi a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED |
253 | 253 | ||
254 | /* Set corresponding CPENABLE bit -> (sar:cp-index, a3: 1<<cp-index)*/ | 254 | /* Set corresponding CPENABLE bit -> (sar:cp-index, a3: 1<<cp-index)*/ |
255 | 255 | ||
256 | ssl a3 # SAR: 32 - coprocessor_number | 256 | ssl a3 # SAR: 32 - coprocessor_number |
257 | movi a2, 1 | 257 | movi a2, 1 |
258 | rsr a0, CPENABLE | 258 | rsr a0, cpenable |
259 | sll a2, a2 | 259 | sll a2, a2 |
260 | or a0, a0, a2 | 260 | or a0, a0, a2 |
261 | wsr a0, CPENABLE | 261 | wsr a0, cpenable |
262 | rsync | 262 | rsync |
263 | 263 | ||
264 | /* Retrieve previous owner. (a3 still holds CP number) */ | 264 | /* Retrieve previous owner. (a3 still holds CP number) */ |
@@ -291,7 +291,7 @@ ENTRY(fast_coprocessor) | |||
291 | 291 | ||
292 | /* Note that only a0 and a1 were preserved. */ | 292 | /* Note that only a0 and a1 were preserved. */ |
293 | 293 | ||
294 | 2: rsr a3, EXCCAUSE | 294 | 2: rsr a3, exccause |
295 | addi a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED | 295 | addi a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED |
296 | movi a0, coprocessor_owner | 296 | movi a0, coprocessor_owner |
297 | addx4 a0, a3, a0 | 297 | addx4 a0, a3, a0 |
@@ -321,7 +321,7 @@ ENTRY(fast_coprocessor) | |||
321 | l32i a0, a1, PT_SAR | 321 | l32i a0, a1, PT_SAR |
322 | l32i a3, a1, PT_AREG3 | 322 | l32i a3, a1, PT_AREG3 |
323 | l32i a2, a1, PT_AREG2 | 323 | l32i a2, a1, PT_AREG2 |
324 | wsr a0, SAR | 324 | wsr a0, sar |
325 | l32i a0, a1, PT_AREG0 | 325 | l32i a0, a1, PT_AREG0 |
326 | l32i a1, a1, PT_AREG1 | 326 | l32i a1, a1, PT_AREG1 |
327 | 327 | ||
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 7e6236073397..18453067c258 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -112,8 +112,8 @@ ENTRY(user_exception) | |||
112 | 112 | ||
113 | /* Save a2, a3, and depc, restore excsave_1 and set SP. */ | 113 | /* Save a2, a3, and depc, restore excsave_1 and set SP. */ |
114 | 114 | ||
115 | xsr a3, EXCSAVE_1 | 115 | xsr a3, excsave1 |
116 | rsr a0, DEPC | 116 | rsr a0, depc |
117 | s32i a1, a2, PT_AREG1 | 117 | s32i a1, a2, PT_AREG1 |
118 | s32i a0, a2, PT_AREG2 | 118 | s32i a0, a2, PT_AREG2 |
119 | s32i a3, a2, PT_AREG3 | 119 | s32i a3, a2, PT_AREG3 |
@@ -125,16 +125,16 @@ _user_exception: | |||
125 | /* Save SAR and turn off single stepping */ | 125 | /* Save SAR and turn off single stepping */ |
126 | 126 | ||
127 | movi a2, 0 | 127 | movi a2, 0 |
128 | rsr a3, SAR | 128 | rsr a3, sar |
129 | xsr a2, ICOUNTLEVEL | 129 | xsr a2, icountlevel |
130 | s32i a3, a1, PT_SAR | 130 | s32i a3, a1, PT_SAR |
131 | s32i a2, a1, PT_ICOUNTLEVEL | 131 | s32i a2, a1, PT_ICOUNTLEVEL |
132 | 132 | ||
133 | /* Rotate ws so that the current windowbase is at bit0. */ | 133 | /* Rotate ws so that the current windowbase is at bit0. */ |
134 | /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */ | 134 | /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */ |
135 | 135 | ||
136 | rsr a2, WINDOWBASE | 136 | rsr a2, windowbase |
137 | rsr a3, WINDOWSTART | 137 | rsr a3, windowstart |
138 | ssr a2 | 138 | ssr a2 |
139 | s32i a2, a1, PT_WINDOWBASE | 139 | s32i a2, a1, PT_WINDOWBASE |
140 | s32i a3, a1, PT_WINDOWSTART | 140 | s32i a3, a1, PT_WINDOWSTART |
@@ -205,12 +205,12 @@ _user_exception: | |||
205 | 205 | ||
206 | /* WINDOWBASE still in SAR! */ | 206 | /* WINDOWBASE still in SAR! */ |
207 | 207 | ||
208 | rsr a2, SAR # original WINDOWBASE | 208 | rsr a2, sar # original WINDOWBASE |
209 | movi a3, 1 | 209 | movi a3, 1 |
210 | ssl a2 | 210 | ssl a2 |
211 | sll a3, a3 | 211 | sll a3, a3 |
212 | wsr a3, WINDOWSTART # set corresponding WINDOWSTART bit | 212 | wsr a3, windowstart # set corresponding WINDOWSTART bit |
213 | wsr a2, WINDOWBASE # and WINDOWSTART | 213 | wsr a2, windowbase # and WINDOWSTART |
214 | rsync | 214 | rsync |
215 | 215 | ||
216 | /* We are back to the original stack pointer (a1) */ | 216 | /* We are back to the original stack pointer (a1) */ |
@@ -252,8 +252,8 @@ ENTRY(kernel_exception) | |||
252 | 252 | ||
253 | /* Save a0, a2, a3, DEPC and set SP. */ | 253 | /* Save a0, a2, a3, DEPC and set SP. */ |
254 | 254 | ||
255 | xsr a3, EXCSAVE_1 # restore a3, excsave_1 | 255 | xsr a3, excsave1 # restore a3, excsave_1 |
256 | rsr a0, DEPC # get a2 | 256 | rsr a0, depc # get a2 |
257 | s32i a1, a2, PT_AREG1 | 257 | s32i a1, a2, PT_AREG1 |
258 | s32i a0, a2, PT_AREG2 | 258 | s32i a0, a2, PT_AREG2 |
259 | s32i a3, a2, PT_AREG3 | 259 | s32i a3, a2, PT_AREG3 |
@@ -265,16 +265,16 @@ _kernel_exception: | |||
265 | /* Save SAR and turn off single stepping */ | 265 | /* Save SAR and turn off single stepping */ |
266 | 266 | ||
267 | movi a2, 0 | 267 | movi a2, 0 |
268 | rsr a3, SAR | 268 | rsr a3, sar |
269 | xsr a2, ICOUNTLEVEL | 269 | xsr a2, icountlevel |
270 | s32i a3, a1, PT_SAR | 270 | s32i a3, a1, PT_SAR |
271 | s32i a2, a1, PT_ICOUNTLEVEL | 271 | s32i a2, a1, PT_ICOUNTLEVEL |
272 | 272 | ||
273 | /* Rotate ws so that the current windowbase is at bit0. */ | 273 | /* Rotate ws so that the current windowbase is at bit0. */ |
274 | /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */ | 274 | /* Assume ws = xxwww1yyyy. Rotate ws right, so that a2 = yyyyxxwww1 */ |
275 | 275 | ||
276 | rsr a2, WINDOWBASE # don't need to save these, we only | 276 | rsr a2, windowbase # don't need to save these, we only |
277 | rsr a3, WINDOWSTART # need shifted windowstart: windowmask | 277 | rsr a3, windowstart # need shifted windowstart: windowmask |
278 | ssr a2 | 278 | ssr a2 |
279 | slli a2, a3, 32-WSBITS | 279 | slli a2, a3, 32-WSBITS |
280 | src a2, a3, a2 | 280 | src a2, a3, a2 |
@@ -323,24 +323,24 @@ common_exception: | |||
323 | 323 | ||
324 | /* Save some registers, disable loops and clear the syscall flag. */ | 324 | /* Save some registers, disable loops and clear the syscall flag. */ |
325 | 325 | ||
326 | rsr a2, DEBUGCAUSE | 326 | rsr a2, debugcause |
327 | rsr a3, EPC_1 | 327 | rsr a3, epc1 |
328 | s32i a2, a1, PT_DEBUGCAUSE | 328 | s32i a2, a1, PT_DEBUGCAUSE |
329 | s32i a3, a1, PT_PC | 329 | s32i a3, a1, PT_PC |
330 | 330 | ||
331 | movi a2, -1 | 331 | movi a2, -1 |
332 | rsr a3, EXCVADDR | 332 | rsr a3, excvaddr |
333 | s32i a2, a1, PT_SYSCALL | 333 | s32i a2, a1, PT_SYSCALL |
334 | movi a2, 0 | 334 | movi a2, 0 |
335 | s32i a3, a1, PT_EXCVADDR | 335 | s32i a3, a1, PT_EXCVADDR |
336 | xsr a2, LCOUNT | 336 | xsr a2, lcount |
337 | s32i a2, a1, PT_LCOUNT | 337 | s32i a2, a1, PT_LCOUNT |
338 | 338 | ||
339 | /* It is now save to restore the EXC_TABLE_FIXUP variable. */ | 339 | /* It is now save to restore the EXC_TABLE_FIXUP variable. */ |
340 | 340 | ||
341 | rsr a0, EXCCAUSE | 341 | rsr a0, exccause |
342 | movi a3, 0 | 342 | movi a3, 0 |
343 | rsr a2, EXCSAVE_1 | 343 | rsr a2, excsave1 |
344 | s32i a0, a1, PT_EXCCAUSE | 344 | s32i a0, a1, PT_EXCCAUSE |
345 | s32i a3, a2, EXC_TABLE_FIXUP | 345 | s32i a3, a2, EXC_TABLE_FIXUP |
346 | 346 | ||
@@ -352,22 +352,22 @@ common_exception: | |||
352 | * (interrupts disabled) and if this exception is not an interrupt. | 352 | * (interrupts disabled) and if this exception is not an interrupt. |
353 | */ | 353 | */ |
354 | 354 | ||
355 | rsr a3, PS | 355 | rsr a3, ps |
356 | addi a0, a0, -4 | 356 | addi a0, a0, -4 |
357 | movi a2, 1 | 357 | movi a2, 1 |
358 | extui a3, a3, 0, 1 # a3 = PS.INTLEVEL[0] | 358 | extui a3, a3, 0, 1 # a3 = PS.INTLEVEL[0] |
359 | moveqz a3, a2, a0 # a3 = 1 iff interrupt exception | 359 | moveqz a3, a2, a0 # a3 = 1 iff interrupt exception |
360 | movi a2, 1 << PS_WOE_BIT | 360 | movi a2, 1 << PS_WOE_BIT |
361 | or a3, a3, a2 | 361 | or a3, a3, a2 |
362 | rsr a0, EXCCAUSE | 362 | rsr a0, exccause |
363 | xsr a3, PS | 363 | xsr a3, ps |
364 | 364 | ||
365 | s32i a3, a1, PT_PS # save ps | 365 | s32i a3, a1, PT_PS # save ps |
366 | 366 | ||
367 | /* Save LBEG, LEND */ | 367 | /* Save lbeg, lend */ |
368 | 368 | ||
369 | rsr a2, LBEG | 369 | rsr a2, lbeg |
370 | rsr a3, LEND | 370 | rsr a3, lend |
371 | s32i a2, a1, PT_LBEG | 371 | s32i a2, a1, PT_LBEG |
372 | s32i a3, a1, PT_LEND | 372 | s32i a3, a1, PT_LEND |
373 | 373 | ||
@@ -432,7 +432,7 @@ common_exception_return: | |||
432 | 432 | ||
433 | load_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT | 433 | load_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT |
434 | 434 | ||
435 | wsr a3, PS /* disable interrupts */ | 435 | wsr a3, ps /* disable interrupts */ |
436 | 436 | ||
437 | _bbci.l a3, PS_UM_BIT, kernel_exception_exit | 437 | _bbci.l a3, PS_UM_BIT, kernel_exception_exit |
438 | 438 | ||
@@ -444,12 +444,12 @@ user_exception_exit: | |||
444 | 444 | ||
445 | l32i a2, a1, PT_WINDOWBASE | 445 | l32i a2, a1, PT_WINDOWBASE |
446 | l32i a3, a1, PT_WINDOWSTART | 446 | l32i a3, a1, PT_WINDOWSTART |
447 | wsr a1, DEPC # use DEPC as temp storage | 447 | wsr a1, depc # use DEPC as temp storage |
448 | wsr a3, WINDOWSTART # restore WINDOWSTART | 448 | wsr a3, windowstart # restore WINDOWSTART |
449 | ssr a2 # preserve user's WB in the SAR | 449 | ssr a2 # preserve user's WB in the SAR |
450 | wsr a2, WINDOWBASE # switch to user's saved WB | 450 | wsr a2, windowbase # switch to user's saved WB |
451 | rsync | 451 | rsync |
452 | rsr a1, DEPC # restore stack pointer | 452 | rsr a1, depc # restore stack pointer |
453 | l32i a2, a1, PT_WMASK # register frames saved (in bits 4...9) | 453 | l32i a2, a1, PT_WMASK # register frames saved (in bits 4...9) |
454 | rotw -1 # we restore a4..a7 | 454 | rotw -1 # we restore a4..a7 |
455 | _bltui a6, 16, 1f # only have to restore current window? | 455 | _bltui a6, 16, 1f # only have to restore current window? |
@@ -475,8 +475,8 @@ user_exception_exit: | |||
475 | 475 | ||
476 | /* Clear unrestored registers (don't leak anything to user-land */ | 476 | /* Clear unrestored registers (don't leak anything to user-land */ |
477 | 477 | ||
478 | 1: rsr a0, WINDOWBASE | 478 | 1: rsr a0, windowbase |
479 | rsr a3, SAR | 479 | rsr a3, sar |
480 | sub a3, a0, a3 | 480 | sub a3, a0, a3 |
481 | beqz a3, 2f | 481 | beqz a3, 2f |
482 | extui a3, a3, 0, WBBITS | 482 | extui a3, a3, 0, WBBITS |
@@ -556,7 +556,7 @@ kernel_exception_exit: | |||
556 | 556 | ||
557 | /* Test WINDOWSTART now. If spilled, do the movsp */ | 557 | /* Test WINDOWSTART now. If spilled, do the movsp */ |
558 | 558 | ||
559 | rsr a3, WINDOWSTART | 559 | rsr a3, windowstart |
560 | addi a0, a3, -1 | 560 | addi a0, a3, -1 |
561 | and a3, a3, a0 | 561 | and a3, a3, a0 |
562 | _bnez a3, common_exception_exit | 562 | _bnez a3, common_exception_exit |
@@ -604,24 +604,24 @@ common_exception_exit: | |||
604 | 604 | ||
605 | 1: l32i a2, a1, PT_PC | 605 | 1: l32i a2, a1, PT_PC |
606 | l32i a3, a1, PT_SAR | 606 | l32i a3, a1, PT_SAR |
607 | wsr a2, EPC_1 | 607 | wsr a2, epc1 |
608 | wsr a3, SAR | 608 | wsr a3, sar |
609 | 609 | ||
610 | /* Restore LBEG, LEND, LCOUNT */ | 610 | /* Restore LBEG, LEND, LCOUNT */ |
611 | 611 | ||
612 | l32i a2, a1, PT_LBEG | 612 | l32i a2, a1, PT_LBEG |
613 | l32i a3, a1, PT_LEND | 613 | l32i a3, a1, PT_LEND |
614 | wsr a2, LBEG | 614 | wsr a2, lbeg |
615 | l32i a2, a1, PT_LCOUNT | 615 | l32i a2, a1, PT_LCOUNT |
616 | wsr a3, LEND | 616 | wsr a3, lend |
617 | wsr a2, LCOUNT | 617 | wsr a2, lcount |
618 | 618 | ||
619 | /* We control single stepping through the ICOUNTLEVEL register. */ | 619 | /* We control single stepping through the ICOUNTLEVEL register. */ |
620 | 620 | ||
621 | l32i a2, a1, PT_ICOUNTLEVEL | 621 | l32i a2, a1, PT_ICOUNTLEVEL |
622 | movi a3, -2 | 622 | movi a3, -2 |
623 | wsr a2, ICOUNTLEVEL | 623 | wsr a2, icountlevel |
624 | wsr a3, ICOUNT | 624 | wsr a3, icount |
625 | 625 | ||
626 | /* Check if it was double exception. */ | 626 | /* Check if it was double exception. */ |
627 | 627 | ||
@@ -636,7 +636,7 @@ common_exception_exit: | |||
636 | l32i a1, a1, PT_AREG1 | 636 | l32i a1, a1, PT_AREG1 |
637 | rfe | 637 | rfe |
638 | 638 | ||
639 | 1: wsr a0, DEPC | 639 | 1: wsr a0, depc |
640 | l32i a0, a1, PT_AREG0 | 640 | l32i a0, a1, PT_AREG0 |
641 | l32i a1, a1, PT_AREG1 | 641 | l32i a1, a1, PT_AREG1 |
642 | rfde | 642 | rfde |
@@ -651,25 +651,25 @@ common_exception_exit: | |||
651 | 651 | ||
652 | ENTRY(debug_exception) | 652 | ENTRY(debug_exception) |
653 | 653 | ||
654 | rsr a0, EPS + XCHAL_DEBUGLEVEL | 654 | rsr a0, SREG_EPS + XCHAL_DEBUGLEVEL |
655 | bbsi.l a0, PS_EXCM_BIT, 1f # exception mode | 655 | bbsi.l a0, PS_EXCM_BIT, 1f # exception mode |
656 | 656 | ||
657 | /* Set EPC_1 and EXCCAUSE */ | 657 | /* Set EPC1 and EXCCAUSE */ |
658 | 658 | ||
659 | wsr a2, DEPC # save a2 temporarily | 659 | wsr a2, depc # save a2 temporarily |
660 | rsr a2, EPC + XCHAL_DEBUGLEVEL | 660 | rsr a2, SREG_EPC + XCHAL_DEBUGLEVEL |
661 | wsr a2, EPC_1 | 661 | wsr a2, epc1 |
662 | 662 | ||
663 | movi a2, EXCCAUSE_MAPPED_DEBUG | 663 | movi a2, EXCCAUSE_MAPPED_DEBUG |
664 | wsr a2, EXCCAUSE | 664 | wsr a2, exccause |
665 | 665 | ||
666 | /* Restore PS to the value before the debug exc but with PS.EXCM set.*/ | 666 | /* Restore PS to the value before the debug exc but with PS.EXCM set.*/ |
667 | 667 | ||
668 | movi a2, 1 << PS_EXCM_BIT | 668 | movi a2, 1 << PS_EXCM_BIT |
669 | or a2, a0, a2 | 669 | or a2, a0, a2 |
670 | movi a0, debug_exception # restore a3, debug jump vector | 670 | movi a0, debug_exception # restore a3, debug jump vector |
671 | wsr a2, PS | 671 | wsr a2, ps |
672 | xsr a0, EXCSAVE + XCHAL_DEBUGLEVEL | 672 | xsr a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL |
673 | 673 | ||
674 | /* Switch to kernel/user stack, restore jump vector, and save a0 */ | 674 | /* Switch to kernel/user stack, restore jump vector, and save a0 */ |
675 | 675 | ||
@@ -680,19 +680,19 @@ ENTRY(debug_exception) | |||
680 | movi a0, 0 | 680 | movi a0, 0 |
681 | s32i a1, a2, PT_AREG1 | 681 | s32i a1, a2, PT_AREG1 |
682 | s32i a0, a2, PT_DEPC # mark it as a regular exception | 682 | s32i a0, a2, PT_DEPC # mark it as a regular exception |
683 | xsr a0, DEPC | 683 | xsr a0, depc |
684 | s32i a3, a2, PT_AREG3 | 684 | s32i a3, a2, PT_AREG3 |
685 | s32i a0, a2, PT_AREG2 | 685 | s32i a0, a2, PT_AREG2 |
686 | mov a1, a2 | 686 | mov a1, a2 |
687 | j _kernel_exception | 687 | j _kernel_exception |
688 | 688 | ||
689 | 2: rsr a2, EXCSAVE_1 | 689 | 2: rsr a2, excsave1 |
690 | l32i a2, a2, EXC_TABLE_KSTK # load kernel stack pointer | 690 | l32i a2, a2, EXC_TABLE_KSTK # load kernel stack pointer |
691 | s32i a0, a2, PT_AREG0 | 691 | s32i a0, a2, PT_AREG0 |
692 | movi a0, 0 | 692 | movi a0, 0 |
693 | s32i a1, a2, PT_AREG1 | 693 | s32i a1, a2, PT_AREG1 |
694 | s32i a0, a2, PT_DEPC | 694 | s32i a0, a2, PT_DEPC |
695 | xsr a0, DEPC | 695 | xsr a0, depc |
696 | s32i a3, a2, PT_AREG3 | 696 | s32i a3, a2, PT_AREG3 |
697 | s32i a0, a2, PT_AREG2 | 697 | s32i a0, a2, PT_AREG2 |
698 | mov a1, a2 | 698 | mov a1, a2 |
@@ -732,12 +732,12 @@ ENTRY(unrecoverable_exception) | |||
732 | movi a0, 1 | 732 | movi a0, 1 |
733 | movi a1, 0 | 733 | movi a1, 0 |
734 | 734 | ||
735 | wsr a0, WINDOWSTART | 735 | wsr a0, windowstart |
736 | wsr a1, WINDOWBASE | 736 | wsr a1, windowbase |
737 | rsync | 737 | rsync |
738 | 738 | ||
739 | movi a1, (1 << PS_WOE_BIT) | 1 | 739 | movi a1, (1 << PS_WOE_BIT) | 1 |
740 | wsr a1, PS | 740 | wsr a1, ps |
741 | rsync | 741 | rsync |
742 | 742 | ||
743 | movi a1, init_task | 743 | movi a1, init_task |
@@ -793,7 +793,7 @@ ENTRY(fast_alloca) | |||
793 | l32i a0, a2, PT_DEPC | 793 | l32i a0, a2, PT_DEPC |
794 | _bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, .Lunhandled_double | 794 | _bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, .Lunhandled_double |
795 | 795 | ||
796 | rsr a0, DEPC # get a2 | 796 | rsr a0, depc # get a2 |
797 | s32i a4, a2, PT_AREG4 # save a4 and | 797 | s32i a4, a2, PT_AREG4 # save a4 and |
798 | s32i a0, a2, PT_AREG2 # a2 to stack | 798 | s32i a0, a2, PT_AREG2 # a2 to stack |
799 | 799 | ||
@@ -804,8 +804,8 @@ ENTRY(fast_alloca) | |||
804 | 804 | ||
805 | /* Restore a3, excsave_1 */ | 805 | /* Restore a3, excsave_1 */ |
806 | 806 | ||
807 | xsr a3, EXCSAVE_1 # make sure excsave_1 is valid for dbl. | 807 | xsr a3, excsave1 # make sure excsave_1 is valid for dbl. |
808 | rsr a4, EPC_1 # get exception address | 808 | rsr a4, epc1 # get exception address |
809 | s32i a3, a2, PT_AREG3 # save a3 to stack | 809 | s32i a3, a2, PT_AREG3 # save a3 to stack |
810 | 810 | ||
811 | #ifdef ALLOCA_EXCEPTION_IN_IRAM | 811 | #ifdef ALLOCA_EXCEPTION_IN_IRAM |
@@ -820,7 +820,7 @@ ENTRY(fast_alloca) | |||
820 | jx a3 | 820 | jx a3 |
821 | 821 | ||
822 | .Lunhandled_double: | 822 | .Lunhandled_double: |
823 | wsr a0, EXCSAVE_1 | 823 | wsr a0, excsave1 |
824 | movi a0, unrecoverable_exception | 824 | movi a0, unrecoverable_exception |
825 | callx0 a0 | 825 | callx0 a0 |
826 | 826 | ||
@@ -852,7 +852,7 @@ ENTRY(fast_alloca) | |||
852 | #endif | 852 | #endif |
853 | addi a4, a4, 3 # step over movsp | 853 | addi a4, a4, 3 # step over movsp |
854 | _EXTUI_MOVSP_DST(a0) # extract destination register | 854 | _EXTUI_MOVSP_DST(a0) # extract destination register |
855 | wsr a4, EPC_1 # save new epc_1 | 855 | wsr a4, epc1 # save new epc_1 |
856 | 856 | ||
857 | _bnei a0, 1, 1f # no 'movsp a1, ax': jump | 857 | _bnei a0, 1, 1f # no 'movsp a1, ax': jump |
858 | 858 | ||
@@ -953,14 +953,14 @@ ENTRY(fast_syscall_kernel) | |||
953 | 953 | ||
954 | /* Skip syscall. */ | 954 | /* Skip syscall. */ |
955 | 955 | ||
956 | rsr a0, EPC_1 | 956 | rsr a0, epc1 |
957 | addi a0, a0, 3 | 957 | addi a0, a0, 3 |
958 | wsr a0, EPC_1 | 958 | wsr a0, epc1 |
959 | 959 | ||
960 | l32i a0, a2, PT_DEPC | 960 | l32i a0, a2, PT_DEPC |
961 | bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable | 961 | bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable |
962 | 962 | ||
963 | rsr a0, DEPC # get syscall-nr | 963 | rsr a0, depc # get syscall-nr |
964 | _beqz a0, fast_syscall_spill_registers | 964 | _beqz a0, fast_syscall_spill_registers |
965 | _beqi a0, __NR_xtensa, fast_syscall_xtensa | 965 | _beqi a0, __NR_xtensa, fast_syscall_xtensa |
966 | 966 | ||
@@ -970,14 +970,14 @@ ENTRY(fast_syscall_user) | |||
970 | 970 | ||
971 | /* Skip syscall. */ | 971 | /* Skip syscall. */ |
972 | 972 | ||
973 | rsr a0, EPC_1 | 973 | rsr a0, epc1 |
974 | addi a0, a0, 3 | 974 | addi a0, a0, 3 |
975 | wsr a0, EPC_1 | 975 | wsr a0, epc1 |
976 | 976 | ||
977 | l32i a0, a2, PT_DEPC | 977 | l32i a0, a2, PT_DEPC |
978 | bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable | 978 | bgeui a0, VALID_DOUBLE_EXCEPTION_ADDRESS, fast_syscall_unrecoverable |
979 | 979 | ||
980 | rsr a0, DEPC # get syscall-nr | 980 | rsr a0, depc # get syscall-nr |
981 | _beqz a0, fast_syscall_spill_registers | 981 | _beqz a0, fast_syscall_spill_registers |
982 | _beqi a0, __NR_xtensa, fast_syscall_xtensa | 982 | _beqi a0, __NR_xtensa, fast_syscall_xtensa |
983 | 983 | ||
@@ -988,10 +988,10 @@ ENTRY(fast_syscall_unrecoverable) | |||
988 | /* Restore all states. */ | 988 | /* Restore all states. */ |
989 | 989 | ||
990 | l32i a0, a2, PT_AREG0 # restore a0 | 990 | l32i a0, a2, PT_AREG0 # restore a0 |
991 | xsr a2, DEPC # restore a2, depc | 991 | xsr a2, depc # restore a2, depc |
992 | rsr a3, EXCSAVE_1 | 992 | rsr a3, excsave1 |
993 | 993 | ||
994 | wsr a0, EXCSAVE_1 | 994 | wsr a0, excsave1 |
995 | movi a0, unrecoverable_exception | 995 | movi a0, unrecoverable_exception |
996 | callx0 a0 | 996 | callx0 a0 |
997 | 997 | ||
@@ -1047,7 +1047,7 @@ ENTRY(fast_syscall_unrecoverable) | |||
1047 | 1047 | ||
1048 | ENTRY(fast_syscall_xtensa) | 1048 | ENTRY(fast_syscall_xtensa) |
1049 | 1049 | ||
1050 | xsr a3, EXCSAVE_1 # restore a3, excsave1 | 1050 | xsr a3, excsave1 # restore a3, excsave1 |
1051 | 1051 | ||
1052 | s32i a7, a2, PT_AREG7 # we need an additional register | 1052 | s32i a7, a2, PT_AREG7 # we need an additional register |
1053 | movi a7, 4 # sizeof(unsigned int) | 1053 | movi a7, 4 # sizeof(unsigned int) |
@@ -1124,13 +1124,13 @@ ENTRY(fast_syscall_spill_registers) | |||
1124 | 1124 | ||
1125 | movi a0, fast_syscall_spill_registers_fixup | 1125 | movi a0, fast_syscall_spill_registers_fixup |
1126 | s32i a0, a3, EXC_TABLE_FIXUP | 1126 | s32i a0, a3, EXC_TABLE_FIXUP |
1127 | rsr a0, WINDOWBASE | 1127 | rsr a0, windowbase |
1128 | s32i a0, a3, EXC_TABLE_PARAM | 1128 | s32i a0, a3, EXC_TABLE_PARAM |
1129 | 1129 | ||
1130 | /* Save a3 and SAR on stack. */ | 1130 | /* Save a3 and SAR on stack. */ |
1131 | 1131 | ||
1132 | rsr a0, SAR | 1132 | rsr a0, sar |
1133 | xsr a3, EXCSAVE_1 # restore a3 and excsave_1 | 1133 | xsr a3, excsave1 # restore a3 and excsave_1 |
1134 | s32i a3, a2, PT_AREG3 | 1134 | s32i a3, a2, PT_AREG3 |
1135 | s32i a4, a2, PT_AREG4 | 1135 | s32i a4, a2, PT_AREG4 |
1136 | s32i a0, a2, PT_AREG5 # store SAR to PT_AREG5 | 1136 | s32i a0, a2, PT_AREG5 # store SAR to PT_AREG5 |
@@ -1148,7 +1148,7 @@ ENTRY(fast_syscall_spill_registers) | |||
1148 | l32i a3, a2, PT_AREG5 | 1148 | l32i a3, a2, PT_AREG5 |
1149 | l32i a4, a2, PT_AREG4 | 1149 | l32i a4, a2, PT_AREG4 |
1150 | l32i a0, a2, PT_AREG0 | 1150 | l32i a0, a2, PT_AREG0 |
1151 | wsr a3, SAR | 1151 | wsr a3, sar |
1152 | l32i a3, a2, PT_AREG3 | 1152 | l32i a3, a2, PT_AREG3 |
1153 | 1153 | ||
1154 | /* Restore clobbered registers. */ | 1154 | /* Restore clobbered registers. */ |
@@ -1173,8 +1173,8 @@ ENTRY(fast_syscall_spill_registers) | |||
1173 | 1173 | ||
1174 | fast_syscall_spill_registers_fixup: | 1174 | fast_syscall_spill_registers_fixup: |
1175 | 1175 | ||
1176 | rsr a2, WINDOWBASE # get current windowbase (a2 is saved) | 1176 | rsr a2, windowbase # get current windowbase (a2 is saved) |
1177 | xsr a0, DEPC # restore depc and a0 | 1177 | xsr a0, depc # restore depc and a0 |
1178 | ssl a2 # set shift (32 - WB) | 1178 | ssl a2 # set shift (32 - WB) |
1179 | 1179 | ||
1180 | /* We need to make sure the current registers (a0-a3) are preserved. | 1180 | /* We need to make sure the current registers (a0-a3) are preserved. |
@@ -1182,12 +1182,12 @@ fast_syscall_spill_registers_fixup: | |||
1182 | * in WS, so that the exception handlers save them to the task stack. | 1182 | * in WS, so that the exception handlers save them to the task stack. |
1183 | */ | 1183 | */ |
1184 | 1184 | ||
1185 | rsr a3, EXCSAVE_1 # get spill-mask | 1185 | rsr a3, excsave1 # get spill-mask |
1186 | slli a2, a3, 1 # shift left by one | 1186 | slli a2, a3, 1 # shift left by one |
1187 | 1187 | ||
1188 | slli a3, a2, 32-WSBITS | 1188 | slli a3, a2, 32-WSBITS |
1189 | src a2, a2, a3 # a1 = xxwww1yyxxxwww1yy...... | 1189 | src a2, a2, a3 # a1 = xxwww1yyxxxwww1yy...... |
1190 | wsr a2, WINDOWSTART # set corrected windowstart | 1190 | wsr a2, windowstart # set corrected windowstart |
1191 | 1191 | ||
1192 | movi a3, exc_table | 1192 | movi a3, exc_table |
1193 | l32i a2, a3, EXC_TABLE_DOUBLE_SAVE # restore a2 | 1193 | l32i a2, a3, EXC_TABLE_DOUBLE_SAVE # restore a2 |
@@ -1201,7 +1201,7 @@ fast_syscall_spill_registers_fixup: | |||
1201 | * excsave_1: a3 | 1201 | * excsave_1: a3 |
1202 | */ | 1202 | */ |
1203 | 1203 | ||
1204 | wsr a3, WINDOWBASE | 1204 | wsr a3, windowbase |
1205 | rsync | 1205 | rsync |
1206 | 1206 | ||
1207 | /* We are now in the original frame when we entered _spill_registers: | 1207 | /* We are now in the original frame when we entered _spill_registers: |
@@ -1227,7 +1227,7 @@ fast_syscall_spill_registers_fixup: | |||
1227 | /* Jump to the exception handler. */ | 1227 | /* Jump to the exception handler. */ |
1228 | 1228 | ||
1229 | movi a3, exc_table | 1229 | movi a3, exc_table |
1230 | rsr a0, EXCCAUSE | 1230 | rsr a0, exccause |
1231 | addx4 a0, a0, a3 # find entry in table | 1231 | addx4 a0, a0, a3 # find entry in table |
1232 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler | 1232 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler |
1233 | jx a0 | 1233 | jx a0 |
@@ -1236,28 +1236,28 @@ fast_syscall_spill_registers_fixup_return: | |||
1236 | 1236 | ||
1237 | /* When we return here, all registers have been restored (a2: DEPC) */ | 1237 | /* When we return here, all registers have been restored (a2: DEPC) */ |
1238 | 1238 | ||
1239 | wsr a2, DEPC # exception address | 1239 | wsr a2, depc # exception address |
1240 | 1240 | ||
1241 | /* Restore fixup handler. */ | 1241 | /* Restore fixup handler. */ |
1242 | 1242 | ||
1243 | xsr a3, EXCSAVE_1 | 1243 | xsr a3, excsave1 |
1244 | movi a2, fast_syscall_spill_registers_fixup | 1244 | movi a2, fast_syscall_spill_registers_fixup |
1245 | s32i a2, a3, EXC_TABLE_FIXUP | 1245 | s32i a2, a3, EXC_TABLE_FIXUP |
1246 | rsr a2, WINDOWBASE | 1246 | rsr a2, windowbase |
1247 | s32i a2, a3, EXC_TABLE_PARAM | 1247 | s32i a2, a3, EXC_TABLE_PARAM |
1248 | l32i a2, a3, EXC_TABLE_KSTK | 1248 | l32i a2, a3, EXC_TABLE_KSTK |
1249 | 1249 | ||
1250 | /* Load WB at the time the exception occurred. */ | 1250 | /* Load WB at the time the exception occurred. */ |
1251 | 1251 | ||
1252 | rsr a3, SAR # WB is still in SAR | 1252 | rsr a3, sar # WB is still in SAR |
1253 | neg a3, a3 | 1253 | neg a3, a3 |
1254 | wsr a3, WINDOWBASE | 1254 | wsr a3, windowbase |
1255 | rsync | 1255 | rsync |
1256 | 1256 | ||
1257 | /* Restore a3 and return. */ | 1257 | /* Restore a3 and return. */ |
1258 | 1258 | ||
1259 | movi a3, exc_table | 1259 | movi a3, exc_table |
1260 | xsr a3, EXCSAVE_1 | 1260 | xsr a3, excsave1 |
1261 | 1261 | ||
1262 | rfde | 1262 | rfde |
1263 | 1263 | ||
@@ -1283,8 +1283,8 @@ ENTRY(_spill_registers) | |||
1283 | * Rotate ws right so that a4 = yyxxxwww1. | 1283 | * Rotate ws right so that a4 = yyxxxwww1. |
1284 | */ | 1284 | */ |
1285 | 1285 | ||
1286 | rsr a4, WINDOWBASE | 1286 | rsr a4, windowbase |
1287 | rsr a3, WINDOWSTART # a3 = xxxwww1yy | 1287 | rsr a3, windowstart # a3 = xxxwww1yy |
1288 | ssr a4 # holds WB | 1288 | ssr a4 # holds WB |
1289 | slli a4, a3, WSBITS | 1289 | slli a4, a3, WSBITS |
1290 | or a3, a3, a4 # a3 = xxxwww1yyxxxwww1yy | 1290 | or a3, a3, a4 # a3 = xxxwww1yyxxxwww1yy |
@@ -1302,7 +1302,7 @@ ENTRY(_spill_registers) | |||
1302 | 1302 | ||
1303 | /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ | 1303 | /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ |
1304 | 1304 | ||
1305 | wsr a3, WINDOWSTART # save shifted windowstart | 1305 | wsr a3, windowstart # save shifted windowstart |
1306 | neg a4, a3 | 1306 | neg a4, a3 |
1307 | and a3, a4, a3 # first bit set from right: 000010000 | 1307 | and a3, a4, a3 # first bit set from right: 000010000 |
1308 | 1308 | ||
@@ -1311,12 +1311,12 @@ ENTRY(_spill_registers) | |||
1311 | sub a4, a3, a4 # WSBITS-a4:number of 0-bits from right | 1311 | sub a4, a3, a4 # WSBITS-a4:number of 0-bits from right |
1312 | ssr a4 # save in SAR for later. | 1312 | ssr a4 # save in SAR for later. |
1313 | 1313 | ||
1314 | rsr a3, WINDOWBASE | 1314 | rsr a3, windowbase |
1315 | add a3, a3, a4 | 1315 | add a3, a3, a4 |
1316 | wsr a3, WINDOWBASE | 1316 | wsr a3, windowbase |
1317 | rsync | 1317 | rsync |
1318 | 1318 | ||
1319 | rsr a3, WINDOWSTART | 1319 | rsr a3, windowstart |
1320 | srl a3, a3 # shift windowstart | 1320 | srl a3, a3 # shift windowstart |
1321 | 1321 | ||
1322 | /* WB is now just one frame below the oldest frame in the register | 1322 | /* WB is now just one frame below the oldest frame in the register |
@@ -1364,11 +1364,11 @@ ENTRY(_spill_registers) | |||
1364 | .Lexit: /* Done. Do the final rotation, set WS, and return. */ | 1364 | .Lexit: /* Done. Do the final rotation, set WS, and return. */ |
1365 | 1365 | ||
1366 | rotw 1 | 1366 | rotw 1 |
1367 | rsr a3, WINDOWBASE | 1367 | rsr a3, windowbase |
1368 | ssl a3 | 1368 | ssl a3 |
1369 | movi a3, 1 | 1369 | movi a3, 1 |
1370 | sll a3, a3 | 1370 | sll a3, a3 |
1371 | wsr a3, WINDOWSTART | 1371 | wsr a3, windowstart |
1372 | ret | 1372 | ret |
1373 | 1373 | ||
1374 | .Lc4: s32e a4, a9, -16 | 1374 | .Lc4: s32e a4, a9, -16 |
@@ -1429,7 +1429,7 @@ ENTRY(_spill_registers) | |||
1429 | * however, this condition is unrecoverable in kernel space. | 1429 | * however, this condition is unrecoverable in kernel space. |
1430 | */ | 1430 | */ |
1431 | 1431 | ||
1432 | rsr a0, PS | 1432 | rsr a0, ps |
1433 | _bbci.l a0, PS_UM_BIT, 1f | 1433 | _bbci.l a0, PS_UM_BIT, 1f |
1434 | 1434 | ||
1435 | /* User space: Setup a dummy frame and kill application. | 1435 | /* User space: Setup a dummy frame and kill application. |
@@ -1439,18 +1439,18 @@ ENTRY(_spill_registers) | |||
1439 | movi a0, 1 | 1439 | movi a0, 1 |
1440 | movi a1, 0 | 1440 | movi a1, 0 |
1441 | 1441 | ||
1442 | wsr a0, WINDOWSTART | 1442 | wsr a0, windowstart |
1443 | wsr a1, WINDOWBASE | 1443 | wsr a1, windowbase |
1444 | rsync | 1444 | rsync |
1445 | 1445 | ||
1446 | movi a0, 0 | 1446 | movi a0, 0 |
1447 | 1447 | ||
1448 | movi a3, exc_table | 1448 | movi a3, exc_table |
1449 | l32i a1, a3, EXC_TABLE_KSTK | 1449 | l32i a1, a3, EXC_TABLE_KSTK |
1450 | wsr a3, EXCSAVE_1 | 1450 | wsr a3, excsave1 |
1451 | 1451 | ||
1452 | movi a4, (1 << PS_WOE_BIT) | 1 | 1452 | movi a4, (1 << PS_WOE_BIT) | 1 |
1453 | wsr a4, PS | 1453 | wsr a4, ps |
1454 | rsync | 1454 | rsync |
1455 | 1455 | ||
1456 | movi a6, SIGSEGV | 1456 | movi a6, SIGSEGV |
@@ -1459,7 +1459,7 @@ ENTRY(_spill_registers) | |||
1459 | 1459 | ||
1460 | 1: /* Kernel space: PANIC! */ | 1460 | 1: /* Kernel space: PANIC! */ |
1461 | 1461 | ||
1462 | wsr a0, EXCSAVE_1 | 1462 | wsr a0, excsave1 |
1463 | movi a0, unrecoverable_exception | 1463 | movi a0, unrecoverable_exception |
1464 | callx0 a0 # should not return | 1464 | callx0 a0 # should not return |
1465 | 1: j 1b | 1465 | 1: j 1b |
@@ -1524,7 +1524,7 @@ ENTRY(fast_second_level_miss) | |||
1524 | 1524 | ||
1525 | /* We deliberately destroy a3 that holds the exception table. */ | 1525 | /* We deliberately destroy a3 that holds the exception table. */ |
1526 | 1526 | ||
1527 | 8: rsr a3, EXCVADDR # fault address | 1527 | 8: rsr a3, excvaddr # fault address |
1528 | _PGD_OFFSET(a0, a3, a1) | 1528 | _PGD_OFFSET(a0, a3, a1) |
1529 | l32i a0, a0, 0 # read pmdval | 1529 | l32i a0, a0, 0 # read pmdval |
1530 | beqz a0, 2f | 1530 | beqz a0, 2f |
@@ -1542,7 +1542,7 @@ ENTRY(fast_second_level_miss) | |||
1542 | * pteval = ((pmdval - PAGE_OFFSET) & PAGE_MASK) | PAGE_DIRECTORY | 1542 | * pteval = ((pmdval - PAGE_OFFSET) & PAGE_MASK) | PAGE_DIRECTORY |
1543 | */ | 1543 | */ |
1544 | 1544 | ||
1545 | movi a1, -PAGE_OFFSET | 1545 | movi a1, (-PAGE_OFFSET) & 0xffffffff |
1546 | add a0, a0, a1 # pmdval - PAGE_OFFSET | 1546 | add a0, a0, a1 # pmdval - PAGE_OFFSET |
1547 | extui a1, a0, 0, PAGE_SHIFT # ... & PAGE_MASK | 1547 | extui a1, a0, 0, PAGE_SHIFT # ... & PAGE_MASK |
1548 | xor a0, a0, a1 | 1548 | xor a0, a0, a1 |
@@ -1561,7 +1561,7 @@ ENTRY(fast_second_level_miss) | |||
1561 | */ | 1561 | */ |
1562 | 1562 | ||
1563 | extui a3, a3, 28, 2 # addr. bit 28 and 29 0,1,2,3 | 1563 | extui a3, a3, 28, 2 # addr. bit 28 and 29 0,1,2,3 |
1564 | rsr a1, PTEVADDR | 1564 | rsr a1, ptevaddr |
1565 | addx2 a3, a3, a3 # -> 0,3,6,9 | 1565 | addx2 a3, a3, a3 # -> 0,3,6,9 |
1566 | srli a1, a1, PAGE_SHIFT | 1566 | srli a1, a1, PAGE_SHIFT |
1567 | extui a3, a3, 2, 2 # -> 0,0,1,2 | 1567 | extui a3, a3, 2, 2 # -> 0,0,1,2 |
@@ -1583,18 +1583,18 @@ ENTRY(fast_second_level_miss) | |||
1583 | l32i a0, a2, PT_AREG0 | 1583 | l32i a0, a2, PT_AREG0 |
1584 | l32i a1, a2, PT_AREG1 | 1584 | l32i a1, a2, PT_AREG1 |
1585 | l32i a2, a2, PT_DEPC | 1585 | l32i a2, a2, PT_DEPC |
1586 | xsr a3, EXCSAVE_1 | 1586 | xsr a3, excsave1 |
1587 | 1587 | ||
1588 | bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f | 1588 | bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f |
1589 | 1589 | ||
1590 | /* Restore excsave1 and return. */ | 1590 | /* Restore excsave1 and return. */ |
1591 | 1591 | ||
1592 | rsr a2, DEPC | 1592 | rsr a2, depc |
1593 | rfe | 1593 | rfe |
1594 | 1594 | ||
1595 | /* Return from double exception. */ | 1595 | /* Return from double exception. */ |
1596 | 1596 | ||
1597 | 1: xsr a2, DEPC | 1597 | 1: xsr a2, depc |
1598 | esync | 1598 | esync |
1599 | rfde | 1599 | rfde |
1600 | 1600 | ||
@@ -1618,7 +1618,7 @@ ENTRY(fast_second_level_miss) | |||
1618 | /* Make sure the exception originated in the special functions */ | 1618 | /* Make sure the exception originated in the special functions */ |
1619 | 1619 | ||
1620 | movi a0, __tlbtemp_mapping_start | 1620 | movi a0, __tlbtemp_mapping_start |
1621 | rsr a3, EPC_1 | 1621 | rsr a3, epc1 |
1622 | bltu a3, a0, 2f | 1622 | bltu a3, a0, 2f |
1623 | movi a0, __tlbtemp_mapping_end | 1623 | movi a0, __tlbtemp_mapping_end |
1624 | bgeu a3, a0, 2f | 1624 | bgeu a3, a0, 2f |
@@ -1626,7 +1626,7 @@ ENTRY(fast_second_level_miss) | |||
1626 | /* Check if excvaddr was in one of the TLBTEMP_BASE areas. */ | 1626 | /* Check if excvaddr was in one of the TLBTEMP_BASE areas. */ |
1627 | 1627 | ||
1628 | movi a3, TLBTEMP_BASE_1 | 1628 | movi a3, TLBTEMP_BASE_1 |
1629 | rsr a0, EXCVADDR | 1629 | rsr a0, excvaddr |
1630 | bltu a0, a3, 2f | 1630 | bltu a0, a3, 2f |
1631 | 1631 | ||
1632 | addi a1, a0, -(2 << (DCACHE_ALIAS_ORDER + PAGE_SHIFT)) | 1632 | addi a1, a0, -(2 << (DCACHE_ALIAS_ORDER + PAGE_SHIFT)) |
@@ -1635,7 +1635,7 @@ ENTRY(fast_second_level_miss) | |||
1635 | /* Check if we have to restore an ITLB mapping. */ | 1635 | /* Check if we have to restore an ITLB mapping. */ |
1636 | 1636 | ||
1637 | movi a1, __tlbtemp_mapping_itlb | 1637 | movi a1, __tlbtemp_mapping_itlb |
1638 | rsr a3, EPC_1 | 1638 | rsr a3, epc1 |
1639 | sub a3, a3, a1 | 1639 | sub a3, a3, a1 |
1640 | 1640 | ||
1641 | /* Calculate VPN */ | 1641 | /* Calculate VPN */ |
@@ -1671,13 +1671,13 @@ ENTRY(fast_second_level_miss) | |||
1671 | 2: /* Invalid PGD, default exception handling */ | 1671 | 2: /* Invalid PGD, default exception handling */ |
1672 | 1672 | ||
1673 | movi a3, exc_table | 1673 | movi a3, exc_table |
1674 | rsr a1, DEPC | 1674 | rsr a1, depc |
1675 | xsr a3, EXCSAVE_1 | 1675 | xsr a3, excsave1 |
1676 | s32i a1, a2, PT_AREG2 | 1676 | s32i a1, a2, PT_AREG2 |
1677 | s32i a3, a2, PT_AREG3 | 1677 | s32i a3, a2, PT_AREG3 |
1678 | mov a1, a2 | 1678 | mov a1, a2 |
1679 | 1679 | ||
1680 | rsr a2, PS | 1680 | rsr a2, ps |
1681 | bbsi.l a2, PS_UM_BIT, 1f | 1681 | bbsi.l a2, PS_UM_BIT, 1f |
1682 | j _kernel_exception | 1682 | j _kernel_exception |
1683 | 1: j _user_exception | 1683 | 1: j _user_exception |
@@ -1712,7 +1712,7 @@ ENTRY(fast_store_prohibited) | |||
1712 | l32i a0, a1, TASK_MM # tsk->mm | 1712 | l32i a0, a1, TASK_MM # tsk->mm |
1713 | beqz a0, 9f | 1713 | beqz a0, 9f |
1714 | 1714 | ||
1715 | 8: rsr a1, EXCVADDR # fault address | 1715 | 8: rsr a1, excvaddr # fault address |
1716 | _PGD_OFFSET(a0, a1, a4) | 1716 | _PGD_OFFSET(a0, a1, a4) |
1717 | l32i a0, a0, 0 | 1717 | l32i a0, a0, 0 |
1718 | beqz a0, 2f | 1718 | beqz a0, 2f |
@@ -1725,7 +1725,7 @@ ENTRY(fast_store_prohibited) | |||
1725 | 1725 | ||
1726 | movi a1, _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_HW_WRITE | 1726 | movi a1, _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_HW_WRITE |
1727 | or a4, a4, a1 | 1727 | or a4, a4, a1 |
1728 | rsr a1, EXCVADDR | 1728 | rsr a1, excvaddr |
1729 | s32i a4, a0, 0 | 1729 | s32i a4, a0, 0 |
1730 | 1730 | ||
1731 | /* We need to flush the cache if we have page coloring. */ | 1731 | /* We need to flush the cache if we have page coloring. */ |
@@ -1749,15 +1749,15 @@ ENTRY(fast_store_prohibited) | |||
1749 | 1749 | ||
1750 | /* Restore excsave1 and a3. */ | 1750 | /* Restore excsave1 and a3. */ |
1751 | 1751 | ||
1752 | xsr a3, EXCSAVE_1 | 1752 | xsr a3, excsave1 |
1753 | bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f | 1753 | bgeui a2, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f |
1754 | 1754 | ||
1755 | rsr a2, DEPC | 1755 | rsr a2, depc |
1756 | rfe | 1756 | rfe |
1757 | 1757 | ||
1758 | /* Double exception. Restore FIXUP handler and return. */ | 1758 | /* Double exception. Restore FIXUP handler and return. */ |
1759 | 1759 | ||
1760 | 1: xsr a2, DEPC | 1760 | 1: xsr a2, depc |
1761 | esync | 1761 | esync |
1762 | rfde | 1762 | rfde |
1763 | 1763 | ||
@@ -1766,14 +1766,14 @@ ENTRY(fast_store_prohibited) | |||
1766 | 1766 | ||
1767 | 2: /* If there was a problem, handle fault in C */ | 1767 | 2: /* If there was a problem, handle fault in C */ |
1768 | 1768 | ||
1769 | rsr a4, DEPC # still holds a2 | 1769 | rsr a4, depc # still holds a2 |
1770 | xsr a3, EXCSAVE_1 | 1770 | xsr a3, excsave1 |
1771 | s32i a4, a2, PT_AREG2 | 1771 | s32i a4, a2, PT_AREG2 |
1772 | s32i a3, a2, PT_AREG3 | 1772 | s32i a3, a2, PT_AREG3 |
1773 | l32i a4, a2, PT_AREG4 | 1773 | l32i a4, a2, PT_AREG4 |
1774 | mov a1, a2 | 1774 | mov a1, a2 |
1775 | 1775 | ||
1776 | rsr a2, PS | 1776 | rsr a2, ps |
1777 | bbsi.l a2, PS_UM_BIT, 1f | 1777 | bbsi.l a2, PS_UM_BIT, 1f |
1778 | j _kernel_exception | 1778 | j _kernel_exception |
1779 | 1: j _user_exception | 1779 | 1: j _user_exception |
@@ -1901,8 +1901,8 @@ ENTRY(_switch_to) | |||
1901 | /* Disable ints while we manipulate the stack pointer. */ | 1901 | /* Disable ints while we manipulate the stack pointer. */ |
1902 | 1902 | ||
1903 | movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL | 1903 | movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL |
1904 | xsr a14, PS | 1904 | xsr a14, ps |
1905 | rsr a3, EXCSAVE_1 | 1905 | rsr a3, excsave1 |
1906 | rsync | 1906 | rsync |
1907 | s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ | 1907 | s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ |
1908 | 1908 | ||
@@ -1910,7 +1910,7 @@ ENTRY(_switch_to) | |||
1910 | 1910 | ||
1911 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) | 1911 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
1912 | l32i a3, a5, THREAD_CPENABLE | 1912 | l32i a3, a5, THREAD_CPENABLE |
1913 | xsr a3, CPENABLE | 1913 | xsr a3, cpenable |
1914 | s32i a3, a4, THREAD_CPENABLE | 1914 | s32i a3, a4, THREAD_CPENABLE |
1915 | #endif | 1915 | #endif |
1916 | 1916 | ||
@@ -1924,7 +1924,7 @@ ENTRY(_switch_to) | |||
1924 | * we return from kernel space. | 1924 | * we return from kernel space. |
1925 | */ | 1925 | */ |
1926 | 1926 | ||
1927 | rsr a3, EXCSAVE_1 # exc_table | 1927 | rsr a3, excsave1 # exc_table |
1928 | movi a6, 0 | 1928 | movi a6, 0 |
1929 | addi a7, a5, PT_REGS_OFFSET | 1929 | addi a7, a5, PT_REGS_OFFSET |
1930 | s32i a6, a3, EXC_TABLE_FIXUP | 1930 | s32i a6, a3, EXC_TABLE_FIXUP |
@@ -1937,7 +1937,7 @@ ENTRY(_switch_to) | |||
1937 | 1937 | ||
1938 | load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER | 1938 | load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER |
1939 | 1939 | ||
1940 | wsr a14, PS | 1940 | wsr a14, ps |
1941 | mov a2, a12 # return 'prev' | 1941 | mov a2, a12 # return 'prev' |
1942 | rsync | 1942 | rsync |
1943 | 1943 | ||
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index 3ef91a73652d..bdc50788f35e 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S | |||
@@ -61,18 +61,18 @@ _startup: | |||
61 | /* Disable interrupts and exceptions. */ | 61 | /* Disable interrupts and exceptions. */ |
62 | 62 | ||
63 | movi a0, LOCKLEVEL | 63 | movi a0, LOCKLEVEL |
64 | wsr a0, PS | 64 | wsr a0, ps |
65 | 65 | ||
66 | /* Preserve the pointer to the boot parameter list in EXCSAVE_1 */ | 66 | /* Preserve the pointer to the boot parameter list in EXCSAVE_1 */ |
67 | 67 | ||
68 | wsr a2, EXCSAVE_1 | 68 | wsr a2, excsave1 |
69 | 69 | ||
70 | /* Start with a fresh windowbase and windowstart. */ | 70 | /* Start with a fresh windowbase and windowstart. */ |
71 | 71 | ||
72 | movi a1, 1 | 72 | movi a1, 1 |
73 | movi a0, 0 | 73 | movi a0, 0 |
74 | wsr a1, WINDOWSTART | 74 | wsr a1, windowstart |
75 | wsr a0, WINDOWBASE | 75 | wsr a0, windowbase |
76 | rsync | 76 | rsync |
77 | 77 | ||
78 | /* Set a0 to 0 for the remaining initialization. */ | 78 | /* Set a0 to 0 for the remaining initialization. */ |
@@ -82,46 +82,46 @@ _startup: | |||
82 | /* Clear debugging registers. */ | 82 | /* Clear debugging registers. */ |
83 | 83 | ||
84 | #if XCHAL_HAVE_DEBUG | 84 | #if XCHAL_HAVE_DEBUG |
85 | wsr a0, IBREAKENABLE | 85 | wsr a0, ibreakenable |
86 | wsr a0, ICOUNT | 86 | wsr a0, icount |
87 | movi a1, 15 | 87 | movi a1, 15 |
88 | wsr a0, ICOUNTLEVEL | 88 | wsr a0, icountlevel |
89 | 89 | ||
90 | .set _index, 0 | 90 | .set _index, 0 |
91 | .rept XCHAL_NUM_DBREAK - 1 | 91 | .rept XCHAL_NUM_DBREAK - 1 |
92 | wsr a0, DBREAKC + _index | 92 | wsr a0, SREG_DBREAKC + _index |
93 | .set _index, _index + 1 | 93 | .set _index, _index + 1 |
94 | .endr | 94 | .endr |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | /* Clear CCOUNT (not really necessary, but nice) */ | 97 | /* Clear CCOUNT (not really necessary, but nice) */ |
98 | 98 | ||
99 | wsr a0, CCOUNT # not really necessary, but nice | 99 | wsr a0, ccount # not really necessary, but nice |
100 | 100 | ||
101 | /* Disable zero-loops. */ | 101 | /* Disable zero-loops. */ |
102 | 102 | ||
103 | #if XCHAL_HAVE_LOOPS | 103 | #if XCHAL_HAVE_LOOPS |
104 | wsr a0, LCOUNT | 104 | wsr a0, lcount |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | /* Disable all timers. */ | 107 | /* Disable all timers. */ |
108 | 108 | ||
109 | .set _index, 0 | 109 | .set _index, 0 |
110 | .rept XCHAL_NUM_TIMERS - 1 | 110 | .rept XCHAL_NUM_TIMERS - 1 |
111 | wsr a0, CCOMPARE + _index | 111 | wsr a0, SREG_CCOMPARE + _index |
112 | .set _index, _index + 1 | 112 | .set _index, _index + 1 |
113 | .endr | 113 | .endr |
114 | 114 | ||
115 | /* Interrupt initialization. */ | 115 | /* Interrupt initialization. */ |
116 | 116 | ||
117 | movi a2, XCHAL_INTTYPE_MASK_SOFTWARE | XCHAL_INTTYPE_MASK_EXTERN_EDGE | 117 | movi a2, XCHAL_INTTYPE_MASK_SOFTWARE | XCHAL_INTTYPE_MASK_EXTERN_EDGE |
118 | wsr a0, INTENABLE | 118 | wsr a0, intenable |
119 | wsr a2, INTCLEAR | 119 | wsr a2, intclear |
120 | 120 | ||
121 | /* Disable coprocessors. */ | 121 | /* Disable coprocessors. */ |
122 | 122 | ||
123 | #if XCHAL_CP_NUM > 0 | 123 | #if XCHAL_CP_NUM > 0 |
124 | wsr a0, CPENABLE | 124 | wsr a0, cpenable |
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | /* Set PS.INTLEVEL=1, PS.WOE=0, kernel stack, PS.EXCM=0 | 127 | /* Set PS.INTLEVEL=1, PS.WOE=0, kernel stack, PS.EXCM=0 |
@@ -132,7 +132,7 @@ _startup: | |||
132 | */ | 132 | */ |
133 | 133 | ||
134 | movi a1, 1 | 134 | movi a1, 1 |
135 | wsr a1, PS | 135 | wsr a1, ps |
136 | rsync | 136 | rsync |
137 | 137 | ||
138 | /* Initialize the caches. | 138 | /* Initialize the caches. |
@@ -206,18 +206,18 @@ _startup: | |||
206 | addi a1, a1, KERNEL_STACK_SIZE | 206 | addi a1, a1, KERNEL_STACK_SIZE |
207 | 207 | ||
208 | movi a2, 0x00040001 # WOE=1, INTLEVEL=1, UM=0 | 208 | movi a2, 0x00040001 # WOE=1, INTLEVEL=1, UM=0 |
209 | wsr a2, PS # (enable reg-windows; progmode stack) | 209 | wsr a2, ps # (enable reg-windows; progmode stack) |
210 | rsync | 210 | rsync |
211 | 211 | ||
212 | /* Set up EXCSAVE[DEBUGLEVEL] to point to the Debug Exception Handler.*/ | 212 | /* Set up EXCSAVE[DEBUGLEVEL] to point to the Debug Exception Handler.*/ |
213 | 213 | ||
214 | movi a2, debug_exception | 214 | movi a2, debug_exception |
215 | wsr a2, EXCSAVE + XCHAL_DEBUGLEVEL | 215 | wsr a2, SREG_EXCSAVE + XCHAL_DEBUGLEVEL |
216 | 216 | ||
217 | /* Set up EXCSAVE[1] to point to the exc_table. */ | 217 | /* Set up EXCSAVE[1] to point to the exc_table. */ |
218 | 218 | ||
219 | movi a6, exc_table | 219 | movi a6, exc_table |
220 | xsr a6, EXCSAVE_1 | 220 | xsr a6, excsave1 |
221 | 221 | ||
222 | /* init_arch kick-starts the linux kernel */ | 222 | /* init_arch kick-starts the linux kernel */ |
223 | 223 | ||
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index 98e77c3ef1c3..a6ce3e563739 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
@@ -72,13 +72,13 @@ int arch_show_interrupts(struct seq_file *p, int prec) | |||
72 | static void xtensa_irq_mask(struct irq_data *d) | 72 | static void xtensa_irq_mask(struct irq_data *d) |
73 | { | 73 | { |
74 | cached_irq_mask &= ~(1 << d->irq); | 74 | cached_irq_mask &= ~(1 << d->irq); |
75 | set_sr (cached_irq_mask, INTENABLE); | 75 | set_sr (cached_irq_mask, intenable); |
76 | } | 76 | } |
77 | 77 | ||
78 | static void xtensa_irq_unmask(struct irq_data *d) | 78 | static void xtensa_irq_unmask(struct irq_data *d) |
79 | { | 79 | { |
80 | cached_irq_mask |= 1 << d->irq; | 80 | cached_irq_mask |= 1 << d->irq; |
81 | set_sr (cached_irq_mask, INTENABLE); | 81 | set_sr (cached_irq_mask, intenable); |
82 | } | 82 | } |
83 | 83 | ||
84 | static void xtensa_irq_enable(struct irq_data *d) | 84 | static void xtensa_irq_enable(struct irq_data *d) |
@@ -95,7 +95,7 @@ static void xtensa_irq_disable(struct irq_data *d) | |||
95 | 95 | ||
96 | static void xtensa_irq_ack(struct irq_data *d) | 96 | static void xtensa_irq_ack(struct irq_data *d) |
97 | { | 97 | { |
98 | set_sr(1 << d->irq, INTCLEAR); | 98 | set_sr(1 << d->irq, intclear); |
99 | } | 99 | } |
100 | 100 | ||
101 | static int xtensa_irq_retrigger(struct irq_data *d) | 101 | static int xtensa_irq_retrigger(struct irq_data *d) |
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index bc020825cce5..1908f6642d31 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -173,6 +173,16 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
173 | * | 173 | * |
174 | * Note: This is a pristine frame, so we don't need any spill region on top of | 174 | * Note: This is a pristine frame, so we don't need any spill region on top of |
175 | * childregs. | 175 | * childregs. |
176 | * | ||
177 | * The fun part: if we're keeping the same VM (i.e. cloning a thread, | ||
178 | * not an entire process), we're normally given a new usp, and we CANNOT share | ||
179 | * any live address register windows. If we just copy those live frames over, | ||
180 | * the two threads (parent and child) will overflow the same frames onto the | ||
181 | * parent stack at different times, likely corrupting the parent stack (esp. | ||
182 | * if the parent returns from functions that called clone() and calls new | ||
183 | * ones, before the child overflows its now old copies of its parent windows). | ||
184 | * One solution is to spill windows to the parent stack, but that's fairly | ||
185 | * involved. Much simpler to just not copy those live frames across. | ||
176 | */ | 186 | */ |
177 | 187 | ||
178 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 188 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
@@ -180,10 +190,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
180 | struct task_struct * p, struct pt_regs * regs) | 190 | struct task_struct * p, struct pt_regs * regs) |
181 | { | 191 | { |
182 | struct pt_regs *childregs; | 192 | struct pt_regs *childregs; |
183 | struct thread_info *ti; | ||
184 | unsigned long tos; | 193 | unsigned long tos; |
185 | int user_mode = user_mode(regs); | 194 | int user_mode = user_mode(regs); |
186 | 195 | ||
196 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) | ||
197 | struct thread_info *ti; | ||
198 | #endif | ||
199 | |||
187 | /* Set up new TSS. */ | 200 | /* Set up new TSS. */ |
188 | tos = (unsigned long)task_stack_page(p) + THREAD_SIZE; | 201 | tos = (unsigned long)task_stack_page(p) + THREAD_SIZE; |
189 | if (user_mode) | 202 | if (user_mode) |
@@ -191,13 +204,14 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
191 | else | 204 | else |
192 | childregs = (struct pt_regs*)tos - 1; | 205 | childregs = (struct pt_regs*)tos - 1; |
193 | 206 | ||
207 | /* This does not copy all the regs. In a bout of brilliance or madness, | ||
208 | ARs beyond a0-a15 exist past the end of the struct. */ | ||
194 | *childregs = *regs; | 209 | *childregs = *regs; |
195 | 210 | ||
196 | /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */ | 211 | /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */ |
197 | *((int*)childregs - 3) = (unsigned long)childregs; | 212 | *((int*)childregs - 3) = (unsigned long)childregs; |
198 | *((int*)childregs - 4) = 0; | 213 | *((int*)childregs - 4) = 0; |
199 | 214 | ||
200 | childregs->areg[1] = tos; | ||
201 | childregs->areg[2] = 0; | 215 | childregs->areg[2] = 0; |
202 | p->set_child_tid = p->clear_child_tid = NULL; | 216 | p->set_child_tid = p->clear_child_tid = NULL; |
203 | p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1); | 217 | p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1); |
@@ -205,10 +219,14 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
205 | 219 | ||
206 | if (user_mode(regs)) { | 220 | if (user_mode(regs)) { |
207 | 221 | ||
208 | int len = childregs->wmask & ~0xf; | ||
209 | childregs->areg[1] = usp; | 222 | childregs->areg[1] = usp; |
210 | memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4], | 223 | if (clone_flags & CLONE_VM) { |
211 | ®s->areg[XCHAL_NUM_AREGS - len/4], len); | 224 | childregs->wmask = 1; /* can't share live windows */ |
225 | } else { | ||
226 | int len = childregs->wmask & ~0xf; | ||
227 | memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4], | ||
228 | ®s->areg[XCHAL_NUM_AREGS - len/4], len); | ||
229 | } | ||
212 | // FIXME: we need to set THREADPTR in thread_info... | 230 | // FIXME: we need to set THREADPTR in thread_info... |
213 | if (clone_flags & CLONE_SETTLS) | 231 | if (clone_flags & CLONE_SETTLS) |
214 | childregs->areg[2] = childregs->areg[6]; | 232 | childregs->areg[2] = childregs->areg[6]; |
@@ -216,6 +234,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
216 | } else { | 234 | } else { |
217 | /* In kernel space, we start a new thread with a new stack. */ | 235 | /* In kernel space, we start a new thread with a new stack. */ |
218 | childregs->wmask = 1; | 236 | childregs->wmask = 1; |
237 | childregs->areg[1] = tos; | ||
219 | } | 238 | } |
220 | 239 | ||
221 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) | 240 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 270360d9806c..b237988ba6d7 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -100,7 +100,7 @@ typedef struct tagtable { | |||
100 | } tagtable_t; | 100 | } tagtable_t; |
101 | 101 | ||
102 | #define __tagtable(tag, fn) static tagtable_t __tagtable_##fn \ | 102 | #define __tagtable(tag, fn) static tagtable_t __tagtable_##fn \ |
103 | __attribute__((unused, __section__(".taglist"))) = { tag, fn } | 103 | __attribute__((used, section(".taglist"))) = { tag, fn } |
104 | 104 | ||
105 | /* parse current tag */ | 105 | /* parse current tag */ |
106 | 106 | ||
@@ -120,7 +120,7 @@ static int __init parse_tag_mem(const bp_tag_t *tag) | |||
120 | } | 120 | } |
121 | sysmem.bank[sysmem.nr_banks].type = mi->type; | 121 | sysmem.bank[sysmem.nr_banks].type = mi->type; |
122 | sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(mi->start); | 122 | sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(mi->start); |
123 | sysmem.bank[sysmem.nr_banks].end = mi->end & PAGE_SIZE; | 123 | sysmem.bank[sysmem.nr_banks].end = mi->end & PAGE_MASK; |
124 | sysmem.nr_banks++; | 124 | sysmem.nr_banks++; |
125 | 125 | ||
126 | return 0; | 126 | return 0; |
diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index 05b3f093d5d7..a5c01e74d5d5 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel/syscall.c | |||
@@ -34,7 +34,6 @@ syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= { | |||
34 | 34 | ||
35 | #undef __SYSCALL | 35 | #undef __SYSCALL |
36 | #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, | 36 | #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, |
37 | #undef _XTENSA_UNISTD_H | ||
38 | #undef __KERNEL_SYSCALLS__ | 37 | #undef __KERNEL_SYSCALLS__ |
39 | #include <asm/unistd.h> | 38 | #include <asm/unistd.h> |
40 | }; | 39 | }; |
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index bc1e14cf9369..5caf2b64d43a 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -97,7 +97,7 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = { | |||
97 | /* EXCCAUSE_INTEGER_DIVIDE_BY_ZERO unhandled */ | 97 | /* EXCCAUSE_INTEGER_DIVIDE_BY_ZERO unhandled */ |
98 | /* EXCCAUSE_PRIVILEGED unhandled */ | 98 | /* EXCCAUSE_PRIVILEGED unhandled */ |
99 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION | 99 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION |
100 | #ifdef CONFIG_UNALIGNED_USER | 100 | #ifdef CONFIG_XTENSA_UNALIGNED_USER |
101 | { EXCCAUSE_UNALIGNED, USER, fast_unaligned }, | 101 | { EXCCAUSE_UNALIGNED, USER, fast_unaligned }, |
102 | #else | 102 | #else |
103 | { EXCCAUSE_UNALIGNED, 0, do_unaligned_user }, | 103 | { EXCCAUSE_UNALIGNED, 0, do_unaligned_user }, |
@@ -202,8 +202,8 @@ extern void do_IRQ(int, struct pt_regs *); | |||
202 | 202 | ||
203 | void do_interrupt (struct pt_regs *regs) | 203 | void do_interrupt (struct pt_regs *regs) |
204 | { | 204 | { |
205 | unsigned long intread = get_sr (INTREAD); | 205 | unsigned long intread = get_sr (interrupt); |
206 | unsigned long intenable = get_sr (INTENABLE); | 206 | unsigned long intenable = get_sr (intenable); |
207 | int i, mask; | 207 | int i, mask; |
208 | 208 | ||
209 | /* Handle all interrupts (no priorities). | 209 | /* Handle all interrupts (no priorities). |
@@ -213,7 +213,7 @@ void do_interrupt (struct pt_regs *regs) | |||
213 | 213 | ||
214 | for (i=0, mask = 1; i < XCHAL_NUM_INTERRUPTS; i++, mask <<= 1) { | 214 | for (i=0, mask = 1; i < XCHAL_NUM_INTERRUPTS; i++, mask <<= 1) { |
215 | if (mask & (intread & intenable)) { | 215 | if (mask & (intread & intenable)) { |
216 | set_sr (mask, INTCLEAR); | 216 | set_sr (mask, intclear); |
217 | do_IRQ (i,regs); | 217 | do_IRQ (i,regs); |
218 | } | 218 | } |
219 | } | 219 | } |
@@ -244,7 +244,7 @@ do_illegal_instruction(struct pt_regs *regs) | |||
244 | */ | 244 | */ |
245 | 245 | ||
246 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION | 246 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION |
247 | #ifndef CONFIG_UNALIGNED_USER | 247 | #ifndef CONFIG_XTENSA_UNALIGNED_USER |
248 | void | 248 | void |
249 | do_unaligned_user (struct pt_regs *regs) | 249 | do_unaligned_user (struct pt_regs *regs) |
250 | { | 250 | { |
@@ -339,7 +339,7 @@ void __init trap_init(void) | |||
339 | /* Initialize EXCSAVE_1 to hold the address of the exception table. */ | 339 | /* Initialize EXCSAVE_1 to hold the address of the exception table. */ |
340 | 340 | ||
341 | i = (unsigned long)exc_table; | 341 | i = (unsigned long)exc_table; |
342 | __asm__ __volatile__("wsr %0, "__stringify(EXCSAVE_1)"\n" : : "a" (i)); | 342 | __asm__ __volatile__("wsr %0, excsave1\n" : : "a" (i)); |
343 | } | 343 | } |
344 | 344 | ||
345 | /* | 345 | /* |
@@ -386,16 +386,16 @@ static inline void spill_registers(void) | |||
386 | unsigned int a0, ps; | 386 | unsigned int a0, ps; |
387 | 387 | ||
388 | __asm__ __volatile__ ( | 388 | __asm__ __volatile__ ( |
389 | "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t" | 389 | "movi a14, " __stringify(PS_EXCM_BIT | 1) "\n\t" |
390 | "mov a12, a0\n\t" | 390 | "mov a12, a0\n\t" |
391 | "rsr a13," __stringify(SAR) "\n\t" | 391 | "rsr a13, sar\n\t" |
392 | "xsr a14," __stringify(PS) "\n\t" | 392 | "xsr a14, ps\n\t" |
393 | "movi a0, _spill_registers\n\t" | 393 | "movi a0, _spill_registers\n\t" |
394 | "rsync\n\t" | 394 | "rsync\n\t" |
395 | "callx0 a0\n\t" | 395 | "callx0 a0\n\t" |
396 | "mov a0, a12\n\t" | 396 | "mov a0, a12\n\t" |
397 | "wsr a13," __stringify(SAR) "\n\t" | 397 | "wsr a13, sar\n\t" |
398 | "wsr a14," __stringify(PS) "\n\t" | 398 | "wsr a14, ps\n\t" |
399 | :: "a" (&a0), "a" (&ps) | 399 | :: "a" (&a0), "a" (&ps) |
400 | : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory"); | 400 | : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory"); |
401 | } | 401 | } |
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index 70066e3582d0..4462c1e595c2 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S | |||
@@ -69,11 +69,11 @@ | |||
69 | 69 | ||
70 | ENTRY(_UserExceptionVector) | 70 | ENTRY(_UserExceptionVector) |
71 | 71 | ||
72 | xsr a3, EXCSAVE_1 # save a3 and get dispatch table | 72 | xsr a3, excsave1 # save a3 and get dispatch table |
73 | wsr a2, DEPC # save a2 | 73 | wsr a2, depc # save a2 |
74 | l32i a2, a3, EXC_TABLE_KSTK # load kernel stack to a2 | 74 | l32i a2, a3, EXC_TABLE_KSTK # load kernel stack to a2 |
75 | s32i a0, a2, PT_AREG0 # save a0 to ESF | 75 | s32i a0, a2, PT_AREG0 # save a0 to ESF |
76 | rsr a0, EXCCAUSE # retrieve exception cause | 76 | rsr a0, exccause # retrieve exception cause |
77 | s32i a0, a2, PT_DEPC # mark it as a regular exception | 77 | s32i a0, a2, PT_DEPC # mark it as a regular exception |
78 | addx4 a0, a0, a3 # find entry in table | 78 | addx4 a0, a0, a3 # find entry in table |
79 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler | 79 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler |
@@ -93,11 +93,11 @@ ENTRY(_UserExceptionVector) | |||
93 | 93 | ||
94 | ENTRY(_KernelExceptionVector) | 94 | ENTRY(_KernelExceptionVector) |
95 | 95 | ||
96 | xsr a3, EXCSAVE_1 # save a3, and get dispatch table | 96 | xsr a3, excsave1 # save a3, and get dispatch table |
97 | wsr a2, DEPC # save a2 | 97 | wsr a2, depc # save a2 |
98 | addi a2, a1, -16-PT_SIZE # adjust stack pointer | 98 | addi a2, a1, -16-PT_SIZE # adjust stack pointer |
99 | s32i a0, a2, PT_AREG0 # save a0 to ESF | 99 | s32i a0, a2, PT_AREG0 # save a0 to ESF |
100 | rsr a0, EXCCAUSE # retrieve exception cause | 100 | rsr a0, exccause # retrieve exception cause |
101 | s32i a0, a2, PT_DEPC # mark it as a regular exception | 101 | s32i a0, a2, PT_DEPC # mark it as a regular exception |
102 | addx4 a0, a0, a3 # find entry in table | 102 | addx4 a0, a0, a3 # find entry in table |
103 | l32i a0, a0, EXC_TABLE_FAST_KERNEL # load handler address | 103 | l32i a0, a0, EXC_TABLE_FAST_KERNEL # load handler address |
@@ -205,17 +205,17 @@ ENTRY(_DoubleExceptionVector) | |||
205 | 205 | ||
206 | /* Deliberately destroy excsave (don't assume it's value was valid). */ | 206 | /* Deliberately destroy excsave (don't assume it's value was valid). */ |
207 | 207 | ||
208 | wsr a3, EXCSAVE_1 # save a3 | 208 | wsr a3, excsave1 # save a3 |
209 | 209 | ||
210 | /* Check for kernel double exception (usually fatal). */ | 210 | /* Check for kernel double exception (usually fatal). */ |
211 | 211 | ||
212 | rsr a3, PS | 212 | rsr a3, ps |
213 | _bbci.l a3, PS_UM_BIT, .Lksp | 213 | _bbci.l a3, PS_UM_BIT, .Lksp |
214 | 214 | ||
215 | /* Check if we are currently handling a window exception. */ | 215 | /* Check if we are currently handling a window exception. */ |
216 | /* Note: We don't need to indicate that we enter a critical section. */ | 216 | /* Note: We don't need to indicate that we enter a critical section. */ |
217 | 217 | ||
218 | xsr a0, DEPC # get DEPC, save a0 | 218 | xsr a0, depc # get DEPC, save a0 |
219 | 219 | ||
220 | movi a3, XCHAL_WINDOW_VECTORS_VADDR | 220 | movi a3, XCHAL_WINDOW_VECTORS_VADDR |
221 | _bltu a0, a3, .Lfixup | 221 | _bltu a0, a3, .Lfixup |
@@ -243,21 +243,21 @@ ENTRY(_DoubleExceptionVector) | |||
243 | * Note: We can trash the current window frame (a0...a3) and depc! | 243 | * Note: We can trash the current window frame (a0...a3) and depc! |
244 | */ | 244 | */ |
245 | 245 | ||
246 | wsr a2, DEPC # save stack pointer temporarily | 246 | wsr a2, depc # save stack pointer temporarily |
247 | rsr a0, PS | 247 | rsr a0, ps |
248 | extui a0, a0, PS_OWB_SHIFT, 4 | 248 | extui a0, a0, PS_OWB_SHIFT, 4 |
249 | wsr a0, WINDOWBASE | 249 | wsr a0, windowbase |
250 | rsync | 250 | rsync |
251 | 251 | ||
252 | /* We are now in the previous window frame. Save registers again. */ | 252 | /* We are now in the previous window frame. Save registers again. */ |
253 | 253 | ||
254 | xsr a2, DEPC # save a2 and get stack pointer | 254 | xsr a2, depc # save a2 and get stack pointer |
255 | s32i a0, a2, PT_AREG0 | 255 | s32i a0, a2, PT_AREG0 |
256 | 256 | ||
257 | wsr a3, EXCSAVE_1 # save a3 | 257 | wsr a3, excsave1 # save a3 |
258 | movi a3, exc_table | 258 | movi a3, exc_table |
259 | 259 | ||
260 | rsr a0, EXCCAUSE | 260 | rsr a0, exccause |
261 | s32i a0, a2, PT_DEPC # mark it as a regular exception | 261 | s32i a0, a2, PT_DEPC # mark it as a regular exception |
262 | addx4 a0, a0, a3 | 262 | addx4 a0, a0, a3 |
263 | l32i a0, a0, EXC_TABLE_FAST_USER | 263 | l32i a0, a0, EXC_TABLE_FAST_USER |
@@ -290,14 +290,14 @@ ENTRY(_DoubleExceptionVector) | |||
290 | 290 | ||
291 | /* a0: depc, a1: a1, a2: kstk, a3: a2, depc: a0, excsave: a3 */ | 291 | /* a0: depc, a1: a1, a2: kstk, a3: a2, depc: a0, excsave: a3 */ |
292 | 292 | ||
293 | xsr a3, DEPC | 293 | xsr a3, depc |
294 | s32i a0, a2, PT_DEPC | 294 | s32i a0, a2, PT_DEPC |
295 | s32i a3, a2, PT_AREG0 | 295 | s32i a3, a2, PT_AREG0 |
296 | 296 | ||
297 | /* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */ | 297 | /* a0: avail, a1: a1, a2: kstk, a3: avail, depc: a2, excsave: a3 */ |
298 | 298 | ||
299 | movi a3, exc_table | 299 | movi a3, exc_table |
300 | rsr a0, EXCCAUSE | 300 | rsr a0, exccause |
301 | addx4 a0, a0, a3 | 301 | addx4 a0, a0, a3 |
302 | l32i a0, a0, EXC_TABLE_FAST_USER | 302 | l32i a0, a0, EXC_TABLE_FAST_USER |
303 | jx a0 | 303 | jx a0 |
@@ -312,7 +312,7 @@ ENTRY(_DoubleExceptionVector) | |||
312 | 312 | ||
313 | .Lksp: /* a0: a0, a1: a1, a2: a2, a3: trashed, depc: depc, excsave: a3 */ | 313 | .Lksp: /* a0: a0, a1: a1, a2: a2, a3: trashed, depc: depc, excsave: a3 */ |
314 | 314 | ||
315 | rsr a3, EXCCAUSE | 315 | rsr a3, exccause |
316 | beqi a3, EXCCAUSE_ITLB_MISS, 1f | 316 | beqi a3, EXCCAUSE_ITLB_MISS, 1f |
317 | addi a3, a3, -EXCCAUSE_DTLB_MISS | 317 | addi a3, a3, -EXCCAUSE_DTLB_MISS |
318 | bnez a3, .Lunrecoverable | 318 | bnez a3, .Lunrecoverable |
@@ -328,11 +328,11 @@ ENTRY(_DoubleExceptionVector) | |||
328 | 328 | ||
329 | .Lunrecoverable_fixup: | 329 | .Lunrecoverable_fixup: |
330 | l32i a2, a3, EXC_TABLE_DOUBLE_SAVE | 330 | l32i a2, a3, EXC_TABLE_DOUBLE_SAVE |
331 | xsr a0, DEPC | 331 | xsr a0, depc |
332 | 332 | ||
333 | .Lunrecoverable: | 333 | .Lunrecoverable: |
334 | rsr a3, EXCSAVE_1 | 334 | rsr a3, excsave1 |
335 | wsr a0, EXCSAVE_1 | 335 | wsr a0, excsave1 |
336 | movi a0, unrecoverable_exception | 336 | movi a0, unrecoverable_exception |
337 | callx0 a0 | 337 | callx0 a0 |
338 | 338 | ||
@@ -349,7 +349,7 @@ ENTRY(_DoubleExceptionVector) | |||
349 | .section .DebugInterruptVector.text, "ax" | 349 | .section .DebugInterruptVector.text, "ax" |
350 | 350 | ||
351 | ENTRY(_DebugInterruptVector) | 351 | ENTRY(_DebugInterruptVector) |
352 | xsr a0, EXCSAVE + XCHAL_DEBUGLEVEL | 352 | xsr a0, SREG_EXCSAVE + XCHAL_DEBUGLEVEL |
353 | jx a0 | 353 | jx a0 |
354 | 354 | ||
355 | 355 | ||
diff --git a/arch/xtensa/lib/memcopy.S b/arch/xtensa/lib/memcopy.S index ea59dcd03866..c48b80acb5f0 100644 --- a/arch/xtensa/lib/memcopy.S +++ b/arch/xtensa/lib/memcopy.S | |||
@@ -6,7 +6,7 @@ | |||
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
7 | * for more details. | 7 | * for more details. |
8 | * | 8 | * |
9 | * Copyright (C) 2002 - 2005 Tensilica Inc. | 9 | * Copyright (C) 2002 - 2012 Tensilica Inc. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <variant/core.h> | 12 | #include <variant/core.h> |
@@ -27,14 +27,11 @@ | |||
27 | #endif | 27 | #endif |
28 | .endm | 28 | .endm |
29 | 29 | ||
30 | |||
31 | /* | 30 | /* |
32 | * void *memcpy(void *dst, const void *src, size_t len); | 31 | * void *memcpy(void *dst, const void *src, size_t len); |
33 | * void *memmove(void *dst, const void *src, size_t len); | ||
34 | * void *bcopy(const void *src, void *dst, size_t len); | ||
35 | * | 32 | * |
36 | * This function is intended to do the same thing as the standard | 33 | * This function is intended to do the same thing as the standard |
37 | * library function memcpy() (or bcopy()) for most cases. | 34 | * library function memcpy() for most cases. |
38 | * However, where the source and/or destination references | 35 | * However, where the source and/or destination references |
39 | * an instruction RAM or ROM or a data RAM or ROM, that | 36 | * an instruction RAM or ROM or a data RAM or ROM, that |
40 | * source and/or destination will always be accessed with | 37 | * source and/or destination will always be accessed with |
@@ -45,9 +42,6 @@ | |||
45 | * !!!!!!! Handling of IRAM/IROM has not yet | 42 | * !!!!!!! Handling of IRAM/IROM has not yet |
46 | * !!!!!!! been implemented. | 43 | * !!!!!!! been implemented. |
47 | * | 44 | * |
48 | * The bcopy version is provided here to avoid the overhead | ||
49 | * of an extra call, for callers that require this convention. | ||
50 | * | ||
51 | * The (general case) algorithm is as follows: | 45 | * The (general case) algorithm is as follows: |
52 | * If destination is unaligned, align it by conditionally | 46 | * If destination is unaligned, align it by conditionally |
53 | * copying 1 and 2 bytes. | 47 | * copying 1 and 2 bytes. |
@@ -76,17 +70,6 @@ | |||
76 | */ | 70 | */ |
77 | 71 | ||
78 | .text | 72 | .text |
79 | .align 4 | ||
80 | .global bcopy | ||
81 | .type bcopy,@function | ||
82 | bcopy: | ||
83 | entry sp, 16 # minimal stack frame | ||
84 | # a2=src, a3=dst, a4=len | ||
85 | mov a5, a3 # copy dst so that a2 is return value | ||
86 | mov a3, a2 | ||
87 | mov a2, a5 | ||
88 | j .Lcommon # go to common code for memcpy+bcopy | ||
89 | |||
90 | 73 | ||
91 | /* | 74 | /* |
92 | * Byte by byte copy | 75 | * Byte by byte copy |
@@ -107,7 +90,7 @@ bcopy: | |||
107 | s8i a6, a5, 0 | 90 | s8i a6, a5, 0 |
108 | addi a5, a5, 1 | 91 | addi a5, a5, 1 |
109 | #if !XCHAL_HAVE_LOOPS | 92 | #if !XCHAL_HAVE_LOOPS |
110 | blt a3, a7, .Lnextbyte | 93 | bne a3, a7, .Lnextbyte # continue loop if $a3:src != $a7:src_end |
111 | #endif /* !XCHAL_HAVE_LOOPS */ | 94 | #endif /* !XCHAL_HAVE_LOOPS */ |
112 | .Lbytecopydone: | 95 | .Lbytecopydone: |
113 | retw | 96 | retw |
@@ -144,9 +127,6 @@ bcopy: | |||
144 | .global memcpy | 127 | .global memcpy |
145 | .type memcpy,@function | 128 | .type memcpy,@function |
146 | memcpy: | 129 | memcpy: |
147 | .global memmove | ||
148 | .type memmove,@function | ||
149 | memmove: | ||
150 | 130 | ||
151 | entry sp, 16 # minimal stack frame | 131 | entry sp, 16 # minimal stack frame |
152 | # a2/ dst, a3/ src, a4/ len | 132 | # a2/ dst, a3/ src, a4/ len |
@@ -182,7 +162,7 @@ memmove: | |||
182 | s32i a7, a5, 12 | 162 | s32i a7, a5, 12 |
183 | addi a5, a5, 16 | 163 | addi a5, a5, 16 |
184 | #if !XCHAL_HAVE_LOOPS | 164 | #if !XCHAL_HAVE_LOOPS |
185 | blt a3, a8, .Loop1 | 165 | bne a3, a8, .Loop1 # continue loop if a3:src != a8:src_end |
186 | #endif /* !XCHAL_HAVE_LOOPS */ | 166 | #endif /* !XCHAL_HAVE_LOOPS */ |
187 | .Loop1done: | 167 | .Loop1done: |
188 | bbci.l a4, 3, .L2 | 168 | bbci.l a4, 3, .L2 |
@@ -260,7 +240,7 @@ memmove: | |||
260 | s32i a9, a5, 12 | 240 | s32i a9, a5, 12 |
261 | addi a5, a5, 16 | 241 | addi a5, a5, 16 |
262 | #if !XCHAL_HAVE_LOOPS | 242 | #if !XCHAL_HAVE_LOOPS |
263 | blt a3, a10, .Loop2 | 243 | bne a3, a10, .Loop2 # continue loop if a3:src != a10:src_end |
264 | #endif /* !XCHAL_HAVE_LOOPS */ | 244 | #endif /* !XCHAL_HAVE_LOOPS */ |
265 | .Loop2done: | 245 | .Loop2done: |
266 | bbci.l a4, 3, .L12 | 246 | bbci.l a4, 3, .L12 |
@@ -305,6 +285,285 @@ memmove: | |||
305 | l8ui a6, a3, 0 | 285 | l8ui a6, a3, 0 |
306 | s8i a6, a5, 0 | 286 | s8i a6, a5, 0 |
307 | retw | 287 | retw |
288 | |||
289 | |||
290 | /* | ||
291 | * void bcopy(const void *src, void *dest, size_t n); | ||
292 | */ | ||
293 | .align 4 | ||
294 | .global bcopy | ||
295 | .type bcopy,@function | ||
296 | bcopy: | ||
297 | entry sp, 16 # minimal stack frame | ||
298 | # a2=src, a3=dst, a4=len | ||
299 | mov a5, a3 | ||
300 | mov a3, a2 | ||
301 | mov a2, a5 | ||
302 | j .Lmovecommon # go to common code for memmove+bcopy | ||
303 | |||
304 | /* | ||
305 | * void *memmove(void *dst, const void *src, size_t len); | ||
306 | * | ||
307 | * This function is intended to do the same thing as the standard | ||
308 | * library function memmove() for most cases. | ||
309 | * However, where the source and/or destination references | ||
310 | * an instruction RAM or ROM or a data RAM or ROM, that | ||
311 | * source and/or destination will always be accessed with | ||
312 | * 32-bit load and store instructions (as required for these | ||
313 | * types of devices). | ||
314 | * | ||
315 | * !!!!!!! XTFIXME: | ||
316 | * !!!!!!! Handling of IRAM/IROM has not yet | ||
317 | * !!!!!!! been implemented. | ||
318 | * | ||
319 | * The (general case) algorithm is as follows: | ||
320 | * If end of source doesn't overlap destination then use memcpy. | ||
321 | * Otherwise do memcpy backwards. | ||
322 | * | ||
323 | * Register use: | ||
324 | * a0/ return address | ||
325 | * a1/ stack pointer | ||
326 | * a2/ return value | ||
327 | * a3/ src | ||
328 | * a4/ length | ||
329 | * a5/ dst | ||
330 | * a6/ tmp | ||
331 | * a7/ tmp | ||
332 | * a8/ tmp | ||
333 | * a9/ tmp | ||
334 | * a10/ tmp | ||
335 | * a11/ tmp | ||
336 | */ | ||
337 | |||
338 | /* | ||
339 | * Byte by byte copy | ||
340 | */ | ||
341 | .align 4 | ||
342 | .byte 0 # 1 mod 4 alignment for LOOPNEZ | ||
343 | # (0 mod 4 alignment for LBEG) | ||
344 | .Lbackbytecopy: | ||
345 | #if XCHAL_HAVE_LOOPS | ||
346 | loopnez a4, .Lbackbytecopydone | ||
347 | #else /* !XCHAL_HAVE_LOOPS */ | ||
348 | beqz a4, .Lbackbytecopydone | ||
349 | sub a7, a3, a4 # a7 = start address for source | ||
350 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
351 | .Lbacknextbyte: | ||
352 | addi a3, a3, -1 | ||
353 | l8ui a6, a3, 0 | ||
354 | addi a5, a5, -1 | ||
355 | s8i a6, a5, 0 | ||
356 | #if !XCHAL_HAVE_LOOPS | ||
357 | bne a3, a7, .Lbacknextbyte # continue loop if | ||
358 | # $a3:src != $a7:src_start | ||
359 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
360 | .Lbackbytecopydone: | ||
361 | retw | ||
362 | |||
363 | /* | ||
364 | * Destination is unaligned | ||
365 | */ | ||
366 | |||
367 | .align 4 | ||
368 | .Lbackdst1mod2: # dst is only byte aligned | ||
369 | _bltui a4, 7, .Lbackbytecopy # do short copies byte by byte | ||
370 | |||
371 | # copy 1 byte | ||
372 | addi a3, a3, -1 | ||
373 | l8ui a6, a3, 0 | ||
374 | addi a5, a5, -1 | ||
375 | s8i a6, a5, 0 | ||
376 | addi a4, a4, -1 | ||
377 | _bbci.l a5, 1, .Lbackdstaligned # if dst is now aligned, then | ||
378 | # return to main algorithm | ||
379 | .Lbackdst2mod4: # dst 16-bit aligned | ||
380 | # copy 2 bytes | ||
381 | _bltui a4, 6, .Lbackbytecopy # do short copies byte by byte | ||
382 | addi a3, a3, -2 | ||
383 | l8ui a6, a3, 0 | ||
384 | l8ui a7, a3, 1 | ||
385 | addi a5, a5, -2 | ||
386 | s8i a6, a5, 0 | ||
387 | s8i a7, a5, 1 | ||
388 | addi a4, a4, -2 | ||
389 | j .Lbackdstaligned # dst is now aligned, | ||
390 | # return to main algorithm | ||
391 | |||
392 | .align 4 | ||
393 | .global memmove | ||
394 | .type memmove,@function | ||
395 | memmove: | ||
396 | |||
397 | entry sp, 16 # minimal stack frame | ||
398 | # a2/ dst, a3/ src, a4/ len | ||
399 | mov a5, a2 # copy dst so that a2 is return value | ||
400 | .Lmovecommon: | ||
401 | sub a6, a5, a3 | ||
402 | bgeu a6, a4, .Lcommon | ||
403 | |||
404 | add a5, a5, a4 | ||
405 | add a3, a3, a4 | ||
406 | |||
407 | _bbsi.l a5, 0, .Lbackdst1mod2 # if dst is 1 mod 2 | ||
408 | _bbsi.l a5, 1, .Lbackdst2mod4 # if dst is 2 mod 4 | ||
409 | .Lbackdstaligned: # return here from .Lbackdst?mod? once dst is aligned | ||
410 | srli a7, a4, 4 # number of loop iterations with 16B | ||
411 | # per iteration | ||
412 | movi a8, 3 # if source is not aligned, | ||
413 | _bany a3, a8, .Lbacksrcunaligned # then use shifting copy | ||
414 | /* | ||
415 | * Destination and source are word-aligned, use word copy. | ||
416 | */ | ||
417 | # copy 16 bytes per iteration for word-aligned dst and word-aligned src | ||
418 | #if XCHAL_HAVE_LOOPS | ||
419 | loopnez a7, .backLoop1done | ||
420 | #else /* !XCHAL_HAVE_LOOPS */ | ||
421 | beqz a7, .backLoop1done | ||
422 | slli a8, a7, 4 | ||
423 | sub a8, a3, a8 # a8 = start of first 16B source chunk | ||
424 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
425 | .backLoop1: | ||
426 | addi a3, a3, -16 | ||
427 | l32i a7, a3, 12 | ||
428 | l32i a6, a3, 8 | ||
429 | addi a5, a5, -16 | ||
430 | s32i a7, a5, 12 | ||
431 | l32i a7, a3, 4 | ||
432 | s32i a6, a5, 8 | ||
433 | l32i a6, a3, 0 | ||
434 | s32i a7, a5, 4 | ||
435 | s32i a6, a5, 0 | ||
436 | #if !XCHAL_HAVE_LOOPS | ||
437 | bne a3, a8, .backLoop1 # continue loop if a3:src != a8:src_start | ||
438 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
439 | .backLoop1done: | ||
440 | bbci.l a4, 3, .Lback2 | ||
441 | # copy 8 bytes | ||
442 | addi a3, a3, -8 | ||
443 | l32i a6, a3, 0 | ||
444 | l32i a7, a3, 4 | ||
445 | addi a5, a5, -8 | ||
446 | s32i a6, a5, 0 | ||
447 | s32i a7, a5, 4 | ||
448 | .Lback2: | ||
449 | bbsi.l a4, 2, .Lback3 | ||
450 | bbsi.l a4, 1, .Lback4 | ||
451 | bbsi.l a4, 0, .Lback5 | ||
452 | retw | ||
453 | .Lback3: | ||
454 | # copy 4 bytes | ||
455 | addi a3, a3, -4 | ||
456 | l32i a6, a3, 0 | ||
457 | addi a5, a5, -4 | ||
458 | s32i a6, a5, 0 | ||
459 | bbsi.l a4, 1, .Lback4 | ||
460 | bbsi.l a4, 0, .Lback5 | ||
461 | retw | ||
462 | .Lback4: | ||
463 | # copy 2 bytes | ||
464 | addi a3, a3, -2 | ||
465 | l16ui a6, a3, 0 | ||
466 | addi a5, a5, -2 | ||
467 | s16i a6, a5, 0 | ||
468 | bbsi.l a4, 0, .Lback5 | ||
469 | retw | ||
470 | .Lback5: | ||
471 | # copy 1 byte | ||
472 | addi a3, a3, -1 | ||
473 | l8ui a6, a3, 0 | ||
474 | addi a5, a5, -1 | ||
475 | s8i a6, a5, 0 | ||
476 | retw | ||
477 | |||
478 | /* | ||
479 | * Destination is aligned, Source is unaligned | ||
480 | */ | ||
481 | |||
482 | .align 4 | ||
483 | .Lbacksrcunaligned: | ||
484 | _beqz a4, .Lbackdone # avoid loading anything for zero-length copies | ||
485 | # copy 16 bytes per iteration for word-aligned dst and unaligned src | ||
486 | ssa8 a3 # set shift amount from byte offset | ||
487 | #define SIM_CHECKS_ALIGNMENT 1 /* set to 1 when running on ISS with | ||
488 | * the lint or ferret client, or 0 | ||
489 | * to save a few cycles */ | ||
490 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || SIM_CHECKS_ALIGNMENT | ||
491 | and a11, a3, a8 # save unalignment offset for below | ||
492 | sub a3, a3, a11 # align a3 | ||
493 | #endif | ||
494 | l32i a6, a3, 0 # load first word | ||
495 | #if XCHAL_HAVE_LOOPS | ||
496 | loopnez a7, .backLoop2done | ||
497 | #else /* !XCHAL_HAVE_LOOPS */ | ||
498 | beqz a7, .backLoop2done | ||
499 | slli a10, a7, 4 | ||
500 | sub a10, a3, a10 # a10 = start of first 16B source chunk | ||
501 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
502 | .backLoop2: | ||
503 | addi a3, a3, -16 | ||
504 | l32i a7, a3, 12 | ||
505 | l32i a8, a3, 8 | ||
506 | addi a5, a5, -16 | ||
507 | src_b a6, a7, a6 | ||
508 | s32i a6, a5, 12 | ||
509 | l32i a9, a3, 4 | ||
510 | src_b a7, a8, a7 | ||
511 | s32i a7, a5, 8 | ||
512 | l32i a6, a3, 0 | ||
513 | src_b a8, a9, a8 | ||
514 | s32i a8, a5, 4 | ||
515 | src_b a9, a6, a9 | ||
516 | s32i a9, a5, 0 | ||
517 | #if !XCHAL_HAVE_LOOPS | ||
518 | bne a3, a10, .backLoop2 # continue loop if a3:src != a10:src_start | ||
519 | #endif /* !XCHAL_HAVE_LOOPS */ | ||
520 | .backLoop2done: | ||
521 | bbci.l a4, 3, .Lback12 | ||
522 | # copy 8 bytes | ||
523 | addi a3, a3, -8 | ||
524 | l32i a7, a3, 4 | ||
525 | l32i a8, a3, 0 | ||
526 | addi a5, a5, -8 | ||
527 | src_b a6, a7, a6 | ||
528 | s32i a6, a5, 4 | ||
529 | src_b a7, a8, a7 | ||
530 | s32i a7, a5, 0 | ||
531 | mov a6, a8 | ||
532 | .Lback12: | ||
533 | bbci.l a4, 2, .Lback13 | ||
534 | # copy 4 bytes | ||
535 | addi a3, a3, -4 | ||
536 | l32i a7, a3, 0 | ||
537 | addi a5, a5, -4 | ||
538 | src_b a6, a7, a6 | ||
539 | s32i a6, a5, 0 | ||
540 | mov a6, a7 | ||
541 | .Lback13: | ||
542 | #if XCHAL_UNALIGNED_LOAD_EXCEPTION || SIM_CHECKS_ALIGNMENT | ||
543 | add a3, a3, a11 # readjust a3 with correct misalignment | ||
544 | #endif | ||
545 | bbsi.l a4, 1, .Lback14 | ||
546 | bbsi.l a4, 0, .Lback15 | ||
547 | .Lbackdone: | ||
548 | retw | ||
549 | .Lback14: | ||
550 | # copy 2 bytes | ||
551 | addi a3, a3, -2 | ||
552 | l8ui a6, a3, 0 | ||
553 | l8ui a7, a3, 1 | ||
554 | addi a5, a5, -2 | ||
555 | s8i a6, a5, 0 | ||
556 | s8i a7, a5, 1 | ||
557 | bbsi.l a4, 0, .Lback15 | ||
558 | retw | ||
559 | .Lback15: | ||
560 | # copy 1 byte | ||
561 | addi a3, a3, -1 | ||
562 | addi a5, a5, -1 | ||
563 | l8ui a6, a3, 0 | ||
564 | s8i a6, a5, 0 | ||
565 | retw | ||
566 | |||
308 | 567 | ||
309 | /* | 568 | /* |
310 | * Local Variables: | 569 | * Local Variables: |
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c index 2c2f710ed1dc..245b08f7eaf4 100644 --- a/arch/xtensa/mm/fault.c +++ b/arch/xtensa/mm/fault.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
7 | * for more details. | 7 | * for more details. |
8 | * | 8 | * |
9 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 9 | * Copyright (C) 2001 - 2010 Tensilica Inc. |
10 | * | 10 | * |
11 | * Chris Zankel <chris@zankel.net> | 11 | * Chris Zankel <chris@zankel.net> |
12 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> | 12 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> |
@@ -186,6 +186,7 @@ do_sigbus: | |||
186 | /* Kernel mode? Handle exceptions or die */ | 186 | /* Kernel mode? Handle exceptions or die */ |
187 | if (!user_mode(regs)) | 187 | if (!user_mode(regs)) |
188 | bad_page_fault(regs, address, SIGBUS); | 188 | bad_page_fault(regs, address, SIGBUS); |
189 | return; | ||
189 | 190 | ||
190 | vmalloc_fault: | 191 | vmalloc_fault: |
191 | { | 192 | { |
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 8ab47edd7c82..7e74895eee04 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c | |||
@@ -91,7 +91,7 @@ static int rs_write(struct tty_struct * tty, | |||
91 | { | 91 | { |
92 | /* see drivers/char/serialX.c to reference original version */ | 92 | /* see drivers/char/serialX.c to reference original version */ |
93 | 93 | ||
94 | __simc (SYS_write, 1, (unsigned long)buf, count, 0, 0); | 94 | simc_write(1, buf, count); |
95 | return count; | 95 | return count; |
96 | } | 96 | } |
97 | 97 | ||
@@ -122,12 +122,7 @@ static void rs_poll(unsigned long priv) | |||
122 | 122 | ||
123 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) | 123 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) |
124 | { | 124 | { |
125 | char buf[2]; | 125 | return rs_write(tty, &ch, 1); |
126 | |||
127 | buf[0] = ch; | ||
128 | buf[1] = '\0'; /* Is this NULL necessary? */ | ||
129 | __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0); | ||
130 | return 1; | ||
131 | } | 126 | } |
132 | 127 | ||
133 | static void rs_flush_chars(struct tty_struct *tty) | 128 | static void rs_flush_chars(struct tty_struct *tty) |
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h index 8c43bfea05e1..bd78192e2fc9 100644 --- a/arch/xtensa/platforms/iss/include/platform/simcall.h +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h | |||
@@ -78,8 +78,9 @@ static inline int __simc(int a, int b, int c, int d, int e, int f) | |||
78 | return ret; | 78 | return ret; |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int simc_open(char *file, int flags, int mode) | 81 | static inline int simc_open(const char *file, int flags, int mode) |
82 | { | 82 | { |
83 | wmb(); | ||
83 | return __simc(SYS_open, (int) file, flags, mode, 0, 0); | 84 | return __simc(SYS_open, (int) file, flags, mode, 0, 0); |
84 | } | 85 | } |
85 | 86 | ||
@@ -90,16 +91,19 @@ static inline int simc_close(int fd) | |||
90 | 91 | ||
91 | static inline int simc_ioctl(int fd, int request, void *arg) | 92 | static inline int simc_ioctl(int fd, int request, void *arg) |
92 | { | 93 | { |
94 | wmb(); | ||
93 | return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); | 95 | return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); |
94 | } | 96 | } |
95 | 97 | ||
96 | static inline int simc_read(int fd, void *buf, size_t count) | 98 | static inline int simc_read(int fd, void *buf, size_t count) |
97 | { | 99 | { |
100 | rmb(); | ||
98 | return __simc(SYS_read, fd, (int) buf, count, 0, 0); | 101 | return __simc(SYS_read, fd, (int) buf, count, 0, 0); |
99 | } | 102 | } |
100 | 103 | ||
101 | static inline int simc_write(int fd, void *buf, size_t count) | 104 | static inline int simc_write(int fd, const void *buf, size_t count) |
102 | { | 105 | { |
106 | wmb(); | ||
103 | return __simc(SYS_write, fd, (int) buf, count, 0, 0); | 107 | return __simc(SYS_write, fd, (int) buf, count, 0, 0); |
104 | } | 108 | } |
105 | 109 | ||
@@ -107,6 +111,7 @@ static inline int simc_poll(int fd) | |||
107 | { | 111 | { |
108 | struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; | 112 | struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; |
109 | 113 | ||
114 | wmb(); | ||
110 | return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv, | 115 | return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv, |
111 | 0, 0); | 116 | 0, 0); |
112 | } | 117 | } |
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index 927acf378ea3..e1700102f35e 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c | |||
@@ -61,13 +61,13 @@ void platform_restart(void) | |||
61 | * jump to the reset vector. */ | 61 | * jump to the reset vector. */ |
62 | 62 | ||
63 | __asm__ __volatile__("movi a2, 15\n\t" | 63 | __asm__ __volatile__("movi a2, 15\n\t" |
64 | "wsr a2, " __stringify(ICOUNTLEVEL) "\n\t" | 64 | "wsr a2, icountlevel\n\t" |
65 | "movi a2, 0\n\t" | 65 | "movi a2, 0\n\t" |
66 | "wsr a2, " __stringify(ICOUNT) "\n\t" | 66 | "wsr a2, icount\n\t" |
67 | "wsr a2, " __stringify(IBREAKENABLE) "\n\t" | 67 | "wsr a2, ibreakenable\n\t" |
68 | "wsr a2, " __stringify(LCOUNT) "\n\t" | 68 | "wsr a2, lcount\n\t" |
69 | "movi a2, 0x1f\n\t" | 69 | "movi a2, 0x1f\n\t" |
70 | "wsr a2, " __stringify(PS) "\n\t" | 70 | "wsr a2, ps\n\t" |
71 | "isync\n\t" | 71 | "isync\n\t" |
72 | "jx %0\n\t" | 72 | "jx %0\n\t" |
73 | : | 73 | : |
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c index 9e83940ac265..c7d90f17886e 100644 --- a/arch/xtensa/platforms/xt2000/setup.c +++ b/arch/xtensa/platforms/xt2000/setup.c | |||
@@ -66,13 +66,13 @@ void platform_restart(void) | |||
66 | * jump to the reset vector. */ | 66 | * jump to the reset vector. */ |
67 | 67 | ||
68 | __asm__ __volatile__ ("movi a2, 15\n\t" | 68 | __asm__ __volatile__ ("movi a2, 15\n\t" |
69 | "wsr a2, " __stringify(ICOUNTLEVEL) "\n\t" | 69 | "wsr a2, icountlevel\n\t" |
70 | "movi a2, 0\n\t" | 70 | "movi a2, 0\n\t" |
71 | "wsr a2, " __stringify(ICOUNT) "\n\t" | 71 | "wsr a2, icount\n\t" |
72 | "wsr a2, " __stringify(IBREAKENABLE) "\n\t" | 72 | "wsr a2, ibreakenable\n\t" |
73 | "wsr a2, " __stringify(LCOUNT) "\n\t" | 73 | "wsr a2, lcount\n\t" |
74 | "movi a2, 0x1f\n\t" | 74 | "movi a2, 0x1f\n\t" |
75 | "wsr a2, " __stringify(PS) "\n\t" | 75 | "wsr a2, ps\n\t" |
76 | "isync\n\t" | 76 | "isync\n\t" |
77 | "jx %0\n\t" | 77 | "jx %0\n\t" |
78 | : | 78 | : |