-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usermode: improve syscall implementation
Main change is a split of the syscall implementation with proper assembly routines: syscall_handler_entry() and simplified syscall_exit() and a simplified C-level syscall handler function. The syscall_exit() is implemented and handled fully in asm. The syscall() usermode function implements typical syscall ABI, passing syscall number via AX register and the rest of parameters via SI, DX, DI, R8 and R9. The assembly entry point rearranges the registers to fix the C-level handler function API. Only 5 arguments to the syscall can be provided. Usermode upon calling syscall() takes are of callee saved registers by saving/restoring them via usermode stack (only reminder of unused registers is preserved as the rest is considered implicitely clobbered). Additionally SYSCALL_PRINTF has been improved to support variadic number of arguments (it passes the va_list args to the kernel mode). Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
- Loading branch information
Showing
5 changed files
with
117 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.