asm-offsets_64.c 1.4 KB
Newer Older
1 2 3 4
#ifndef __LINUX_KBUILD_H
# error "Please do not build this file directly, build asm-offsets.c instead"
#endif

5
#include <asm/ia32.h>
6

7
#define __SYSCALL_64(nr, sym, qual) [nr] = 1,
8 9 10
static char syscalls_64[] = {
#include <asm/syscalls_64.h>
};
11
#define __SYSCALL_I386(nr, sym, qual) [nr] = 1,
12 13
static char syscalls_ia32[] = {
#include <asm/syscalls_32.h>
14 15 16 17
};

int main(void)
{
18
#ifdef CONFIG_PARAVIRT
19
	OFFSET(PV_IRQ_adjust_exception_frame, pv_irq_ops, adjust_exception_frame);
20
	OFFSET(PV_CPU_usergs_sysret64, pv_cpu_ops, usergs_sysret64);
21
	OFFSET(PV_CPU_swapgs, pv_cpu_ops, swapgs);
22
	BLANK();
23 24
#endif

25
#define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry)
26 27 28 29 30 31 32
	ENTRY(bx);
	ENTRY(cx);
	ENTRY(dx);
	ENTRY(sp);
	ENTRY(bp);
	ENTRY(si);
	ENTRY(di);
33 34 35 36 37 38 39 40
	ENTRY(r8);
	ENTRY(r9);
	ENTRY(r10);
	ENTRY(r11);
	ENTRY(r12);
	ENTRY(r13);
	ENTRY(r14);
	ENTRY(r15);
41
	ENTRY(flags);
42 43
	BLANK();
#undef ENTRY
44 45

#define ENTRY(entry) OFFSET(saved_context_ ## entry, saved_context, entry)
46 47 48 49 50
	ENTRY(cr0);
	ENTRY(cr2);
	ENTRY(cr3);
	ENTRY(cr4);
	ENTRY(cr8);
51
	ENTRY(gdt_desc);
52 53
	BLANK();
#undef ENTRY
54

55
	OFFSET(TSS_ist, tss_struct, x86_tss.ist);
56
	OFFSET(TSS_sp0, tss_struct, x86_tss.sp0);
57
	BLANK();
58

59 60 61
	DEFINE(__NR_syscall_max, sizeof(syscalls_64) - 1);
	DEFINE(NR_syscalls, sizeof(syscalls_64));

62
	DEFINE(__NR_syscall_compat_max, sizeof(syscalls_ia32) - 1);
63
	DEFINE(IA32_NR_syscalls, sizeof(syscalls_ia32));
64

65 66
	return 0;
}