aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/i386/kernel/asm-offsets.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/i386/kernel/asm-offsets.c')
-rw-r--r--arch/i386/kernel/asm-offsets.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c
new file mode 100644
index 000000000000..36d66e2077d0
--- /dev/null
+++ b/arch/i386/kernel/asm-offsets.c
@@ -0,0 +1,72 @@
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 <linux/personality.h>
10#include <linux/suspend.h>
11#include <asm/ucontext.h>
12#include "sigframe.h"
13#include <asm/fixmap.h>
14#include <asm/processor.h>
15#include <asm/thread_info.h>
16
17#define DEFINE(sym, val) \
18 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
19
20#define BLANK() asm volatile("\n->" : : )
21
22#define OFFSET(sym, str, mem) \
23 DEFINE(sym, offsetof(struct str, mem));
24
25void foo(void)
26{
27 OFFSET(SIGCONTEXT_eax, sigcontext, eax);
28 OFFSET(SIGCONTEXT_ebx, sigcontext, ebx);
29 OFFSET(SIGCONTEXT_ecx, sigcontext, ecx);
30 OFFSET(SIGCONTEXT_edx, sigcontext, edx);
31 OFFSET(SIGCONTEXT_esi, sigcontext, esi);
32 OFFSET(SIGCONTEXT_edi, sigcontext, edi);
33 OFFSET(SIGCONTEXT_ebp, sigcontext, ebp);
34 OFFSET(SIGCONTEXT_esp, sigcontext, esp);
35 OFFSET(SIGCONTEXT_eip, sigcontext, eip);
36 BLANK();
37
38 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
39 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
40 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
41 OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);
42 OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math);
43 OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
44 OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
45 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
46 BLANK();
47
48 OFFSET(TI_task, thread_info, task);
49 OFFSET(TI_exec_domain, thread_info, exec_domain);
50 OFFSET(TI_flags, thread_info, flags);
51 OFFSET(TI_status, thread_info, status);
52 OFFSET(TI_cpu, thread_info, cpu);
53 OFFSET(TI_preempt_count, thread_info, preempt_count);
54 OFFSET(TI_addr_limit, thread_info, addr_limit);
55 OFFSET(TI_restart_block, thread_info, restart_block);
56 BLANK();
57
58 OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
59 OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
60 BLANK();
61
62 OFFSET(pbe_address, pbe, address);
63 OFFSET(pbe_orig_address, pbe, orig_address);
64 OFFSET(pbe_next, pbe, next);
65
66 /* Offset from the sysenter stack to tss.esp0 */
67 DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) -
68 sizeof(struct tss_struct));
69
70 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
71 DEFINE(VSYSCALL_BASE, __fix_to_virt(FIX_VSYSCALL));
72}