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.
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>
14 #include <asm/processor.h>
15 #include <asm/segment.h>
16 #include <asm/thread_info.h>
22 #define DEFINE(sym, val) \
23 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
25 #define BLANK() asm volatile("\n->" : : )
28 * This is used to automatically count the number of system calls.
29 * A table is generated with one entry for each system call defined in
30 * arch/unistd.h, which contains the list of system calls.
34 #undef _ARCH_X86_64_UNISTD_H
35 #define __SYSCALL(nr, sym) [nr] = 1,
36 static char syscalls[] = {
37 #include <arch/unistd.h>
42 #define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
51 #define ENTRY(entry) DEFINE(tsk_arch_ ## entry, offsetof(struct task_struct, arch) + offsetof(struct arch_task, entry))
56 #define ENTRY(entry) DEFINE(tsk_arch_ ## entry, offsetof(struct task_struct, arch) + offsetof(struct arch_task, thread) + offsetof(struct thread_struct, entry))
60 #define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
71 DEFINE(pbe_address, offsetof(struct pbe, address));
72 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
73 DEFINE(pbe_next, offsetof(struct pbe, next));
75 DEFINE(TSS_ist, offsetof(struct tss_struct, ist));
78 DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);