aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 18:58:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 18:58:21 -0400
commit0195c00244dc2e9f522475868fa278c473ba7339 (patch)
treef97ca98ae64ede2c33ad3de05ed7bbfa4f4495ed /arch/xtensa
parentf21ce8f8447c8be8847dadcfdbcc76b0d7365fa5 (diff)
parent141124c02059eee9dbc5c86ea797b1ca888e77f7 (diff)
Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system
Pull "Disintegrate and delete asm/system.h" from David Howells: "Here are a bunch of patches to disintegrate asm/system.h into a set of separate bits to relieve the problem of circular inclusion dependencies. I've built all the working defconfigs from all the arches that I can and made sure that they don't break. The reason for these patches is that I recently encountered a circular dependency problem that came about when I produced some patches to optimise get_order() by rewriting it to use ilog2(). This uses bitops - and on the SH arch asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving asm/system.h. The main difficulty seems to be asm/system.h. It holds a number of low level bits with no/few dependencies that are commonly used (eg. memory barriers) and a number of bits with more dependencies that aren't used in many places (eg. switch_to()). These patches break asm/system.h up into the following core pieces: (1) asm/barrier.h Move memory barriers here. This already done for MIPS and Alpha. (2) asm/switch_to.h Move switch_to() and related stuff here. (3) asm/exec.h Move arch_align_stack() here. Other process execution related bits could perhaps go here from asm/processor.h. (4) asm/cmpxchg.h Move xchg() and cmpxchg() here as they're full word atomic ops and frequently used by atomic_xchg() and atomic_cmpxchg(). (5) asm/bug.h Move die() and related bits. (6) asm/auxvec.h Move AT_VECTOR_SIZE_ARCH here. Other arch headers are created as needed on a per-arch basis." Fixed up some conflicts from other header file cleanups and moving code around that has happened in the meantime, so David's testing is somewhat weakened by that. We'll find out anything that got broken and fix it.. * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits) Delete all instances of asm/system.h Remove all #inclusions of asm/system.h Add #includes needed to permit the removal of asm/system.h Move all declarations of free_initmem() to linux/mm.h Disintegrate asm/system.h for OpenRISC Split arch_align_stack() out from asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Create asm-generic/barrier.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Disintegrate asm/system.h for Xtensa Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt] Disintegrate asm/system.h for Tile Disintegrate asm/system.h for Sparc Disintegrate asm/system.h for SH Disintegrate asm/system.h for Score Disintegrate asm/system.h for S390 Disintegrate asm/system.h for PowerPC Disintegrate asm/system.h for PA-RISC Disintegrate asm/system.h for MN10300 ...
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/include/asm/atomic.h2
-rw-r--r--arch/xtensa/include/asm/barrier.h29
-rw-r--r--arch/xtensa/include/asm/bitops.h1
-rw-r--r--arch/xtensa/include/asm/cmpxchg.h (renamed from arch/xtensa/include/asm/system.h)67
-rw-r--r--arch/xtensa/include/asm/exec.h14
-rw-r--r--arch/xtensa/include/asm/setup.h2
-rw-r--r--arch/xtensa/include/asm/switch_to.h22
-rw-r--r--arch/xtensa/include/asm/uaccess.h2
-rw-r--r--arch/xtensa/kernel/process.c1
-rw-r--r--arch/xtensa/kernel/ptrace.c1
-rw-r--r--arch/xtensa/kernel/setup.c1
-rw-r--r--arch/xtensa/kernel/traps.c19
-rw-r--r--arch/xtensa/mm/fault.c1
-rw-r--r--arch/xtensa/mm/tlb.c1
14 files changed, 96 insertions, 67 deletions
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index 23592eff67ad..b40989308775 100644
--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -18,7 +18,7 @@
18 18
19#ifdef __KERNEL__ 19#ifdef __KERNEL__
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/system.h> 21#include <asm/cmpxchg.h>
22 22
23#define ATOMIC_INIT(i) { (i) } 23#define ATOMIC_INIT(i) { (i) }
24 24
diff --git a/arch/xtensa/include/asm/barrier.h b/arch/xtensa/include/asm/barrier.h
new file mode 100644
index 000000000000..55707a8009d3
--- /dev/null
+++ b/arch/xtensa/include/asm/barrier.h
@@ -0,0 +1,29 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_SYSTEM_H
10#define _XTENSA_SYSTEM_H
11
12#define smp_read_barrier_depends() do { } while(0)
13#define read_barrier_depends() do { } while(0)
14
15#define mb() barrier()
16#define rmb() mb()
17#define wmb() mb()
18
19#ifdef CONFIG_SMP
20#error smp_* not defined
21#else
22#define smp_mb() barrier()
23#define smp_rmb() barrier()
24#define smp_wmb() barrier()
25#endif
26
27#define set_mb(var, value) do { var = value; mb(); } while (0)
28
29#endif /* _XTENSA_SYSTEM_H */
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 40aa7fe77f66..5270197ddd36 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -21,7 +21,6 @@
21 21
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/byteorder.h> 23#include <asm/byteorder.h>
24#include <asm/system.h>
25 24
26#ifdef CONFIG_SMP 25#ifdef CONFIG_SMP
27# error SMP not supported on this architecture 26# error SMP not supported on this architecture
diff --git a/arch/xtensa/include/asm/system.h b/arch/xtensa/include/asm/cmpxchg.h
index 1e7e09ab6cd7..e32149063d83 100644
--- a/arch/xtensa/include/asm/system.h
+++ b/arch/xtensa/include/asm/cmpxchg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/system.h 2 * Atomic xchg and cmpxchg operations.
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 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 5 * License. See the file "COPYING" in the main directory of this archive
@@ -8,44 +8,12 @@
8 * Copyright (C) 2001 - 2005 Tensilica Inc. 8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */ 9 */
10 10
11#ifndef _XTENSA_SYSTEM_H 11#ifndef _XTENSA_CMPXCHG_H
12#define _XTENSA_SYSTEM_H 12#define _XTENSA_CMPXCHG_H
13 13
14#include <linux/stringify.h> 14#ifndef __ASSEMBLY__
15#include <linux/irqflags.h>
16
17#include <asm/processor.h>
18
19#define smp_read_barrier_depends() do { } while(0)
20#define read_barrier_depends() do { } while(0)
21
22#define mb() barrier()
23#define rmb() mb()
24#define wmb() mb()
25 15
26#ifdef CONFIG_SMP 16#include <linux/stringify.h>
27#error smp_* not defined
28#else
29#define smp_mb() barrier()
30#define smp_rmb() barrier()
31#define smp_wmb() barrier()
32#endif
33
34#define set_mb(var, value) do { var = value; mb(); } while (0)
35
36#if !defined (__ASSEMBLY__)
37
38/* * switch_to(n) should switch tasks to task nr n, first
39 * checking that n isn't the current task, in which case it does nothing.
40 */
41extern void *_switch_to(void *last, void *next);
42
43#endif /* __ASSEMBLY__ */
44
45#define switch_to(prev,next,last) \
46do { \
47 (last) = _switch_to(prev, next); \
48} while(0)
49 17
50/* 18/*
51 * cmpxchg 19 * cmpxchg
@@ -158,27 +126,6 @@ __xchg(unsigned long x, volatile void * ptr, int size)
158 return x; 126 return x;
159} 127}
160 128
161extern void set_except_vector(int n, void *addr); 129#endif /* __ASSEMBLY__ */
162
163static inline void spill_registers(void)
164{
165 unsigned int a0, ps;
166
167 __asm__ __volatile__ (
168 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
169 "mov a12, a0\n\t"
170 "rsr a13," __stringify(SAR) "\n\t"
171 "xsr a14," __stringify(PS) "\n\t"
172 "movi a0, _spill_registers\n\t"
173 "rsync\n\t"
174 "callx0 a0\n\t"
175 "mov a0, a12\n\t"
176 "wsr a13," __stringify(SAR) "\n\t"
177 "wsr a14," __stringify(PS) "\n\t"
178 :: "a" (&a0), "a" (&ps)
179 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
180}
181
182#define arch_align_stack(x) (x)
183 130
184#endif /* _XTENSA_SYSTEM_H */ 131#endif /* _XTENSA_CMPXCHG_H */
diff --git a/arch/xtensa/include/asm/exec.h b/arch/xtensa/include/asm/exec.h
new file mode 100644
index 000000000000..af949e28cb32
--- /dev/null
+++ b/arch/xtensa/include/asm/exec.h
@@ -0,0 +1,14 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_EXEC_H
10#define _XTENSA_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _XTENSA_EXEC_H */
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/asm/setup.h
index e3636520d8cc..9fa8ad979361 100644
--- a/arch/xtensa/include/asm/setup.h
+++ b/arch/xtensa/include/asm/setup.h
@@ -13,4 +13,6 @@
13 13
14#define COMMAND_LINE_SIZE 256 14#define COMMAND_LINE_SIZE 256
15 15
16extern void set_except_vector(int n, void *addr);
17
16#endif 18#endif
diff --git a/arch/xtensa/include/asm/switch_to.h b/arch/xtensa/include/asm/switch_to.h
new file mode 100644
index 000000000000..6b73bf0eb1ff
--- /dev/null
+++ b/arch/xtensa/include/asm/switch_to.h
@@ -0,0 +1,22 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_SWITCH_TO_H
10#define _XTENSA_SWITCH_TO_H
11
12/* * switch_to(n) should switch tasks to task nr n, first
13 * checking that n isn't the current task, in which case it does nothing.
14 */
15extern void *_switch_to(void *last, void *next);
16
17#define switch_to(prev,next,last) \
18do { \
19 (last) = _switch_to(prev, next); \
20} while(0)
21
22#endif /* _XTENSA_SWITCH_TO_H */
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
index 3fa526fd3c99..6e4bb3b791ab 100644
--- a/arch/xtensa/include/asm/uaccess.h
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -17,7 +17,9 @@
17#define _XTENSA_UACCESS_H 17#define _XTENSA_UACCESS_H
18 18
19#include <linux/errno.h> 19#include <linux/errno.h>
20#ifndef __ASSEMBLY__
20#include <linux/prefetch.h> 21#include <linux/prefetch.h>
22#endif
21#include <asm/types.h> 23#include <asm/types.h>
22 24
23#define VERIFY_READ 0 25#define VERIFY_READ 0
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 2c9004770c4e..6a2d6edf8f72 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -34,7 +34,6 @@
34 34
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/processor.h> 38#include <asm/processor.h>
40#include <asm/platform.h> 39#include <asm/platform.h>
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 2dff698ab02e..33eea4c16f12 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29#include <asm/ptrace.h> 28#include <asm/ptrace.h>
30#include <asm/elf.h> 29#include <asm/elf.h>
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 1e5a034fe011..17e746f7be60 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -34,7 +34,6 @@
34# include <linux/seq_file.h> 34# include <linux/seq_file.h>
35#endif 35#endif
36 36
37#include <asm/system.h>
38#include <asm/bootparam.h> 37#include <asm/bootparam.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/processor.h> 39#include <asm/processor.h>
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index e64efac3b9db..bc1e14cf9369 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -381,6 +381,25 @@ static __always_inline unsigned long *stack_pointer(struct task_struct *task)
381 return sp; 381 return sp;
382} 382}
383 383
384static inline void spill_registers(void)
385{
386 unsigned int a0, ps;
387
388 __asm__ __volatile__ (
389 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
390 "mov a12, a0\n\t"
391 "rsr a13," __stringify(SAR) "\n\t"
392 "xsr a14," __stringify(PS) "\n\t"
393 "movi a0, _spill_registers\n\t"
394 "rsync\n\t"
395 "callx0 a0\n\t"
396 "mov a0, a12\n\t"
397 "wsr a13," __stringify(SAR) "\n\t"
398 "wsr a14," __stringify(PS) "\n\t"
399 :: "a" (&a0), "a" (&ps)
400 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
401}
402
384void show_trace(struct task_struct *task, unsigned long *sp) 403void show_trace(struct task_struct *task, unsigned long *sp)
385{ 404{
386 unsigned long a0, a1, pc; 405 unsigned long a0, a1, pc;
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c
index e367e3026436..b17885a0b508 100644
--- a/arch/xtensa/mm/fault.c
+++ b/arch/xtensa/mm/fault.c
@@ -19,7 +19,6 @@
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <asm/hardirq.h> 20#include <asm/hardirq.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/system.h>
23#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
24 23
25unsigned long asid_cache = ASID_USER_FIRST; 24unsigned long asid_cache = ASID_USER_FIRST;
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c
index 239461d8ea88..e2700b21395b 100644
--- a/arch/xtensa/mm/tlb.c
+++ b/arch/xtensa/mm/tlb.c
@@ -18,7 +18,6 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
20#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
21#include <asm/system.h>
22#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
23 22
24 23