Path: blob/master/arch/x86/kernel/asm-offsets_32.c
10817 views
#include <asm/ucontext.h>12#include <linux/lguest.h>3#include "../../../drivers/lguest/lg.h"45/* workaround for a warning with -Wmissing-prototypes */6void foo(void);78void foo(void)9{10OFFSET(IA32_SIGCONTEXT_ax, sigcontext, ax);11OFFSET(IA32_SIGCONTEXT_bx, sigcontext, bx);12OFFSET(IA32_SIGCONTEXT_cx, sigcontext, cx);13OFFSET(IA32_SIGCONTEXT_dx, sigcontext, dx);14OFFSET(IA32_SIGCONTEXT_si, sigcontext, si);15OFFSET(IA32_SIGCONTEXT_di, sigcontext, di);16OFFSET(IA32_SIGCONTEXT_bp, sigcontext, bp);17OFFSET(IA32_SIGCONTEXT_sp, sigcontext, sp);18OFFSET(IA32_SIGCONTEXT_ip, sigcontext, ip);19BLANK();2021OFFSET(CPUINFO_x86, cpuinfo_x86, x86);22OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);23OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);24OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);25OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math);26OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);27OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);28OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);29BLANK();3031OFFSET(TI_sysenter_return, thread_info, sysenter_return);32OFFSET(TI_cpu, thread_info, cpu);33BLANK();3435OFFSET(PT_EBX, pt_regs, bx);36OFFSET(PT_ECX, pt_regs, cx);37OFFSET(PT_EDX, pt_regs, dx);38OFFSET(PT_ESI, pt_regs, si);39OFFSET(PT_EDI, pt_regs, di);40OFFSET(PT_EBP, pt_regs, bp);41OFFSET(PT_EAX, pt_regs, ax);42OFFSET(PT_DS, pt_regs, ds);43OFFSET(PT_ES, pt_regs, es);44OFFSET(PT_FS, pt_regs, fs);45OFFSET(PT_GS, pt_regs, gs);46OFFSET(PT_ORIG_EAX, pt_regs, orig_ax);47OFFSET(PT_EIP, pt_regs, ip);48OFFSET(PT_CS, pt_regs, cs);49OFFSET(PT_EFLAGS, pt_regs, flags);50OFFSET(PT_OLDESP, pt_regs, sp);51OFFSET(PT_OLDSS, pt_regs, ss);52BLANK();5354OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);55BLANK();5657/* Offset from the sysenter stack to tss.sp0 */58DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -59sizeof(struct tss_struct));6061#if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE)62BLANK();63OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled);64OFFSET(LGUEST_DATA_irq_pending, lguest_data, irq_pending);65OFFSET(LGUEST_DATA_pgdir, lguest_data, pgdir);6667BLANK();68OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc);69OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc);70OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3);71OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp);72OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc);73OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc);74OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt);75OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum);76OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode);77OFFSET(LGUEST_PAGES_regs, lguest_pages, regs);78#endif79}808182