# BRCM_VERSION=3
[bcm963xx.git] / kernel / linux / arch / cris / arch-v10 / kernel / asm-offsets.c
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
15 int 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 }