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