Better names for syscall/signal functions copied to the commpage.

This commit is contained in:
Alex Smith
2012-07-30 21:56:50 +01:00
parent 666b46e2e3
commit 02dd3236d2
4 changed files with 21 additions and 21 deletions
+8 -8
View File
@@ -18,10 +18,10 @@
// user syscall assembly stubs
extern "C" void _user_syscall_int(void);
extern unsigned int _user_syscall_int_end;
extern "C" void _user_syscall_sysenter(void);
extern unsigned int _user_syscall_sysenter_end;
extern "C" void x86_user_syscall_int(void);
extern unsigned int x86_user_syscall_int_end;
extern "C" void x86_user_syscall_sysenter(void);
extern unsigned int x86_user_syscall_sysenter_end;
// sysenter handler
extern "C" void x86_sysenter();
@@ -78,8 +78,8 @@ init_amd_syscall_registers(void* dummy, int cpuNum)
void
x86_initialize_syscall(void)
{
void* syscallCode = (void *)&_user_syscall_int;
void* syscallCodeEnd = &_user_syscall_int_end;
void* syscallCode = (void *)&x86_user_syscall_int;
void* syscallCodeEnd = &x86_user_syscall_int_end;
// check syscall
if (all_cpus_have_feature(FEATURE_COMMON, IA32_FEATURE_SEP)
@@ -89,8 +89,8 @@ x86_initialize_syscall(void)
dprintf("initialize_commpage_syscall(): sysenter/sysexit supported\n");
// the code to be used in userland
syscallCode = (void *)&_user_syscall_sysenter;
syscallCodeEnd = &_user_syscall_sysenter_end;
syscallCode = (void *)&x86_user_syscall_sysenter;
syscallCodeEnd = &x86_user_syscall_sysenter_end;
// tell all CPUs to init their sysenter/sysexit related registers
call_all_cpus_sync(&init_intel_syscall_registers, NULL);
+6 -6
View File
@@ -11,21 +11,21 @@
/* user space half of the syscall mechanism, to be copied into the commpage */
// int 99 fallback
FUNCTION(_user_syscall_int):
FUNCTION(x86_user_syscall_int):
int $99
ret
FUNCTION_END(_user_syscall_int)
SYMBOL(_user_syscall_int_end):
FUNCTION_END(x86_user_syscall_int)
SYMBOL(x86_user_syscall_int_end):
// Intel sysenter/sysexit
FUNCTION(_user_syscall_sysenter):
FUNCTION(x86_user_syscall_sysenter):
// sysexit forces us to trash edx (-> eip) and ecx (-> esp), but they are
// scratch registers anyway. We use ecx right away to store esp.
movl %esp, %ecx
sysenter
ret
FUNCTION_END(_user_syscall_sysenter)
SYMBOL(_user_syscall_sysenter_end):
FUNCTION_END(x86_user_syscall_sysenter)
SYMBOL(x86_user_syscall_sysenter_end):
+4 -4
View File
@@ -16,15 +16,15 @@
#include <smp.h>
extern "C" void _user_signal_handler(void);
extern int _user_signal_handler_end;
extern "C" void x86_64_user_signal_handler(void);
extern int x86_64_user_signal_handler_end;
void
x86_initialize_commpage_signal_handler()
{
void* handlerCode = (void*)&_user_signal_handler;
void* handlerCodeEnd = &_user_signal_handler_end;
void* handlerCode = (void*)&x86_64_user_signal_handler;
void* handlerCodeEnd = &x86_64_user_signal_handler_end;
// Copy the signal handler code to the commpage.
size_t len = (size_t)((addr_t)handlerCodeEnd - (addr_t)handlerCode);
+3 -3
View File
@@ -14,7 +14,7 @@
// Userspace signal handler wrapper, copied to the commpage.
FUNCTION(_user_signal_handler):
FUNCTION(x86_64_user_signal_handler):
push %rbp
movq %rsp, %rbp
@@ -52,5 +52,5 @@ FUNCTION(_user_signal_handler):
leaq SIGNAL_FRAME_DATA_context(%r12), %rdx
movq SIGNAL_FRAME_DATA_user_data(%r12), %rcx
jmp .Lcall_handler
FUNCTION_END(_user_signal_handler)
SYMBOL(_user_signal_handler_end):
FUNCTION_END(x86_64_user_signal_handler)
SYMBOL(x86_64_user_signal_handler_end):