aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-10-21 16:10:27 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2008-10-31 18:37:00 -0400
commit0365f707c99bf940a51c2a3ffc19f3ade2f700d4 (patch)
treefc7e48a78d995e31aa1550550724b9e975e2e8dc
parent556dcee7b829e5c350c3ffdbdb87a8b15aa3c5d3 (diff)
[CRIS] Merge asm-offsets.c for both arches into one file.
Eliminates the link to arch specific asm-offsets.c from CRIS architecture build system. Resulting asm-offsets.s are identical before and after change for both arch-v10 and arch-v32. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--arch/cris/Makefile6
-rw-r--r--arch/cris/arch-v10/kernel/asm-offsets.c47
-rw-r--r--arch/cris/kernel/asm-offsets.c (renamed from arch/cris/arch-v32/kernel/asm-offsets.c)51
3 files changed, 35 insertions, 69 deletions
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index 22825a7bbe57..241e35bc3b59 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -95,8 +95,6 @@ ifdef CONFIG_ETRAX_ARCH_V32
95endif 95endif
96 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S 96 @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
97 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S 97 @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
98 @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
99 @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
100 @touch $@ 98 @touch $@
101 99
102archclean: 100archclean:
@@ -116,8 +114,8 @@ MRPROPER_FILES += \
116 $(SRC_ARCH)/boot \ 114 $(SRC_ARCH)/boot \
117 $(SRC_ARCH)/lib \ 115 $(SRC_ARCH)/lib \
118 $(SRC_ARCH)/arch \ 116 $(SRC_ARCH)/arch \
119 $(SRC_ARCH)/kernel/vmlinux.lds.S \ 117 $(SRC_ARCH)/kernel/vmlinux.lds.S
120 $(SRC_ARCH)/kernel/asm-offsets.c 118
121 119
122define archhelp 120define archhelp
123 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 121 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
diff --git a/arch/cris/arch-v10/kernel/asm-offsets.c b/arch/cris/arch-v10/kernel/asm-offsets.c
deleted file mode 100644
index 1aa3cc4e7107..000000000000
--- a/arch/cris/arch-v10/kernel/asm-offsets.c
+++ /dev/null
@@ -1,47 +0,0 @@
1#include <linux/sched.h>
2#include <asm/thread_info.h>
3
4/*
5 * Generate definitions needed by assembly language modules.
6 * This code generates raw asm output which is post-processed to extract
7 * and format the required data.
8 */
9
10#define DEFINE(sym, val) \
11 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
12
13#define BLANK() asm volatile("\n->" : : )
14
15int main(void)
16{
17#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
18 ENTRY(orig_r10);
19 ENTRY(r13);
20 ENTRY(r12);
21 ENTRY(r11);
22 ENTRY(r10);
23 ENTRY(r9);
24 ENTRY(mof);
25 ENTRY(dccr);
26 ENTRY(srp);
27 BLANK();
28#undef ENTRY
29#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
30 ENTRY(task);
31 ENTRY(flags);
32 ENTRY(preempt_count);
33 BLANK();
34#undef ENTRY
35#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
36 ENTRY(ksp);
37 ENTRY(usp);
38 ENTRY(dccr);
39 BLANK();
40#undef ENTRY
41#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
42 ENTRY(pid);
43 BLANK();
44 DEFINE(LCLONE_VM, CLONE_VM);
45 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
46 return 0;
47}
diff --git a/arch/cris/arch-v32/kernel/asm-offsets.c b/arch/cris/kernel/asm-offsets.c
index 15b3d93a0496..ddd6fbbe75de 100644
--- a/arch/cris/arch-v32/kernel/asm-offsets.c
+++ b/arch/cris/kernel/asm-offsets.c
@@ -1,5 +1,6 @@
1#include <linux/sched.h> 1#include <linux/sched.h>
2#include <asm/thread_info.h> 2#include <asm/thread_info.h>
3#include <linux/autoconf.h>
3 4
4/* 5/*
5 * Generate definitions needed by assembly language modules. 6 * Generate definitions needed by assembly language modules.
@@ -8,10 +9,14 @@
8 */ 9 */
9 10
10#define DEFINE(sym, val) \ 11#define DEFINE(sym, val) \
11 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 12 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
12 13
13#define BLANK() asm volatile("\n->" : : ) 14#define BLANK() asm volatile("\n->" : : )
14 15
16#if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)
17#error One of ARCH v10 and ARCH v32 must be true!
18#endif
19
15int main(void) 20int main(void)
16{ 21{
17#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry)) 22#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
@@ -19,31 +24,41 @@ int main(void)
19 ENTRY(r13); 24 ENTRY(r13);
20 ENTRY(r12); 25 ENTRY(r12);
21 ENTRY(r11); 26 ENTRY(r11);
22 ENTRY(r10); 27 ENTRY(r10);
23 ENTRY(r9); 28 ENTRY(r9);
29#ifdef CONFIG_ETRAX_ARCH_V32
24 ENTRY(acr); 30 ENTRY(acr);
25 ENTRY(srs); 31 ENTRY(srs);
26 ENTRY(mof); 32#endif
27 ENTRY(ccs); 33 ENTRY(mof);
28 ENTRY(srp); 34#ifdef CONFIG_ETRAX_ARCH_V10
35 ENTRY(dccr);
36#else
37 ENTRY(ccs);
38#endif
39 ENTRY(srp);
29 BLANK(); 40 BLANK();
30#undef ENTRY 41#undef ENTRY
31#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) 42#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
32 ENTRY(task); 43 ENTRY(task);
33 ENTRY(flags); 44 ENTRY(flags);
34 ENTRY(preempt_count); 45 ENTRY(preempt_count);
35 BLANK(); 46 BLANK();
36#undef ENTRY 47#undef ENTRY
37#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) 48#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
38 ENTRY(ksp); 49 ENTRY(ksp);
39 ENTRY(usp); 50 ENTRY(usp);
40 ENTRY(ccs); 51#ifdef CONFIG_ETRAX_ARCH_V10
41 BLANK(); 52 ENTRY(dccr);
53#else
54 ENTRY(ccs);
55#endif
56 BLANK();
42#undef ENTRY 57#undef ENTRY
43#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) 58#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
44 ENTRY(pid); 59 ENTRY(pid);
45 BLANK(); 60 BLANK();
46 DEFINE(LCLONE_VM, CLONE_VM); 61 DEFINE(LCLONE_VM, CLONE_VM);
47 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 62 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
48 return 0; 63 return 0;
49} 64}