Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2003-06-10 19:32:27 +0400
committerAnthony Green <green@moxielogic.com>2003-06-10 19:32:27 +0400
commitbfdfd7e60d367dd3cbc64c46d1f1ec9fe6b41652 (patch)
tree0097c82a1fe150cc05126c4c06e3fb940f5ed5b2 /newlib/libc/machine/iq2000/setjmp.S
parentdcbf037e2b1e80bc83f2555decc38a473f2becf1 (diff)
Commit iq2000 port
Diffstat (limited to 'newlib/libc/machine/iq2000/setjmp.S')
-rw-r--r--newlib/libc/machine/iq2000/setjmp.S51
1 files changed, 51 insertions, 0 deletions
diff --git a/newlib/libc/machine/iq2000/setjmp.S b/newlib/libc/machine/iq2000/setjmp.S
new file mode 100644
index 000000000..cb094630d
--- /dev/null
+++ b/newlib/libc/machine/iq2000/setjmp.S
@@ -0,0 +1,51 @@
+/* This is a simple version of setjmp and longjmp for iq2000. */
+
+
+/* int setjmp (jmp_buf); */
+ .globl setjmp
+ .ent setjmp
+setjmp:
+ sw r16,0(r4) /* rs0 */
+ sw r17,4(r4) /* rs1 */
+ sw r18,8(r4) /* rs2 */
+ sw r19,12(r4) /* rs3 */
+ sw r20,16(r4) /* rs4 */
+ sw r21,20(r4) /* rs5 */
+ sw r22,24(r4) /* rs6 */
+ sw r23,28(r4) /* rs7 */
+ sw r30,32(r4) /* rs8 */
+
+ sw r29,36(r4)
+ sw r31,40(r4)
+
+ move r2,r0
+
+ j r31
+
+ .end setjmp
+
+/* volatile void longjmp (jmp_buf, int); */
+ .globl longjmp
+ .ent longjmp
+longjmp:
+ lw r16,0(r4) /* rs0 */
+ lw r17,4(r4) /* rs1 */
+ lw r18,8(r4) /* rs2 */
+ lw r19,12(r4) /* rs3 */
+ lw r20,16(r4) /* rs4 */
+ lw r21,20(r4) /* rs5 */
+ lw r22,24(r4) /* rs6 */
+ lw r23,28(r4) /* rs7 */
+ lw r30,32(r4) /* rs8 */
+
+ lw r29,36(r4)
+ lw r31,40(r4)
+
+ bne r5,r0,1f
+ li r5,1
+1:
+ move r2,r5
+
+ j r31
+
+ .end longjmp