mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Optimize x86_64 system calls.
This commit is contained in:
parent
951b6edccd
commit
4e3692cf88
1 changed files with 0 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue