Skip to content

Commit eb6c6ed

Browse files
thiru-mcwgithub-cygwin
authored andcommitted
Cygwin: gendef: Implement sigsetjmp for AArch64
Co-authored-by: Radek Bartoň <radek.barton@microsoft.com> Signed-off-by: Thirumalai Nagalingam <thirumalai.nagalingam@multicorewareinc.com>
1 parent c6e7817 commit eb6c6ed

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

winsup/cygwin/scripts/gendef

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,28 @@ EOF
607607
# TODO: These are only stubs, they need to be implemented properly for AArch64.
608608
return <<EOF;
609609
.globl sigsetjmp
610+
.seh_proc sigsetjmp
610611
sigsetjmp:
612+
// prologue
613+
stp fp, lr, [sp, #-0x10]! // save FP and LR registers
614+
mov fp, sp // set FP to current SP
615+
.seh_endprologue
616+
str w1, [x0, #0x100] // buf->savemask = savemask
617+
cbz w1, 1f // If savemask == 0, skip fetching sigmask
618+
mov x3, x0 // save buf in x3
619+
sub sp, sp, #32 // Allocate 32 bytes on stack call
620+
mov x0, #0 // SIG_SETMASK
621+
mov x1, xzr // newmask = NULL
622+
add x2, x3, #0x108 // &buf->sigmask
623+
bl pthread_sigmask
624+
add sp, sp, #32
625+
1:
626+
bl setjmp
627+
// epilogue
628+
ldp fp, lr, [sp], #0x10 // restore saved FP and LR registers
629+
ret
630+
.seh_endproc
631+
611632
.globl setjmp
612633
setjmp:
613634
.globl siglongjmp

0 commit comments

Comments
 (0)