Merge branch 'for-33' of git://repo.or.cz/linux-kbuild
[linux-2.6-block.git] / arch / cris / kernel / asm-offsets.c
CommitLineData
51533b61
MS
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) \
0365f707 11 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
51533b61
MS
12
13#define BLANK() asm volatile("\n->" : : )
14
0365f707
JN
15#if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)
16#error One of ARCH v10 and ARCH v32 must be true!
17#endif
18
51533b61
MS
19int main(void)
20{
21#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
22 ENTRY(orig_r10);
23 ENTRY(r13);
24 ENTRY(r12);
25 ENTRY(r11);
0365f707
JN
26 ENTRY(r10);
27 ENTRY(r9);
28#ifdef CONFIG_ETRAX_ARCH_V32
51533b61
MS
29 ENTRY(acr);
30 ENTRY(srs);
0365f707
JN
31#endif
32 ENTRY(mof);
33#ifdef CONFIG_ETRAX_ARCH_V10
34 ENTRY(dccr);
35#else
36 ENTRY(ccs);
37#endif
38 ENTRY(srp);
51533b61
MS
39 BLANK();
40#undef ENTRY
41#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
0365f707
JN
42 ENTRY(task);
43 ENTRY(flags);
44 ENTRY(preempt_count);
45 BLANK();
51533b61
MS
46#undef ENTRY
47#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
48 ENTRY(ksp);
0365f707
JN
49 ENTRY(usp);
50#ifdef CONFIG_ETRAX_ARCH_V10
51 ENTRY(dccr);
52#else
53 ENTRY(ccs);
54#endif
55 BLANK();
51533b61
MS
56#undef ENTRY
57#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
0365f707
JN
58 ENTRY(pid);
59 BLANK();
60 DEFINE(LCLONE_VM, CLONE_VM);
61 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
62 return 0;
51533b61 63}