xref: /haiku/src/system/kernel/arch/x86/x86_syscalls.h (revision 22440f4105cafc95cc1d49f9bc65bb395c527d86)
1 /*
2  * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_ARCH_X86_SYSCALLS_H
6 #define _KERNEL_ARCH_X86_SYSCALLS_H
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 void	x86_initialize_syscall();
13 
14 
15 #ifdef __x86_64__
16 
17 
18 static inline void
19 x86_set_syscall_stack(addr_t stackTop)
20 {
21 	// Nothing to do here, the thread's stack pointer is always accessible
22 	// via the GS segment.
23 }
24 
25 
26 #else
27 
28 
29 extern void (*gX86SetSyscallStack)(addr_t stackTop);
30 
31 
32 static inline void
33 x86_set_syscall_stack(addr_t stackTop)
34 {
35 	if (gX86SetSyscallStack != NULL)
36 		gX86SetSyscallStack(stackTop);
37 }
38 
39 
40 #endif	// __x86_64__
41 
42 #endif	// _KERNEL_ARCH_X86_SYSCALLS_H
43