This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] SH: Add pad instructions after trapa instruction


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__ */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]