License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / arch / x86 / kernel / asm-offsets_32.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
5de2b61a
BP
2#ifndef __LINUX_KBUILD_H
3# error "Please do not build this file directly, build asm-offsets.c instead"
4#endif
5
8d0d37cf 6#include <asm/ucontext.h>
8d0d37cf 7
cfcbadb4 8#define __SYSCALL_I386(nr, sym, qual) [nr] = 1,
303395ac
PA
9static char syscalls[] = {
10#include <asm/syscalls_32.h>
11};
12
8d0d37cf
TG
13/* workaround for a warning with -Wmissing-prototypes */
14void foo(void);
15
16void foo(void)
17{
8d0d37cf
TG
18 OFFSET(CPUINFO_x86, cpuinfo_x86, x86);
19 OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor);
20 OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model);
21 OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask);
8d0d37cf
TG
22 OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level);
23 OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability);
24 OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id);
25 BLANK();
26
65ea5b03
PA
27 OFFSET(PT_EBX, pt_regs, bx);
28 OFFSET(PT_ECX, pt_regs, cx);
29 OFFSET(PT_EDX, pt_regs, dx);
30 OFFSET(PT_ESI, pt_regs, si);
31 OFFSET(PT_EDI, pt_regs, di);
32 OFFSET(PT_EBP, pt_regs, bp);
33 OFFSET(PT_EAX, pt_regs, ax);
34 OFFSET(PT_DS, pt_regs, ds);
35 OFFSET(PT_ES, pt_regs, es);
36 OFFSET(PT_FS, pt_regs, fs);
ccbeed3a 37 OFFSET(PT_GS, pt_regs, gs);
65ea5b03
PA
38 OFFSET(PT_ORIG_EAX, pt_regs, orig_ax);
39 OFFSET(PT_EIP, pt_regs, ip);
40 OFFSET(PT_CS, pt_regs, cs);
41 OFFSET(PT_EFLAGS, pt_regs, flags);
42 OFFSET(PT_OLDESP, pt_regs, sp);
43 OFFSET(PT_OLDSS, pt_regs, ss);
8d0d37cf
TG
44 BLANK();
45
cc456c4e
KRW
46 OFFSET(saved_context_gdt_desc, saved_context, gdt_desc);
47 BLANK();
48
faca6227
PA
49 /* Offset from the sysenter stack to tss.sp0 */
50 DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
d828c71f 51 offsetofend(struct tss_struct, SYSENTER_stack));
8d0d37cf 52
7536656f
AL
53 /* Offset from cpu_tss to SYSENTER_stack */
54 OFFSET(CPU_TSS_SYSENTER_stack, tss_struct, SYSENTER_stack);
55 /* Size of SYSENTER_stack */
56 DEFINE(SIZEOF_SYSENTER_stack, sizeof(((struct tss_struct *)0)->SYSENTER_stack));
57
0100301b
BG
58#ifdef CONFIG_CC_STACKPROTECTOR
59 BLANK();
60 OFFSET(stack_canary_offset, stack_canary, canary);
61#endif
62
303395ac
PA
63 BLANK();
64 DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
65 DEFINE(NR_syscalls, sizeof(syscalls));
8d0d37cf 66}