diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-04-18 05:19:13 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-04-18 05:19:13 +0000 |
commit | 5972c4a4113e2a4de5edf519faf15296ae1eb3ed (patch) | |
tree | 6e808f23bb96a9b8a82eb505e2a719f4f42a758d /src/signal | |
parent | 6d99ad91e869aab35a4d76d34c3c9eaf29482bad (diff) | |
download | musl-5972c4a4113e2a4de5edf519faf15296ae1eb3ed.tar.gz musl-5972c4a4113e2a4de5edf519faf15296ae1eb3ed.tar.bz2 musl-5972c4a4113e2a4de5edf519faf15296ae1eb3ed.tar.xz musl-5972c4a4113e2a4de5edf519faf15296ae1eb3ed.zip |
add mips n32 port (ILP32 ABI for mips64)
based on patch submitted by Jaydeep Patil, with minor changes.
Diffstat (limited to 'src/signal')
-rw-r--r-- | src/signal/mipsn32/restore.s | 9 | ||||
-rw-r--r-- | src/signal/mipsn32/sigsetjmp.s | 38 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/signal/mipsn32/restore.s b/src/signal/mipsn32/restore.s new file mode 100644 index 00000000..0d1c1c5e --- /dev/null +++ b/src/signal/mipsn32/restore.s @@ -0,0 +1,9 @@ +.set noreorder +.global __restore_rt +.global __restore +.type __restore_rt,@function +.type __restore,@function +__restore_rt: +__restore: + li $2,6211 + syscall diff --git a/src/signal/mipsn32/sigsetjmp.s b/src/signal/mipsn32/sigsetjmp.s new file mode 100644 index 00000000..c0c6961f --- /dev/null +++ b/src/signal/mipsn32/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))) + addiu $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 + addu $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) + lw $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 + lw $25, %got_disp(__sigsetjmp_tail)($3) + jr $25 + nop +1: + lw $25, %got_disp(setjmp)($3) + jr $25 + nop |