aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-11-20 17:24:57 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-11-20 17:24:57 +0000
commit505746ad22f5f15466be71fafb03952587165461 (patch)
tree9048be90ad74f20070e1243a62616c77692ef3b7
parent647b92a7d420bee9244054947379f026d105def8 (diff)
downloadnewlib-505746ad22f5f15466be71fafb03952587165461.zip
newlib-505746ad22f5f15466be71fafb03952587165461.tar.gz
newlib-505746ad22f5f15466be71fafb03952587165461.tar.bz2
2002-11-20 Ryo Tsuruta <ryo@kitanet.ne.jp>
* libc/machine/h8300/setjmp.S (setjmp, longjmp): Combine common code for __H8300H__ and __H8300S__. Also return 32-bit return code when -mint32 is used.
-rw-r--r--newlib/ChangeLog6
-rw-r--r--newlib/libc/machine/h8300/setjmp.S33
2 files changed, 18 insertions, 21 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 63e1be2..b3fcc58 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-20 Ryo Tsuruta <ryo@kitanet.ne.jp>
+
+ * libc/machine/h8300/setjmp.S (setjmp, longjmp): Combine common
+ code for __H8300H__ and __H8300S__. Also return 32-bit return code
+ when -mint32 is used.
+
2002-11-18 Nick Clifton <nickc@redhat.com>
* libc/sys/arm/crt0.S: Add NULL to end of argv array.
diff --git a/newlib/libc/machine/h8300/setjmp.S b/newlib/libc/machine/h8300/setjmp.S
index 9e71640..5c44973 100644
--- a/newlib/libc/machine/h8300/setjmp.S
+++ b/newlib/libc/machine/h8300/setjmp.S
@@ -12,21 +12,14 @@
.align 2
.global _setjmp
_setjmp:
-#ifdef __H8300H__
- mov.l er7,@er0
- mov.l er6,@(4,er0)
- mov.l er5,@(8,er0)
- mov.l er4,@(12,er0)
- mov.l @sp,er1
- mov.l er1,@(16,er0)
-#else
-#ifdef __H8300S__
+#if defined(__H8300H__) || defined(__H8300S__)
mov.l er7,@er0
mov.l er6,@(4,er0)
mov.l er5,@(8,er0)
mov.l er4,@(12,er0)
mov.l @sp,er1
mov.l er1,@(16,er0)
+ sub.l er0,er0
#else
mov.w r7,@r0
mov.w r6,@(2,r0)
@@ -34,28 +27,27 @@ _setjmp:
mov.w r4,@(6,r0)
mov.w @sp,r1
mov.w r1,@(8,r0)
-#endif
-#endif
sub.w r0,r0
+#endif
rts
.global _longjmp
_longjmp:
-#ifdef __H8300H__
+#if defined(__H8300H__) || defined (__H8300S__)
mov.l @er0+,er7
mov.l @er0+,er6
mov.l @er0+,er5
mov.l @er0+,er4
mov.l @er0,er2
mov.l er2,@sp
+#if (__INT_MAX__ <= 32767)
+ mov.w r1,r0
#else
-#ifdef __H8300S__
- mov.l @er0+,er7
- mov.l @er0+,er6
- mov.l @er0+,er5
- mov.l @er0+,er4
- mov.l @er0,er2
- mov.l er2,@sp
+ mov.l er1,er0
+#endif
+ bne .L1
+ sub er0,er0
+ adds #1,er0
#else
mov.w @r0+,r7
mov.w @r0+,r6
@@ -63,10 +55,9 @@ _longjmp:
mov.w @r0+,r4
mov.w @r0,r2
mov.w r2,@sp
-#endif
-#endif
mov.w r1,r0
bne .L1
mov.w #1,r0
+#endif
.L1:
rts