summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/h8300/setjmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/h8300/setjmp.S')
-rw-r--r--libc/sysdeps/linux/h8300/setjmp.S46
1 files changed, 10 insertions, 36 deletions
diff --git a/libc/sysdeps/linux/h8300/setjmp.S b/libc/sysdeps/linux/h8300/setjmp.S
index 53ecf3dbe..5e487674b 100644
--- a/libc/sysdeps/linux/h8300/setjmp.S
+++ b/libc/sysdeps/linux/h8300/setjmp.S
@@ -1,49 +1,23 @@
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
#ifdef __H8300S__
.h8300s
#else
.h8300h
#endif
.text
-
-.global __setjmp
+
.global ___sigsetjmp
-.global ___longjmp
-__setjmp:
___sigsetjmp:
- add.l #20,er0
- mov.l er6,@er0
+ add.l #JB_SIZE,er0
+ mov.l @sp,er1 ; return PC
+ mov.l er1,@-er0
+ mov.l sp,@-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
-