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