]> bbs.cooldavid.org Git - net-next-2.6.git/blame - arch/x86/kernel/asm-offsets_64.c
tracing: Define NR_syscalls for x86_64
[net-next-2.6.git] / arch / x86 / kernel / asm-offsets_64.c
CommitLineData
c3ca5f30
TG
1/*
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 */
a5a2f8e2 6#define COMPILE_OFFSETS
c3ca5f30
TG
7
8#include <linux/crypto.h>
9#include <linux/sched.h>
10#include <linux/stddef.h>
11#include <linux/errno.h>
12#include <linux/hardirq.h>
13#include <linux/suspend.h>
66916cd2 14#include <linux/kbuild.h>
c3ca5f30
TG
15#include <asm/processor.h>
16#include <asm/segment.h>
17#include <asm/thread_info.h>
18#include <asm/ia32.h>
bd53147d 19#include <asm/bootparam.h>
a8af7898 20#include <asm/suspend.h>
c3ca5f30 21
555cf2b5
JF
22#include <xen/interface/xen.h>
23
8869a2e5
HS
24#include <asm/sigframe.h>
25
c3ca5f30
TG
26#define __NO_STUBS 1
27#undef __SYSCALL
1965aae3 28#undef _ASM_X86_UNISTD_64_H
c3ca5f30
TG
29#define __SYSCALL(nr, sym) [nr] = 1,
30static char syscalls[] = {
31#include <asm/unistd.h>
32};
33
34int main(void)
35{
36#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
37 ENTRY(state);
38 ENTRY(flags);
c3ca5f30
TG
39 ENTRY(pid);
40 BLANK();
41#undef ENTRY
26ccb8a7 42#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
c3ca5f30
TG
43 ENTRY(flags);
44 ENTRY(addr_limit);
45 ENTRY(preempt_count);
46 ENTRY(status);
36197c92
RM
47#ifdef CONFIG_IA32_EMULATION
48 ENTRY(sysenter_return);
49#endif
c3ca5f30
TG
50 BLANK();
51#undef ENTRY
a59153dc
GOC
52#ifdef CONFIG_PARAVIRT
53 BLANK();
54 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
55 OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
56 OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
57 OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
58 OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
fab58420 59 OFFSET(PV_IRQ_adjust_exception_frame, pv_irq_ops, adjust_exception_frame);
a59153dc 60 OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
2be29982
JF
61 OFFSET(PV_CPU_usergs_sysret32, pv_cpu_ops, usergs_sysret32);
62 OFFSET(PV_CPU_usergs_sysret64, pv_cpu_ops, usergs_sysret64);
63 OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
a59153dc
GOC
64 OFFSET(PV_CPU_swapgs, pv_cpu_ops, swapgs);
65 OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
66#endif
67
68
c3ca5f30
TG
69#ifdef CONFIG_IA32_EMULATION
70#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry))
742fa54a
PA
71 ENTRY(ax);
72 ENTRY(bx);
73 ENTRY(cx);
74 ENTRY(dx);
75 ENTRY(si);
76 ENTRY(di);
77 ENTRY(bp);
78 ENTRY(sp);
79 ENTRY(ip);
c3ca5f30
TG
80 BLANK();
81#undef ENTRY
82 DEFINE(IA32_RT_SIGFRAME_sigcontext,
8869a2e5 83 offsetof (struct rt_sigframe_ia32, uc.uc_mcontext));
c3ca5f30
TG
84 BLANK();
85#endif
86 DEFINE(pbe_address, offsetof(struct pbe, address));
87 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
88 DEFINE(pbe_next, offsetof(struct pbe, next));
89 BLANK();
0de80bcc 90#define ENTRY(entry) DEFINE(pt_regs_ ## entry, offsetof(struct pt_regs, entry))
65ea5b03
PA
91 ENTRY(bx);
92 ENTRY(bx);
93 ENTRY(cx);
94 ENTRY(dx);
95 ENTRY(sp);
96 ENTRY(bp);
97 ENTRY(si);
98 ENTRY(di);
0de80bcc
RW
99 ENTRY(r8);
100 ENTRY(r9);
101 ENTRY(r10);
102 ENTRY(r11);
103 ENTRY(r12);
104 ENTRY(r13);
105 ENTRY(r14);
106 ENTRY(r15);
65ea5b03 107 ENTRY(flags);
0de80bcc
RW
108 BLANK();
109#undef ENTRY
110#define ENTRY(entry) DEFINE(saved_context_ ## entry, offsetof(struct saved_context, entry))
111 ENTRY(cr0);
112 ENTRY(cr2);
113 ENTRY(cr3);
114 ENTRY(cr4);
115 ENTRY(cr8);
116 BLANK();
117#undef ENTRY
ca241c75 118 DEFINE(TSS_ist, offsetof(struct tss_struct, x86_tss.ist));
c3ca5f30
TG
119 BLANK();
120 DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
121 BLANK();
122 DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
bd53147d
EB
123
124 BLANK();
125 OFFSET(BP_scratch, boot_params, scratch);
126 OFFSET(BP_loadflags, boot_params, hdr.loadflags);
127 OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch);
128 OFFSET(BP_version, boot_params, hdr.version);
37ba7ab5 129 OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
8c5e5ac3
JF
130
131 BLANK();
132 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
555cf2b5
JF
133#ifdef CONFIG_XEN
134 BLANK();
135 OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
136 OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
137#undef ENTRY
138#endif
c3ca5f30
TG
139 return 0;
140}