xref: /openbmc/linux/arch/x86/include/asm/vsyscall.h (revision 1965aae3c98397aad957412413c07e97b1bd4e64)
1*1965aae3SH. Peter Anvin #ifndef _ASM_X86_VSYSCALL_H
2*1965aae3SH. Peter Anvin #define _ASM_X86_VSYSCALL_H
3bb898558SAl Viro 
4bb898558SAl Viro enum vsyscall_num {
5bb898558SAl Viro 	__NR_vgettimeofday,
6bb898558SAl Viro 	__NR_vtime,
7bb898558SAl Viro 	__NR_vgetcpu,
8bb898558SAl Viro };
9bb898558SAl Viro 
10bb898558SAl Viro #define VSYSCALL_START (-10UL << 20)
11bb898558SAl Viro #define VSYSCALL_SIZE 1024
12bb898558SAl Viro #define VSYSCALL_END (-2UL << 20)
13bb898558SAl Viro #define VSYSCALL_MAPPED_PAGES 1
14bb898558SAl Viro #define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
15bb898558SAl Viro 
16bb898558SAl Viro #ifdef __KERNEL__
17bb898558SAl Viro #include <linux/seqlock.h>
18bb898558SAl Viro 
19bb898558SAl Viro #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16)))
20bb898558SAl Viro #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16)))
21bb898558SAl Viro 
22bb898558SAl Viro /* Definitions for CONFIG_GENERIC_TIME definitions */
23bb898558SAl Viro #define __section_vsyscall_gtod_data __attribute__ \
24bb898558SAl Viro 	((unused, __section__ (".vsyscall_gtod_data"),aligned(16)))
25bb898558SAl Viro #define __section_vsyscall_clock __attribute__ \
26bb898558SAl Viro 	((unused, __section__ (".vsyscall_clock"),aligned(16)))
27bb898558SAl Viro #define __vsyscall_fn \
28bb898558SAl Viro 	__attribute__ ((unused, __section__(".vsyscall_fn"))) notrace
29bb898558SAl Viro 
30bb898558SAl Viro #define VGETCPU_RDTSCP	1
31bb898558SAl Viro #define VGETCPU_LSL	2
32bb898558SAl Viro 
33bb898558SAl Viro extern int __vgetcpu_mode;
34bb898558SAl Viro extern volatile unsigned long __jiffies;
35bb898558SAl Viro 
36bb898558SAl Viro /* kernel space (writeable) */
37bb898558SAl Viro extern int vgetcpu_mode;
38bb898558SAl Viro extern struct timezone sys_tz;
39bb898558SAl Viro 
40bb898558SAl Viro extern void map_vsyscall(void);
41bb898558SAl Viro 
42bb898558SAl Viro #endif /* __KERNEL__ */
43bb898558SAl Viro 
44*1965aae3SH. Peter Anvin #endif /* _ASM_X86_VSYSCALL_H */
45