ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / i386 / kernel / asm-offsets.c
1 /*
2  * Generate definitions needed by assembly language modules.
3  * This code generates raw asm output which is post-processed
4  * to extract and format the required data.
5  */
6
7 #include <linux/sched.h>
8 #include <linux/signal.h>
9 #include <asm/ucontext.h>
10 #include "sigframe.h"
11 #include <asm/fixmap.h>
12
13 #define DEFINE(sym, val) \
14         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
15
16 #define BLANK() asm volatile("\n->" : : )
17
18 void foo(void)
19 {
20         DEFINE(SIGCONTEXT_eax, offsetof (struct sigcontext, eax));
21         DEFINE(SIGCONTEXT_ebx, offsetof (struct sigcontext, ebx));
22         DEFINE(SIGCONTEXT_ecx, offsetof (struct sigcontext, ecx));
23         DEFINE(SIGCONTEXT_edx, offsetof (struct sigcontext, edx));
24         DEFINE(SIGCONTEXT_esi, offsetof (struct sigcontext, esi));
25         DEFINE(SIGCONTEXT_edi, offsetof (struct sigcontext, edi));
26         DEFINE(SIGCONTEXT_ebp, offsetof (struct sigcontext, ebp));
27         DEFINE(SIGCONTEXT_esp, offsetof (struct sigcontext, esp));
28         DEFINE(SIGCONTEXT_eip, offsetof (struct sigcontext, eip));
29         BLANK();
30
31         DEFINE(RT_SIGFRAME_sigcontext,
32                offsetof (struct rt_sigframe, uc.uc_mcontext));
33
34         DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
35 }