blob: b986b2ca688a0e4fa24ace613c7e465e909723fe [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_VSYSCALL_H
3#define _ASM_X86_VSYSCALL_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
David Woodhouse75da7362006-09-16 12:15:48 -07005#include <linux/seqlock.h>
David Howellsaf170c52012-12-14 22:37:13 +00006#include <uapi/asm/vsyscall.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Andy Lutomirski1ad83c82014-10-29 14:33:47 -07008#ifdef CONFIG_X86_VSYSCALL_EMULATION
Ingo Molnare4026442008-01-30 13:32:39 +01009extern void map_vsyscall(void);
Andy Lutomirski85900ea2017-12-12 07:56:42 -080010extern void set_vsyscall_pgtable_user_bits(pgd_t *root);
Ingo Molnare4026442008-01-30 13:32:39 +010011
Andy Lutomirski3ae36652011-08-10 11:15:32 -040012/*
13 * Called on instruction fetch fault in vsyscall page.
14 * Returns true if handled.
15 */
16extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
Andy Lutomirski1ad83c82014-10-29 14:33:47 -070017#else
18static inline void map_vsyscall(void) {}
19static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
20{
21 return false;
22}
23#endif
Andy Lutomirski3ae36652011-08-10 11:15:32 -040024
H. Peter Anvin1965aae2008-10-22 22:26:29 -070025#endif /* _ASM_X86_VSYSCALL_H */