vsyscall.h 803 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _ASM_X86_VSYSCALL_H
  2. #define _ASM_X86_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 VGETCPU_RDTSCP 1
  16. #define VGETCPU_LSL 2
  17. /* kernel space (writeable) */
  18. extern int vgetcpu_mode;
  19. extern struct timezone sys_tz;
  20. #include <asm/vvar.h>
  21. extern void map_vsyscall(void);
  22. /*
  23. * Called on instruction fetch fault in vsyscall page.
  24. * Returns true if handled.
  25. */
  26. extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
  27. #endif /* __KERNEL__ */
  28. #endif /* _ASM_X86_VSYSCALL_H */