patches/glibc/2.3.2/glibc-2.3.2-sh4-trapa.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 01 19:04:20 2007 +0000 (2007-07-01)
changeset 182 223c84ec2d90
permissions -rw-r--r--
Merge the build system to trunk: ct-ng is now installable:
- ./configure --prefix=/some/place
- make
- make install
- export PATH="${PATH}:/some/place/bin"
- ct-ng <action>
     1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/sh/sysdep.h.diff?r1=1.9&r2=1.10&cvsroot=glibc
     2 
     3 Ankur Sheth said:
     4 
     5 "This is actually a workaround for a bug in the sh4.  The actual bug is
     6 documented here :
     7 http://documentation.renesas.com/eng/products/mpumcu/tu/tnsh7456ae.pdf
     8 Basically the cache & TLB should not be accessed for 4 (or was it 5?) cycles
     9 after isssuing a TRAPA instruction.  I didn't run into any specific problem
    10 because of this bug, but it seems useful to have and the patch itself seems
    11 pretty harmless."
    12 
    13 
    14 ===================================================================
    15 RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sh/sysdep.h,v
    16 retrieving revision 1.9
    17 retrieving revision 1.10
    18 diff -u -r1.9 -r1.10
    19 --- libc/sysdeps/unix/sysv/linux/sh/sysdep.h	2003/09/01 04:05:21	1.9
    20 +++ libc/sysdeps/unix/sysv/linux/sh/sysdep.h	2003/10/15 04:36:32	1.10
    21 @@ -183,6 +183,13 @@
    22  # endif	/* _LIBC_REENTRANT */
    23  #endif	/* PIC */
    24  
    25 +# ifdef NEED_SYSCALL_INST_PAD
    26 +#  define SYSCALL_INST_PAD \
    27 +	or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0
    28 +# else
    29 +#  define SYSCALL_INST_PAD
    30 +# endif
    31 +
    32  #define SYSCALL_INST0	trapa #0x10
    33  #define SYSCALL_INST1	trapa #0x11
    34  #define SYSCALL_INST2	trapa #0x12
    35 @@ -195,19 +202,13 @@
    36  #define DO_CALL(syscall_name, args)	\
    37      mov.l 1f,r3;			\
    38      SYSCALL_INST##args;			\
    39 +    SYSCALL_INST_PAD;			\
    40      bra 2f;				\
    41       nop;				\
    42      .align 2;				\
    43   1: .long SYS_ify (syscall_name);	\
    44   2:
    45  
    46 -# ifdef NEED_SYSCALL_INST_PAD
    47 -#  define SYSCALL_INST_PAD \
    48 -	or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0
    49 -# else
    50 -#  define SYSCALL_INST_PAD
    51 -# endif
    52 -
    53  #else /* not __ASSEMBLER__ */
    54  
    55  #define SYSCALL_INST_STR0	"trapa #0x10\n\t"