1/*
2 * Copyright 2018, J��r��me Duval. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <asm_defs.h>
8
9
10.text
11
12/* user space half of the syscall mechanism, to be copied into the commpage */
13
14
15// Intel sysenter/sysexit
16FUNCTION(x86_user_syscall_sysenter):
17	// sysexit forces us to trash edx (-> eip) and ecx (-> esp), but they are
18	// scratch registers anyway. We use ecx right away to store esp.
19	movl	%esp, %ecx
20	sysenter
21	ret
22FUNCTION_END(x86_user_syscall_sysenter)
23SYMBOL(x86_user_syscall_sysenter_end):
24
25
26// AMD syscall/sysret
27FUNCTION(x86_user_syscall_syscall):
28	syscall
29	ret
30FUNCTION_END(x86_user_syscall_syscall)
31SYMBOL(x86_user_syscall_syscall_end):
32
33