summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/sh/trap.S
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/sh/trap.S')
-rw-r--r--newlib/libc/sys/sh/trap.S28
1 files changed, 28 insertions, 0 deletions
diff --git a/newlib/libc/sys/sh/trap.S b/newlib/libc/sys/sh/trap.S
index 4512293e3..0eb6e5dfe 100644
--- a/newlib/libc/sys/sh/trap.S
+++ b/newlib/libc/sys/sh/trap.S
@@ -1,3 +1,30 @@
+#if __SH5__
+ .mode SHmedia
+#if __SH5__ == 32 && __SHMEDIA__
+ .section .text..SHmedia32, "ax"
+#else
+ .text
+#endif
+ .global ___trap34
+___trap34:
+ movi 34, r0
+ trapa r0
+ pt/l ret, tr1
+ ptabs/l r18, tr0
+ beqi r1, 0, tr1
+#if __SH5__ == 64
+ movi ((_errno >> 48) & 65535), r0
+ shori ((_errno >> 32) & 65535), r0
+ shori ((_errno >> 16) & 65535), r0
+#else
+ movi ((_errno >> 16) & 65535), r0
+#endif
+ shori (_errno & 65535), r0
+ stx.l r0, r63, r1
+ret:
+ blink tr0, r63
+
+#else
.text
.global ___trap34
___trap34:
@@ -13,3 +40,4 @@ ret:
.align 2
perrno:
.long _errno
+#endif /* ! __SH5__ */