xref: /haiku/src/system/kernel/arch/x86/x86_syscalls.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2018, Jérôme Duval, jerome.duval@gmail.com.
3  * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef _KERNEL_ARCH_X86_SYSCALLS_H
7 #define _KERNEL_ARCH_X86_SYSCALLS_H
8 
9 
10 #include <SupportDefs.h>
11 
12 
13 void	x86_initialize_syscall();
14 #if defined(__x86_64__) && defined(_COMPAT_MODE)
15 void	x86_compat_initialize_syscall();
16 #endif
17 
18 
19 extern void (*gX86SetSyscallStack)(addr_t stackTop);
20 
21 
22 static inline void
23 x86_set_syscall_stack(addr_t stackTop)
24 {
25 #if !defined(__x86_64__) || defined(_COMPAT_MODE)
26 	// TODO on x86_64, only necessary for 32-bit threads
27 	if (gX86SetSyscallStack != NULL)
28 		gX86SetSyscallStack(stackTop);
29 #endif
30 }
31 
32 
33 #endif	// _KERNEL_ARCH_X86_SYSCALLS_H
34