blob: 38834bbbae1119c908c8b4cf6e653d120833a679 [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);
Andi Kleenbf2fcc62006-01-11 22:44:06 +010036 ENTRY(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 BLANK();
38#undef ENTRY
39#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
40 ENTRY(kernelstack);
41 ENTRY(oldrsp);
42 ENTRY(pcurrent);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 ENTRY(irqcount);
44 ENTRY(cpunumber);
45 ENTRY(irqstackptr);
Andi Kleen5f8efbb2006-01-16 01:56:39 +010046 ENTRY(data_offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 BLANK();
48#undef ENTRY
49#ifdef CONFIG_IA32_EMULATION
50#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
51 ENTRY(eax);
52 ENTRY(ebx);
53 ENTRY(ecx);
54 ENTRY(edx);
55 ENTRY(esi);
56 ENTRY(edi);
57 ENTRY(ebp);
58 ENTRY(esp);
59 ENTRY(eip);
60 BLANK();
61#undef ENTRY
62 DEFINE(IA32_RT_SIGFRAME_sigcontext,
63 offsetof (struct rt_sigframe32, uc.uc_mcontext));
64 BLANK();
65#endif
66 DEFINE(pbe_address, offsetof(struct pbe, address));
67 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
68 DEFINE(pbe_next, offsetof(struct pbe, next));
Jan Beulichb556b352006-01-11 22:43:00 +010069 BLANK();
Andi Kleen5f8efbb2006-01-16 01:56:39 +010070 DEFINE(TSS_ist, offsetof(struct tss_struct, ist));
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 return 0;
72}