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