From 8c1ab65c0f548d20b7f177bdb736daaf603340e1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 15:54:38 +0200 Subject: Adding upstream version 0.0~git20221206.8b7148f. Signed-off-by: Daniel Baumann --- libc-top-half/musl/src/signal/mips64/restore.s | 11 +++++++ libc-top-half/musl/src/signal/mips64/sigsetjmp.s | 38 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 libc-top-half/musl/src/signal/mips64/restore.s create mode 100644 libc-top-half/musl/src/signal/mips64/sigsetjmp.s (limited to 'libc-top-half/musl/src/signal/mips64') diff --git a/libc-top-half/musl/src/signal/mips64/restore.s b/libc-top-half/musl/src/signal/mips64/restore.s new file mode 100644 index 0000000..401f8e7 --- /dev/null +++ b/libc-top-half/musl/src/signal/mips64/restore.s @@ -0,0 +1,11 @@ +.set noreorder +.global __restore_rt +.global __restore +.hidden __restore_rt +.hidden __restore +.type __restore_rt,@function +.type __restore,@function +__restore_rt: +__restore: + li $2,5211 + syscall diff --git a/libc-top-half/musl/src/signal/mips64/sigsetjmp.s b/libc-top-half/musl/src/signal/mips64/sigsetjmp.s new file mode 100644 index 0000000..156e70b --- /dev/null +++ b/libc-top-half/musl/src/signal/mips64/sigsetjmp.s @@ -0,0 +1,38 @@ +.set noreorder +.global sigsetjmp +.global __sigsetjmp +.type sigsetjmp,@function +.type __sigsetjmp,@function +sigsetjmp: +__sigsetjmp: + lui $3, %hi(%neg(%gp_rel(sigsetjmp))) + daddiu $3, $3, %lo(%neg(%gp_rel(sigsetjmp))) + + # comparing save mask with 0, if equals to 0 then + # sigsetjmp is equal to setjmp. + beq $5, $0, 1f + daddu $3, $3, $25 + sd $ra, 160($4) + sd $16, 168($4) + + # save base of got so that we can use it later + # once we return from 'longjmp' + sd $3, 176($4) + ld $25, %got_disp(setjmp)($3) + jalr $25 + move $16, $4 + + move $5, $2 # Return from 'setjmp' or 'longjmp' + move $4, $16 # Restore the pointer-to-sigjmp_buf + ld $ra, 160($4) # Restore ra of sigsetjmp + ld $16, 168($4) # Restore $16 of sigsetjmp + ld $3, 176($4) # Restore base of got + +.hidden __sigsetjmp_tail + ld $25, %got_disp(__sigsetjmp_tail)($3) + jr $25 + nop +1: + ld $25, %got_disp(setjmp)($3) + jr $25 + nop -- cgit v1.2.3