[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:
@@ -6,7 +6,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SYSCALL(n, name, ...) j6_status_t _syscall_ ## name (__VA_ARGS__);
|
||||
#define SYSCALL(n, name, ...) j6_status_t j6_ ## name (__VA_ARGS__);
|
||||
#include "j6/tables/syscalls.inc"
|
||||
#undef SYSCALL
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%macro SYSCALL 2
|
||||
global _syscall_%1
|
||||
_syscall_%1:
|
||||
global j6_%1
|
||||
j6_%1:
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -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,6 +1,6 @@
|
||||
#include <stdint.h>
|
||||
#include <j6/errors.h>
|
||||
#include <j6libc/syscalls.h>
|
||||
#include <j6/syscalls.h>
|
||||
//void *sbrk(intptr_t) __attribute__ ((weak));
|
||||
|
||||
static j6_handle_t __core_handle = 0;
|
||||
@@ -19,7 +19,7 @@ void *sbrk(intptr_t i)
|
||||
if (i < 0)
|
||||
return (void*)-1;
|
||||
|
||||
j6_status_t result = _syscall_vma_create_map(&__core_handle, i, __core_base, 1);
|
||||
j6_status_t result = j6_vma_create_map(&__core_handle, i, __core_base, 1);
|
||||
if (result != j6_status_ok)
|
||||
return (void*)-1;
|
||||
|
||||
@@ -28,7 +28,7 @@ void *sbrk(intptr_t i)
|
||||
}
|
||||
|
||||
size_t new_size = __core_size + i;
|
||||
j6_status_t result = _syscall_vma_resize(__core_handle, &new_size);
|
||||
j6_status_t result = j6_vma_resize(__core_handle, &new_size);
|
||||
if (result != j6_status_ok)
|
||||
return (void*)-1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user