aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-03-28 13:30:02 -0400
committerDavid Howells <dhowells@redhat.com>2012-03-28 13:30:02 -0400
commitc40d04df152a1111c5bbcb632278394dabd2b73d (patch)
tree84e9426bea45852e2333308116a69b5743655ee3 /arch
parent803f69144f0d48863c68f9d111b56849c7cef5bb (diff)
Disintegrate asm/system.h for Microblaze
Disintegrate asm/system.h for Microblaze. Not compiled. Signed-off-by: David Howells <dhowells@redhat.com> cc: microblaze-uclinux@itee.uq.edu.au
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/atomic.h1
-rw-r--r--arch/microblaze/include/asm/barrier.h27
-rw-r--r--arch/microblaze/include/asm/cmpxchg.h40
-rw-r--r--arch/microblaze/include/asm/exec.h14
-rw-r--r--arch/microblaze/include/asm/processor.h11
-rw-r--r--arch/microblaze/include/asm/setup.h6
-rw-r--r--arch/microblaze/include/asm/switch_to.h24
-rw-r--r--arch/microblaze/include/asm/system.h104
-rw-r--r--arch/microblaze/kernel/cpu/pvr.c1
-rw-r--r--arch/microblaze/kernel/microblaze_ksyms.c1
-rw-r--r--arch/microblaze/kernel/process.c1
-rw-r--r--arch/microblaze/kernel/prom.c1
-rw-r--r--arch/microblaze/kernel/setup.c1
-rw-r--r--arch/microblaze/kernel/timer.c1
-rw-r--r--arch/microblaze/kernel/traps.c1
-rw-r--r--arch/microblaze/lib/memcpy.c1
-rw-r--r--arch/microblaze/mm/fault.c1
17 files changed, 129 insertions, 107 deletions
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
index 615f53992c65..472d8bf726df 100644
--- a/arch/microblaze/include/asm/atomic.h
+++ b/arch/microblaze/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_MICROBLAZE_ATOMIC_H 1#ifndef _ASM_MICROBLAZE_ATOMIC_H
2#define _ASM_MICROBLAZE_ATOMIC_H 2#define _ASM_MICROBLAZE_ATOMIC_H
3 3
4#include <asm/cmpxchg.h>
4#include <asm-generic/atomic.h> 5#include <asm-generic/atomic.h>
5#include <asm-generic/atomic64.h> 6#include <asm-generic/atomic64.h>
6 7
diff --git a/arch/microblaze/include/asm/barrier.h b/arch/microblaze/include/asm/barrier.h
new file mode 100644
index 000000000000..df5be3e87044
--- /dev/null
+++ b/arch/microblaze/include/asm/barrier.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_BARRIER_H
10#define _ASM_MICROBLAZE_BARRIER_H
11
12#define nop() asm volatile ("nop")
13
14#define smp_read_barrier_depends() do {} while (0)
15#define read_barrier_depends() do {} while (0)
16
17#define mb() barrier()
18#define rmb() mb()
19#define wmb() mb()
20#define set_mb(var, value) do { var = value; mb(); } while (0)
21#define set_wmb(var, value) do { var = value; wmb(); } while (0)
22
23#define smp_mb() mb()
24#define smp_rmb() rmb()
25#define smp_wmb() wmb()
26
27#endif /* _ASM_MICROBLAZE_BARRIER_H */
diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h
new file mode 100644
index 000000000000..0094859abd9b
--- /dev/null
+++ b/arch/microblaze/include/asm/cmpxchg.h
@@ -0,0 +1,40 @@
1#ifndef _ASM_MICROBLAZE_CMPXCHG_H
2#define _ASM_MICROBLAZE_CMPXCHG_H
3
4void __bad_xchg(volatile void *ptr, int size);
5
6static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
7 int size)
8{
9 unsigned long ret;
10 unsigned long flags;
11
12 switch (size) {
13 case 1:
14 local_irq_save(flags);
15 ret = *(volatile unsigned char *)ptr;
16 *(volatile unsigned char *)ptr = x;
17 local_irq_restore(flags);
18 break;
19
20 case 4:
21 local_irq_save(flags);
22 ret = *(volatile unsigned long *)ptr;
23 *(volatile unsigned long *)ptr = x;
24 local_irq_restore(flags);
25 break;
26 default:
27 __bad_xchg(ptr, size), ret = 0;
28 break;
29 }
30
31 return ret;
32}
33
34#define xchg(ptr, x) \
35 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
36
37#include <asm-generic/cmpxchg.h>
38#include <asm-generic/cmpxchg-local.h>
39
40#endif /* _ASM_MICROBLAZE_CMPXCHG_H */
diff --git a/arch/microblaze/include/asm/exec.h b/arch/microblaze/include/asm/exec.h
new file mode 100644
index 000000000000..e750de1fe8fb
--- /dev/null
+++ b/arch/microblaze/include/asm/exec.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_EXEC_H
10#define _ASM_MICROBLAZE_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _ASM_MICROBLAZE_EXEC_H */
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 7283bfb2f7e4..510a8e1c16ba 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -125,7 +125,6 @@ struct thread_struct {
125 .pgdir = swapper_pg_dir, \ 125 .pgdir = swapper_pg_dir, \
126} 126}
127 127
128
129/* Free all resources held by a thread. */ 128/* Free all resources held by a thread. */
130extern inline void release_thread(struct task_struct *dead_task) 129extern inline void release_thread(struct task_struct *dead_task)
131{ 130{
@@ -144,6 +143,8 @@ static inline void exit_thread(void)
144 143
145unsigned long get_wchan(struct task_struct *p); 144unsigned long get_wchan(struct task_struct *p);
146 145
146extern void ret_from_fork(void);
147
147/* The size allocated for kernel stacks. This _must_ be a power of two! */ 148/* The size allocated for kernel stacks. This _must_ be a power of two! */
148# define KERNEL_STACK_SIZE 0x2000 149# define KERNEL_STACK_SIZE 0x2000
149 150
@@ -166,6 +167,14 @@ unsigned long get_wchan(struct task_struct *p);
166# define STACK_TOP TASK_SIZE 167# define STACK_TOP TASK_SIZE
167# define STACK_TOP_MAX STACK_TOP 168# define STACK_TOP_MAX STACK_TOP
168 169
170void disable_hlt(void);
171void enable_hlt(void);
172void default_idle(void);
173
174#ifdef CONFIG_DEBUG_FS
175extern struct dentry *of_debugfs_root;
176#endif
177
169# endif /* __ASSEMBLY__ */ 178# endif /* __ASSEMBLY__ */
170# endif /* CONFIG_MMU */ 179# endif /* CONFIG_MMU */
171#endif /* _ASM_MICROBLAZE_PROCESSOR_H */ 180#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 6c72ed7eba98..aa22511819d8 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -20,6 +20,8 @@ extern unsigned int boot_cpuid; /* move to smp.h */
20 20
21extern char cmd_line[COMMAND_LINE_SIZE]; 21extern char cmd_line[COMMAND_LINE_SIZE];
22 22
23extern char *klimit;
24
23void early_printk(const char *fmt, ...); 25void early_printk(const char *fmt, ...);
24 26
25int setup_early_printk(char *opt); 27int setup_early_printk(char *opt);
@@ -46,6 +48,10 @@ void machine_shutdown(void);
46void machine_halt(void); 48void machine_halt(void);
47void machine_power_off(void); 49void machine_power_off(void);
48 50
51void free_init_pages(char *what, unsigned long begin, unsigned long end);
52extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
53extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
54
49# endif/* __KERNEL__ */ 55# endif/* __KERNEL__ */
50# endif /* __ASSEMBLY__ */ 56# endif /* __ASSEMBLY__ */
51#endif /* _ASM_MICROBLAZE_SETUP_H */ 57#endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/include/asm/switch_to.h b/arch/microblaze/include/asm/switch_to.h
new file mode 100644
index 000000000000..f45baa2c5e09
--- /dev/null
+++ b/arch/microblaze/include/asm/switch_to.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
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
9#ifndef _ASM_MICROBLAZE_SWITCH_TO_H
10#define _ASM_MICROBLAZE_SWITCH_TO_H
11
12struct task_struct;
13struct thread_info;
14
15extern struct task_struct *_switch_to(struct thread_info *prev,
16 struct thread_info *next);
17
18#define switch_to(prev, next, last) \
19 do { \
20 (last) = _switch_to(task_thread_info(prev), \
21 task_thread_info(next)); \
22 } while (0)
23
24#endif /* _ASM_MICROBLAZE_SWITCH_TO_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index 5a433cbaafb3..ccc4f86d16c5 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -1,97 +1,7 @@
1/* 1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2 * Copyright (C) 2006 Atmark Techno, Inc. 2#include <asm/barrier.h>
3 * 3#include <asm/cmpxchg.h>
4 * This file is subject to the terms and conditions of the GNU General Public 4#include <asm/exec.h>
5 * License. See the file "COPYING" in the main directory of this archive 5#include <asm/special_insns.h>
6 * for more details. 6#include <asm/switch_to.h>
7 */ 7extern void free_initmem(void);
8
9#ifndef _ASM_MICROBLAZE_SYSTEM_H
10#define _ASM_MICROBLAZE_SYSTEM_H
11
12#include <asm/registers.h>
13#include <asm/setup.h>
14#include <asm/irqflags.h>
15#include <asm/cache.h>
16
17#include <asm-generic/cmpxchg.h>
18#include <asm-generic/cmpxchg-local.h>
19
20struct task_struct;
21struct thread_info;
22
23extern struct task_struct *_switch_to(struct thread_info *prev,
24 struct thread_info *next);
25
26#define switch_to(prev, next, last) \
27 do { \
28 (last) = _switch_to(task_thread_info(prev), \
29 task_thread_info(next)); \
30 } while (0)
31
32#define smp_read_barrier_depends() do {} while (0)
33#define read_barrier_depends() do {} while (0)
34
35#define nop() asm volatile ("nop")
36#define mb() barrier()
37#define rmb() mb()
38#define wmb() mb()
39#define set_mb(var, value) do { var = value; mb(); } while (0)
40#define set_wmb(var, value) do { var = value; wmb(); } while (0)
41
42#define smp_mb() mb()
43#define smp_rmb() rmb()
44#define smp_wmb() wmb()
45
46void __bad_xchg(volatile void *ptr, int size);
47
48static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
49 int size)
50{
51 unsigned long ret;
52 unsigned long flags;
53
54 switch (size) {
55 case 1:
56 local_irq_save(flags);
57 ret = *(volatile unsigned char *)ptr;
58 *(volatile unsigned char *)ptr = x;
59 local_irq_restore(flags);
60 break;
61
62 case 4:
63 local_irq_save(flags);
64 ret = *(volatile unsigned long *)ptr;
65 *(volatile unsigned long *)ptr = x;
66 local_irq_restore(flags);
67 break;
68 default:
69 __bad_xchg(ptr, size), ret = 0;
70 break;
71 }
72
73 return ret;
74}
75
76void disable_hlt(void);
77void enable_hlt(void);
78void default_idle(void);
79
80#define xchg(ptr, x) \
81 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
82
83void free_init_pages(char *what, unsigned long begin, unsigned long end);
84void free_initmem(void);
85extern char *klimit;
86extern void ret_from_fork(void);
87
88extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
89extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
90
91#ifdef CONFIG_DEBUG_FS
92extern struct dentry *of_debugfs_root;
93#endif
94
95#define arch_align_stack(x) (x)
96
97#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/kernel/cpu/pvr.c b/arch/microblaze/kernel/cpu/pvr.c
index 488c1ed24e38..3a749d5e71fd 100644
--- a/arch/microblaze/kernel/cpu/pvr.c
+++ b/arch/microblaze/kernel/cpu/pvr.c
@@ -12,7 +12,6 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <asm/system.h>
16#include <asm/exceptions.h> 15#include <asm/exceptions.h>
17#include <asm/pvr.h> 16#include <asm/pvr.h>
18 17
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
index 49faeb429599..bb4907c828dc 100644
--- a/arch/microblaze/kernel/microblaze_ksyms.c
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -18,7 +18,6 @@
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/system.h>
22#include <linux/ftrace.h> 21#include <linux/ftrace.h>
23#include <linux/uaccess.h> 22#include <linux/uaccess.h>
24 23
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 9155f7d92669..883b92789cdf 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -13,7 +13,6 @@
13#include <linux/pm.h> 13#include <linux/pm.h>
14#include <linux/tick.h> 14#include <linux/tick.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <asm/system.h>
17#include <asm/pgalloc.h> 16#include <asm/pgalloc.h>
18#include <asm/uaccess.h> /* for USER_DS macros */ 17#include <asm/uaccess.h> /* for USER_DS macros */
19#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 80d314e81901..4a764ccb9f26 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -36,7 +36,6 @@
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <linux/io.h> 38#include <linux/io.h>
39#include <asm/system.h>
40#include <asm/mmu.h> 39#include <asm/mmu.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42#include <asm/sections.h> 41#include <asm/sections.h>
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 70e6d0b41ab4..7a9f39efbf32 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -30,7 +30,6 @@
30#include <asm/entry.h> 30#include <asm/entry.h>
31#include <asm/cpuinfo.h> 31#include <asm/cpuinfo.h>
32 32
33#include <asm/system.h>
34#include <asm/prom.h> 33#include <asm/prom.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36 35
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index 3cb0bf640135..d3a38eca12d6 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -27,7 +27,6 @@
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/system.h>
31#include <linux/cnt32_to_63.h> 30#include <linux/cnt32_to_63.h>
32 31
33#ifdef CONFIG_SELFMOD_TIMER 32#ifdef CONFIG_SELFMOD_TIMER
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c
index ba034d421ec2..5541ac559593 100644
--- a/arch/microblaze/kernel/traps.c
+++ b/arch/microblaze/kernel/traps.c
@@ -15,7 +15,6 @@
15#include <linux/debug_locks.h> 15#include <linux/debug_locks.h>
16 16
17#include <asm/exceptions.h> 17#include <asm/exceptions.h>
18#include <asm/system.h>
19#include <asm/unwind.h> 18#include <asm/unwind.h>
20 19
21void trap_init(void) 20void trap_init(void)
diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c
index 52746e718dfa..fe9c53fafdea 100644
--- a/arch/microblaze/lib/memcpy.c
+++ b/arch/microblaze/lib/memcpy.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31 31
32#include <linux/string.h> 32#include <linux/string.h>
33#include <asm/system.h>
34 33
35#ifdef __HAVE_ARCH_MEMCPY 34#ifdef __HAVE_ARCH_MEMCPY
36#ifndef CONFIG_OPT_LIB_FUNCTION 35#ifndef CONFIG_OPT_LIB_FUNCTION
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
index ae97d2ccdc22..c38a265846de 100644
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -33,7 +33,6 @@
33#include <asm/pgtable.h> 33#include <asm/pgtable.h>
34#include <asm/mmu.h> 34#include <asm/mmu.h>
35#include <asm/mmu_context.h> 35#include <asm/mmu_context.h>
36#include <asm/system.h>
37#include <linux/uaccess.h> 36#include <linux/uaccess.h>
38#include <asm/exceptions.h> 37#include <asm/exceptions.h>
39 38