summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/h8300/setjmp.S
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-02 19:03:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-02 19:03:57 +0000
commit8dc1d08d0c3a5abe3856b04a5a864227fe0ba62d (patch)
tree65d254a60aec64fb933cf3c4c11ffa7235e02413 /libc/sysdeps/linux/h8300/setjmp.S
parent327b0c83302af0a288c65a03f4f2c82af321bd28 (diff)
Add in support for the Hitach H8/300H architecture,
contributed by Yoshinori Sato <qzb04471@nifty.ne.jp>
Diffstat (limited to 'libc/sysdeps/linux/h8300/setjmp.S')
-rw-r--r--libc/sysdeps/linux/h8300/setjmp.S43
1 files changed, 43 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/h8300/setjmp.S b/libc/sysdeps/linux/h8300/setjmp.S
new file mode 100644
index 000000000..97b91e204
--- /dev/null
+++ b/libc/sysdeps/linux/h8300/setjmp.S
@@ -0,0 +1,43 @@
+.h8300h
+.text
+
+.global __setjmp
+.global _longjmp
+
+__setjmp:
+ add.l #20,er0
+ mov.l er6,@er0
+ mov.l er5,@-er0
+ mov.l er4,@-er0
+ mov.l er3,@-er0
+ mov.l er2,@-er0
+ mov.l er1,@-er0
+ mov.l sp,@(24,er0)
+ mov.l @sp,er1
+ mov.l er1,@(28,er0)
+ sub.l er0,er0
+ rts
+
+_longjmp:
+ mov.l er1,er1
+ bne 1f
+ sub.l er1,er1
+ inc.l #1,er1
+1:
+ adds #4,er0
+ adds #4,er0
+ mov.l @er0+,er3
+ mov.l @er0+,er4
+ mov.l @er0+,er5
+ mov.l @er0+,er6
+ mov.l @er0+,sp
+ mov.l @er0,er2
+ mov.l er2,@sp
+ mov.l er1,er2
+ mov.l er0,er1
+ mov.l er2,er0
+ sub.l #28,er1
+ mov.l @(4,er1),er2
+ mov.l @er1,er1
+ rts
+