This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Patch for libc/matchin/v850/setjmp.S
- To: newlib at sources dot redhat dot com
- Subject: Patch for libc/matchin/v850/setjmp.S
- From: Will Cohen <wcohen at redhat dot com>
- Date: Wed, 13 Sep 2000 09:29:00 -0400
- Organization: Red Hat, Inc.
There are a couple corrections required in the v850 setjmp/longjmp code.
These changes make the v850 setjmp/longjmp functions operation agree
with the manpage information.
* libc/machine/v850/setjmp.S (_setjmp): Save r1 rather than r0.
Added return value 0.
(_longjmp): Allow longjmp to return value of second argument
passed to it.
-Will Cohen
Index: ./newlib/libc/machine/v850/setjmp.S
===================================================================
RCS file: /cvs/cvsfiles/devo/newlib/libc/machine/v850/setjmp.S,v
retrieving revision 1.1
diff -c -2 -p -r1.1 setjmp.S
*** setjmp.S 1996/08/22 22:57:25 1.1
--- setjmp.S 2000/09/08 13:59:01
***************
*** 5,9 ****
.global _setjmp
_setjmp:
! st.w r0,0[r6]
st.w r3,4[r6]
st.w r4,8[r6]
--- 5,9 ----
.global _setjmp
_setjmp:
! st.w r1,0[r6]
st.w r3,4[r6]
st.w r4,8[r6]
*************** _setjmp:
*** 20,28 ****
st.w r30,52[r6]
st.w r31,56[r6]
jmp [r31]
.global _longjmp
_longjmp:
! ld.w 0[r6],r0
ld.w 4[r6],r3
ld.w 8[r6],r4
--- 20,29 ----
st.w r30,52[r6]
st.w r31,56[r6]
+ mov r0, r10
jmp [r31]
.global _longjmp
_longjmp:
! ld.w 0[r6],r1
ld.w 4[r6],r3
ld.w 8[r6],r4
*************** _longjmp:
*** 39,42 ****
ld.w 52[r6],r30
ld.w 56[r6],r31
! mov 1,r10
jmp [r31]
--- 40,47 ----
ld.w 52[r6],r30
ld.w 56[r6],r31
! cmp r7, r0
! jne 1f
! mov 1,r7
! 1:
! mov r7, r10
jmp [r31]