vsyscall.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _ASM_X86_64_VSYSCALL_H_
  2. #define _ASM_X86_64_VSYSCALL_H_
  3. enum vsyscall_num {
  4. __NR_vgettimeofday,
  5. __NR_vtime,
  6. __NR_vgetcpu,
  7. };
  8. #define VSYSCALL_START (-10UL << 20)
  9. #define VSYSCALL_SIZE 1024
  10. #define VSYSCALL_END (-2UL << 20)
  11. #define VSYSCALL_MAPPED_PAGES 1
  12. #define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
  13. #ifdef __KERNEL__
  14. #include <linux/seqlock.h>
  15. #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16)))
  16. #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16)))
  17. /* Definitions for CONFIG_GENERIC_TIME definitions */
  18. #define __section_vsyscall_gtod_data __attribute__ \
  19. ((unused, __section__ (".vsyscall_gtod_data"),aligned(16)))
  20. #define __section_vsyscall_clock __attribute__ \
  21. ((unused, __section__ (".vsyscall_clock"),aligned(16)))
  22. #define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn")))
  23. #define VGETCPU_RDTSCP 1
  24. #define VGETCPU_LSL 2
  25. extern int __vgetcpu_mode;
  26. extern volatile unsigned long __jiffies;
  27. /* kernel space (writeable) */
  28. extern int vgetcpu_mode;
  29. extern struct timezone sys_tz;
  30. #endif /* __KERNEL__ */
  31. #endif /* _ASM_X86_64_VSYSCALL_H_ */