blob: 00a08d13230a541914e0ebce22bf11b4bc9d0040 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Generate definitions needed by assembly language modules.
3 * This code generates raw asm output which is post-processed to extract
4 * and format the required data.
5 */
6
7#include <linux/sched.h>
8#include <linux/stddef.h>
9#include <linux/errno.h>
10#include <linux/hardirq.h>
11#include <linux/suspend.h>
12#include <asm/pda.h>
13#include <asm/processor.h>
14#include <asm/segment.h>
15#include <asm/thread_info.h>
16#include <asm/ia32.h>
17
18#define DEFINE(sym, val) \
19 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
20
21#define BLANK() asm volatile("\n->" : : )
22
23int main(void)
24{
25#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
26 ENTRY(state);
27 ENTRY(flags);
28 ENTRY(thread);
29 ENTRY(pid);
30 BLANK();
31#undef ENTRY
32#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry))
33 ENTRY(flags);
34 ENTRY(addr_limit);
35 ENTRY(preempt_count);
36 BLANK();
37#undef ENTRY
38#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
39 ENTRY(kernelstack);
40 ENTRY(oldrsp);
41 ENTRY(pcurrent);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 ENTRY(irqcount);
43 ENTRY(cpunumber);
44 ENTRY(irqstackptr);
45 BLANK();
46#undef ENTRY
47#ifdef CONFIG_IA32_EMULATION
48#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
49 ENTRY(eax);
50 ENTRY(ebx);
51 ENTRY(ecx);
52 ENTRY(edx);
53 ENTRY(esi);
54 ENTRY(edi);
55 ENTRY(ebp);
56 ENTRY(esp);
57 ENTRY(eip);
58 BLANK();
59#undef ENTRY
60 DEFINE(IA32_RT_SIGFRAME_sigcontext,
61 offsetof (struct rt_sigframe32, uc.uc_mcontext));
62 BLANK();
63#endif
64 DEFINE(pbe_address, offsetof(struct pbe, address));
65 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
66 DEFINE(pbe_next, offsetof(struct pbe, next));
Jan Beulichb556b352006-01-11 22:43:00 +010067 BLANK();
68#if DEBUG_STKSZ > EXCEPTION_STKSZ
69 DEFINE(DEBUG_IST, DEBUG_STACK);
70#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 return 0;
72}