]>
Commit | Line | Data |
---|---|---|
51533b61 MS |
1 | #include <linux/sched.h> |
2 | #include <asm/thread_info.h> | |
0365f707 | 3 | #include <linux/autoconf.h> |
51533b61 MS |
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) \ | |
0365f707 | 12 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
51533b61 MS |
13 | |
14 | #define BLANK() asm volatile("\n->" : : ) | |
15 | ||
0365f707 JN |
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 | ||
51533b61 MS |
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); | |
0365f707 JN |
27 | ENTRY(r10); |
28 | ENTRY(r9); | |
29 | #ifdef CONFIG_ETRAX_ARCH_V32 | |
51533b61 MS |
30 | ENTRY(acr); |
31 | ENTRY(srs); | |
0365f707 JN |
32 | #endif |
33 | ENTRY(mof); | |
34 | #ifdef CONFIG_ETRAX_ARCH_V10 | |
35 | ENTRY(dccr); | |
36 | #else | |
37 | ENTRY(ccs); | |
38 | #endif | |
39 | ENTRY(srp); | |
51533b61 MS |
40 | BLANK(); |
41 | #undef ENTRY | |
42 | #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) | |
0365f707 JN |
43 | ENTRY(task); |
44 | ENTRY(flags); | |
45 | ENTRY(preempt_count); | |
46 | BLANK(); | |
51533b61 MS |
47 | #undef ENTRY |
48 | #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) | |
49 | ENTRY(ksp); | |
0365f707 JN |
50 | ENTRY(usp); |
51 | #ifdef CONFIG_ETRAX_ARCH_V10 | |
52 | ENTRY(dccr); | |
53 | #else | |
54 | ENTRY(ccs); | |
55 | #endif | |
56 | BLANK(); | |
51533b61 MS |
57 | #undef ENTRY |
58 | #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) | |
0365f707 JN |
59 | ENTRY(pid); |
60 | BLANK(); | |
61 | DEFINE(LCLONE_VM, CLONE_VM); | |
62 | DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); | |
63 | return 0; | |
51533b61 | 64 | } |