[kernel] Branch to __darling_bsd_syscall instead of using svc syscall

This commit is contained in:
Thomas A 2021-12-11 21:03:34 -08:00
parent b50131844d
commit 1f899c79a1
3 changed files with 34 additions and 0 deletions

View File

@ -472,6 +472,18 @@ pseudo: ;\
* TBD * TBD
*/ */
#ifdef DARLING
#define DO_SYSCALL(num, cerror) \
mov x16, #(num) %%\
bl __darling_bsd_syscall %%\
b.cc 2f %%\
PUSH_FRAME %%\
bl _##cerror %%\
POP_FRAME %%\
ret %%\
2:
#else
#define DO_SYSCALL(num, cerror) \ #define DO_SYSCALL(num, cerror) \
mov x16, #(num) %%\ mov x16, #(num) %%\
svc #SWI_SYSCALL %%\ svc #SWI_SYSCALL %%\
@ -481,6 +493,7 @@ pseudo: ;\
POP_FRAME %%\ POP_FRAME %%\
ret %%\ ret %%\
2: 2:
#endif
#define MI_GET_ADDRESS(reg,var) \ #define MI_GET_ADDRESS(reg,var) \
adrp reg, var@page %%\ adrp reg, var@page %%\

View File

@ -472,6 +472,18 @@ pseudo: ;\
* TBD * TBD
*/ */
#if DARLING
#define DO_SYSCALL(num, cerror) \
mov x16, #(num) %%\
bl __darling_bsd_syscall %%\
b.cc 2f %%\
PUSH_FRAME %%\
bl _##cerror %%\
POP_FRAME %%\
ret %%\
2:
#else
#define DO_SYSCALL(num, cerror) \ #define DO_SYSCALL(num, cerror) \
mov x16, #(num) %%\ mov x16, #(num) %%\
svc #SWI_SYSCALL %%\ svc #SWI_SYSCALL %%\
@ -481,6 +493,7 @@ pseudo: ;\
POP_FRAME %%\ POP_FRAME %%\
ret %%\ ret %%\
2: 2:
#endif
#define MI_GET_ADDRESS(reg,var) \ #define MI_GET_ADDRESS(reg,var) \
adrp reg, var@page %%\ adrp reg, var@page %%\

View File

@ -262,7 +262,11 @@ L_mach_absolute_time_user:
.globl _mach_absolute_time_kernel .globl _mach_absolute_time_kernel
_mach_absolute_time_kernel: _mach_absolute_time_kernel:
mov w16, #-3 // Load the magic MAT number mov w16, #-3 // Load the magic MAT number
#ifdef DARLING
bl __darling_bsd_syscall
#else
svc #SWI_SYSCALL svc #SWI_SYSCALL
#endif
ret ret
.text .text
@ -270,7 +274,11 @@ _mach_absolute_time_kernel:
.globl _mach_continuous_time_kernel .globl _mach_continuous_time_kernel
_mach_continuous_time_kernel: _mach_continuous_time_kernel:
mov w16, #-4 // Load the magic MCT number mov w16, #-4 // Load the magic MCT number
#ifdef DARLING
bl __darling_bsd_syscall
#else
svc #SWI_SYSCALL svc #SWI_SYSCALL
#endif
ret ret
#else #else