Borislav Petkov | 5de2b61 | 2014-12-09 16:45:17 +0100 | [diff] [blame] | 1 | #ifndef __LINUX_KBUILD_H |
| 2 | # error "Please do not build this file directly, build asm-offsets.c instead" |
| 3 | #endif |
| 4 | |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 5 | #include <asm/ucontext.h> |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 6 | |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 7 | #include <linux/lguest.h> |
| 8 | #include "../../../drivers/lguest/lg.h" |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 9 | |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 10 | #define __SYSCALL_I386(nr, sym, compat) [nr] = 1, |
| 11 | static char syscalls[] = { |
| 12 | #include <asm/syscalls_32.h> |
| 13 | }; |
| 14 | |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 15 | /* workaround for a warning with -Wmissing-prototypes */ |
| 16 | void foo(void); |
| 17 | |
| 18 | void foo(void) |
| 19 | { |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 20 | OFFSET(CPUINFO_x86, cpuinfo_x86, x86); |
| 21 | OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); |
| 22 | OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); |
| 23 | OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 24 | OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); |
| 25 | OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); |
| 26 | OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); |
| 27 | BLANK(); |
| 28 | |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 29 | OFFSET(PT_EBX, pt_regs, bx); |
| 30 | OFFSET(PT_ECX, pt_regs, cx); |
| 31 | OFFSET(PT_EDX, pt_regs, dx); |
| 32 | OFFSET(PT_ESI, pt_regs, si); |
| 33 | OFFSET(PT_EDI, pt_regs, di); |
| 34 | OFFSET(PT_EBP, pt_regs, bp); |
| 35 | OFFSET(PT_EAX, pt_regs, ax); |
| 36 | OFFSET(PT_DS, pt_regs, ds); |
| 37 | OFFSET(PT_ES, pt_regs, es); |
| 38 | OFFSET(PT_FS, pt_regs, fs); |
Tejun Heo | ccbeed3 | 2009-02-09 22:17:40 +0900 | [diff] [blame] | 39 | OFFSET(PT_GS, pt_regs, gs); |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 40 | OFFSET(PT_ORIG_EAX, pt_regs, orig_ax); |
| 41 | OFFSET(PT_EIP, pt_regs, ip); |
| 42 | OFFSET(PT_CS, pt_regs, cs); |
| 43 | OFFSET(PT_EFLAGS, pt_regs, flags); |
| 44 | OFFSET(PT_OLDESP, pt_regs, sp); |
| 45 | OFFSET(PT_OLDSS, pt_regs, ss); |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 46 | BLANK(); |
| 47 | |
Konrad Rzeszutek Wilk | cc456c4 | 2013-05-01 21:53:30 -0400 | [diff] [blame] | 48 | OFFSET(saved_context_gdt_desc, saved_context, gdt_desc); |
| 49 | BLANK(); |
| 50 | |
H. Peter Anvin | faca622 | 2008-01-30 13:31:02 +0100 | [diff] [blame] | 51 | /* Offset from the sysenter stack to tss.sp0 */ |
| 52 | DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) - |
Denys Vlasenko | d828c71 | 2015-03-09 15:52:18 +0100 | [diff] [blame] | 53 | offsetofend(struct tss_struct, SYSENTER_stack)); |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 54 | |
Tony Breeds | db342d2 | 2008-02-19 08:16:03 +0100 | [diff] [blame] | 55 | #if defined(CONFIG_LGUEST) || defined(CONFIG_LGUEST_GUEST) || defined(CONFIG_LGUEST_MODULE) |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 56 | BLANK(); |
| 57 | OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); |
Rusty Russell | 61f4bc8 | 2009-06-12 22:27:03 -0600 | [diff] [blame] | 58 | OFFSET(LGUEST_DATA_irq_pending, lguest_data, irq_pending); |
Rusty Russell | f6c540c | 2008-02-04 07:11:10 +1100 | [diff] [blame] | 59 | |
Rusty Russell | f6c540c | 2008-02-04 07:11:10 +1100 | [diff] [blame] | 60 | BLANK(); |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 61 | OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc); |
| 62 | OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc); |
| 63 | OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3); |
| 64 | OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp); |
| 65 | OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc); |
| 66 | OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc); |
| 67 | OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt); |
| 68 | OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum); |
| 69 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); |
| 70 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); |
| 71 | #endif |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 72 | BLANK(); |
| 73 | DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); |
| 74 | DEFINE(NR_syscalls, sizeof(syscalls)); |
Thomas Gleixner | 8d0d37c | 2007-10-11 11:12:08 +0200 | [diff] [blame] | 75 | } |