aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/kernel
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 /arch/cris/kernel
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>
Diffstat (limited to 'arch/cris/kernel')
-rw-r--r--arch/cris/kernel/asm-offsets.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/cris/kernel/asm-offsets.c b/arch/cris/kernel/asm-offsets.c
new file mode 100644
index 000000000000..ddd6fbbe75de
--- /dev/null
+++ b/arch/cris/kernel/asm-offsets.c
@@ -0,0 +1,64 @@
1#include <linux/sched.h>
2#include <asm/thread_info.h>
3#include <linux/autoconf.h>
4
5/*
6 * Generate definitions needed by assembly language modules.
7 * This code generates raw asm output which is post-processed to extract
8 * and format the required data.
9 */
10
11#define DEFINE(sym, val) \
12 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
13
14#define BLANK() asm volatile("\n->" : : )
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
20int main(void)
21{
22#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
23 ENTRY(orig_r10);
24 ENTRY(r13);
25 ENTRY(r12);
26 ENTRY(r11);
27 ENTRY(r10);
28 ENTRY(r9);
29#ifdef CONFIG_ETRAX_ARCH_V32
30 ENTRY(acr);
31 ENTRY(srs);
32#endif
33 ENTRY(mof);
34#ifdef CONFIG_ETRAX_ARCH_V10
35 ENTRY(dccr);
36#else
37 ENTRY(ccs);
38#endif
39 ENTRY(srp);
40 BLANK();
41#undef ENTRY
42#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
43 ENTRY(task);
44 ENTRY(flags);
45 ENTRY(preempt_count);
46 BLANK();
47#undef ENTRY
48#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
49 ENTRY(ksp);
50 ENTRY(usp);
51#ifdef CONFIG_ETRAX_ARCH_V10
52 ENTRY(dccr);
53#else
54 ENTRY(ccs);
55#endif
56 BLANK();
57#undef ENTRY
58#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
59 ENTRY(pid);
60 BLANK();
61 DEFINE(LCLONE_VM, CLONE_VM);
62 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
63 return 0;
64}