mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[libj6] Create libj6
Pull syscall code out of libc and create new libj6. This should eventually become a vDSO, but for now it can still be a static lib. Also renames all the _syscall_* symbol names to j6_*
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
extern _syscall_process_exit
|
||||
extern j6_process_exit
|
||||
global _PDCLIB_Exit
|
||||
_PDCLIB_Exit:
|
||||
; arg should already be in rdi
|
||||
jmp _syscall_process_exit
|
||||
jmp j6_process_exit
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
%macro SYSCALL 2
|
||||
global _syscall_%1
|
||||
_syscall_%1:
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
; args should already be in rdi, etc, but rcx will
|
||||
; get stomped, so stash it in r10, which isn't a
|
||||
; callee-saved register, but also isn't used in the
|
||||
; function call ABI.
|
||||
mov r10, rcx
|
||||
|
||||
mov rax, %2
|
||||
syscall
|
||||
; result is now already in rax, so just return
|
||||
|
||||
pop rbp
|
||||
ret
|
||||
%endmacro
|
||||
|
||||
%define SYSCALL(n, name) SYSCALL name, n
|
||||
%define SYSCALL(n, name, a) SYSCALL name, n
|
||||
%define SYSCALL(n, name, a, b) SYSCALL name, n
|
||||
%define SYSCALL(n, name, a, b, c) SYSCALL name, n
|
||||
%define SYSCALL(n, name, a, b, c, d) SYSCALL name, n
|
||||
%define SYSCALL(n, name, a, b, c, d, e) SYSCALL name, n
|
||||
|
||||
%include "j6/tables/syscalls.inc"
|
||||
Reference in New Issue
Block a user