diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-03 02:57:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-03 02:57:41 -0500 |
commit | db5935001a43528e673ad26ffec9d98c60a496a9 (patch) | |
tree | 8e735327a97beccabb5d94ef93df25d2bacda705 /arch/cris/kernel/asm-offsets.c | |
parent | 34f3a814eef8069a24e5b3ebcf27aba9dabac2ea (diff) | |
parent | 45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 (diff) |
Merge commit 'v2.6.28-rc3' into sched/core
Diffstat (limited to 'arch/cris/kernel/asm-offsets.c')
-rw-r--r-- | arch/cris/kernel/asm-offsets.c | 64 |
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 | |||
20 | int 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 | } | ||