arm64: Implement setjmp/longjmp.

Change-Id: I9cd2d5de27a3b110b185c658e980428fe49392b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5267
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
milek7 2022-03-28 21:35:04 +02:00 committed by waddlesplash
parent e9d04b25e6
commit 444980deb1
2 changed files with 25 additions and 5 deletions

View File

@ -11,9 +11,17 @@
FUNCTION(siglongjmp):
FUNCTION(longjmp):
FUNCTION(_longjmp):
/* Loop infinitely here, for now.
TODO implement this for real */
b .
ldp x19, x20, [x0], #16
ldp x21, x22, [x0], #16
ldp x23, x24, [x0], #16
ldp x25, x26, [x0], #16
ldp x27, x28, [x0], #16
ldp x29, x30, [x0], #16
ldr x2, [x0]
mov sp, x2
b __longjmp_return
FUNCTION_END(siglongjmp)
FUNCTION_END(longjmp)
FUNCTION_END(_longjmp)

View File

@ -8,7 +8,17 @@
/* int sigsetjmp(jmp_buf buffer, int saveMask) */
FUNCTION(__sigsetjmp):
FUNCTION(sigsetjmp):
b .
stp x19, x20, [x0], #16
stp x21, x22, [x0], #16
stp x23, x24, [x0], #16
stp x25, x26, [x0], #16
stp x27, x28, [x0], #16
stp x29, x30, [x0], #16
mov x2, sp
str x2, [x0]
b __setjmp_save_sigs
FUNCTION_END(sigsetjmp)
FUNCTION_END(__sigsetjmp)
@ -16,7 +26,9 @@ FUNCTION_END(__sigsetjmp)
/* int setjmp(jmp_buf buffer) */
FUNCTION(setjmp):
FUNCTION(_setjmp):
b .
mov x1, #0
b __sigsetjmp
FUNCTION_END(_setjmp)
FUNCTION_END(setjmp)
#pragma weak _setjmp=setjmp