Merge branch 'linus' into perf/core, to fix conflicts
[deliverable/linux.git] / arch / x86 / include / asm / vsyscall.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_VSYSCALL_H
2#define _ASM_X86_VSYSCALL_H
1da177e4 3
75da736f 4#include <linux/seqlock.h>
af170c50 5#include <uapi/asm/vsyscall.h>
1da177e4 6
c08c8205
VP
7#define VGETCPU_RDTSCP 1
8#define VGETCPU_LSL 2
9
1da177e4 10/* kernel space (writeable) */
c08c8205 11extern int vgetcpu_mode;
1da177e4 12extern struct timezone sys_tz;
1da177e4 13
8c49d9a7
AL
14#include <asm/vvar.h>
15
e4026440
IM
16extern void map_vsyscall(void);
17
3ae36655
AL
18/*
19 * Called on instruction fetch fault in vsyscall page.
20 * Returns true if handled.
21 */
22extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
23
51c19b4f
MT
24#ifdef CONFIG_X86_64
25
26#define VGETCPU_CPU_MASK 0xfff
27
28static inline unsigned int __getcpu(void)
29{
30 unsigned int p;
31
32 if (VVAR(vgetcpu_mode) == VGETCPU_RDTSCP) {
33 /* Load per CPU data from RDTSCP */
34 native_read_tscp(&p);
35 } else {
36 /* Load per CPU data from GDT */
37 asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
38 }
39
40 return p;
41}
42#endif /* CONFIG_X86_64 */
43
1965aae3 44#endif /* _ASM_X86_VSYSCALL_H */
This page took 0.805198 seconds and 5 git commands to generate.