^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _ASM_X86_VSYSCALL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _ASM_X86_VSYSCALL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/seqlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <uapi/asm/vsyscall.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifdef CONFIG_X86_VSYSCALL_EMULATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) extern void map_vsyscall(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) extern void set_vsyscall_pgtable_user_bits(pgd_t *root);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * Called on instruction fetch fault in vsyscall page.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Returns true if handled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) extern bool emulate_vsyscall(unsigned long error_code,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct pt_regs *regs, unsigned long address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) static inline void map_vsyscall(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static inline bool emulate_vsyscall(unsigned long error_code,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct pt_regs *regs, unsigned long address)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif /* _ASM_X86_VSYSCALL_H */