1 #ifndef _ASM_X86_VSYSCALL_H
2 #define _ASM_X86_VSYSCALL_H
4 #include <linux/seqlock.h>
5 #include <uapi/asm/vsyscall.h>
7 #define VGETCPU_RDTSCP 1
10 /* kernel space (writeable) */
11 extern int vgetcpu_mode
;
12 extern struct timezone sys_tz
;
16 extern void map_vsyscall(void);
19 * Called on instruction fetch fault in vsyscall page.
20 * Returns true if handled.
22 extern bool emulate_vsyscall(struct pt_regs
*regs
, unsigned long address
);
26 #define VGETCPU_CPU_MASK 0xfff
28 static inline unsigned int __getcpu(void)
32 if (VVAR(vgetcpu_mode
) == VGETCPU_RDTSCP
) {
33 /* Load per CPU data from RDTSCP */
36 /* Load per CPU data from GDT */
37 asm("lsl %1,%0" : "=r" (p
) : "r" (__PER_CPU_SEG
));
42 #endif /* CONFIG_X86_64 */
44 #endif /* _ASM_X86_VSYSCALL_H */