Optimize x86_64 system calls.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-05-20 20:08:40 +02:00
parent 951b6edccd
commit 4e3692cf88
1 changed files with 0 additions and 16 deletions

View File

@ -35,15 +35,6 @@ syscall_handler:
movl $0, global_errno # Reset errno
pushq %rbp
# Grant ourselves kernel permissions to the data segment.
movl %ds, %ebp
pushq %rbp
movw $0x10, %bp
movl %ebp, %ds
movl %ebp, %es
movl %ebp, %fs
movl %ebp, %gs
# Make sure the requested system call is valid, if not, then fix it.
cmp SYSCALL_MAX, %rax
jae fix_syscall
@ -58,13 +49,6 @@ valid_syscall:
# Call the system call.
callq *%rax
# Restore the previous permissions to data segment.
popq %rbp
movl %ebp, %ds
movl %ebp, %es
movl %ebp, %fs
movl %ebp, %gs
# Return to user-space, system call result in %rax:%rdx, errno in %ecx.
popq %rbp
movl global_errno, %ecx