patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Oct 23 21:12:29 2008 +0000 (2008-10-23)
changeset 966 b6eec1274efb
child 1016 a059741f7bd4
permissions -rw-r--r--
Fix memset on PowerPC 8xx, by Nye Liu:
http://sourceware.org/ml/crossgcc/2008-10/msg00067.html

/trunk/patches/glibc/2.7/290-powerpc-8xx-CPU15-errata.patch | 40 40 0 0 +++++++++++++++++++
1 file changed, 40 insertions(+)
     1 Fix memset on PowerPC 8xx, by Nye Liu:
     2 http://sourceware.org/ml/crossgcc/2008-10/msg00067.html
     3 
     4 Quote:
     5  I am working on a powerpc 860 toolchain, but I am having problems  
     6  convincing glibc to not emit code that uses the dcbz instruction (CPU15  
     7  dcbX bug). The source of the problem is sysdeps/powerpc/power3/memset.S
     8 
     9 --- glibc-2.7/sysdeps/powerpc/powerpc32/memset.S	2007-03-26 13:09:07.000000000 -0700
    10 +++ glibc-2.7/sysdeps/powerpc/powerpc32/memset.S.new	2008-10-23 12:20:04.000000000 -0700
    11 @@ -112,11 +112,13 @@
    12  	clrrwi.	rALIGN, rLEN, 5
    13  	mtcrf	0x01, rLEN	/* 40th instruction from .align */
    14  
    15 +#ifndef BROKEN_PPC_8xx_CPU15
    16  /* Check if we can use the special case for clearing memory using dcbz.
    17     This requires that we know the correct cache line size for this
    18     processor.  Getting the __cache_line_size may require establishing GOT
    19     addressability, so branch out of line to set this up.  */
    20  	beq	cr1, L(checklinesize)
    21 +#endif
    22  
    23  /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
    24     Can't assume that rCHR is zero or that the cache line size is either
    25 @@ -248,6 +250,7 @@
    26  	stw	rCHR, -8(rMEMP)
    27  	blr
    28  
    29 +#ifndef BROKEN_PPC_8xx_CPU15
    30  L(checklinesize):
    31  #ifdef SHARED
    32  	mflr	rTMP
    33 @@ -329,6 +332,7 @@
    34  L(handletail32):
    35  	clrrwi.	rALIGN, rLEN, 5
    36  	b	L(nondcbz)
    37 +#endif /* ! BROKEN_PPC_8xx_CPU15 */
    38  
    39  END (BP_SYM (memset))
    40  libc_hidden_builtin_def (memset)