[PATCH] SH: Add pad instructions after trapa instruction
kaz Kojima
kkojima@rr.iij4u.or.jp
Tue Oct 14 02:31:00 GMT 2003
Hi,
The attached patch adds pad instructions to avoid the SH-4
core bug for the trapa instruction in DO_CALL macro.
Regards,
kaz
--
2003-10-13 Kaz Kojima <kkojima@rr.iij4u.or.jp>
(DO_CALL): Add SYSCALL_INST_PAD after trapa instruction.
diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h
--- ORIG/libc/sysdeps/unix/sysv/linux/sh/sysdep.h Sun Sep 21 20:59:10 2003
+++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/sysdep.h Tue Oct 14 10:15:48 2003
@@ -183,6 +183,13 @@
# endif /* _LIBC_REENTRANT */
#endif /* PIC */
+# ifdef NEED_SYSCALL_INST_PAD
+# define SYSCALL_INST_PAD \
+ or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0
+# else
+# define SYSCALL_INST_PAD
+# endif
+
#define SYSCALL_INST0 trapa #0x10
#define SYSCALL_INST1 trapa #0x11
#define SYSCALL_INST2 trapa #0x12
@@ -195,18 +202,12 @@
#define DO_CALL(syscall_name, args) \
mov.l 1f,r3; \
SYSCALL_INST##args; \
+ SYSCALL_INST_PAD; \
bra 2f; \
nop; \
.align 2; \
1: .long SYS_ify (syscall_name); \
2:
-
-# ifdef NEED_SYSCALL_INST_PAD
-# define SYSCALL_INST_PAD \
- or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0
-# else
-# define SYSCALL_INST_PAD
-# endif
#else /* not __ASSEMBLER__ */
More information about the Libc-hacker
mailing list