Workaround for "PowerPC-8xx CPU15 errata" (whatever that might be).
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu May 07 19:30:32 2009 +0000 (2009-05-07)
changeset 1328f9e0931908f4
parent 1327 5fd1f22a6062
child 1329 e653b8e4f87c
Workaround for "PowerPC-8xx CPU15 errata" (whatever that might be).
Patch by Nye LIU: http://sourceware.org/ml/crossgcc/2009-05/msg00014.html

-------- diffstat follows --------
/trunk/patches/eglibc/2_9/100-powerpc-8xx-CPU15-errata.patch | 49 49 0 0 ++++++++++++++++++
/trunk/scripts/build/libc/eglibc.sh | 10 9 1 0 +++-
2 files changed, 58 insertions(+), 1 deletion(-)
patches/eglibc/2_9/100-powerpc-8xx-CPU15-errata.patch
scripts/build/libc/eglibc.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/eglibc/2_9/100-powerpc-8xx-CPU15-errata.patch	Thu May 07 19:30:32 2009 +0000
     1.3 @@ -0,0 +1,49 @@
     1.4 +diff -ru eglibc-2_9_orig/sysdeps/powerpc/powerpc32/memset.S eglibc-2_9/sysdeps/powerpc/powerpc32/memset.S
     1.5 +--- eglibc-2_9_orig/sysdeps/powerpc/powerpc32/memset.S	2007-04-13 08:35:45.000000000 -0700
     1.6 ++++ eglibc-2_9/sysdeps/powerpc/powerpc32/memset.S	2009-05-06 16:52:04.000000000 -0700
     1.7 +@@ -112,11 +112,13 @@
     1.8 + 	clrrwi.	rALIGN, rLEN, 5
     1.9 + 	mtcrf	0x01, rLEN	/* 40th instruction from .align */
    1.10 + 
    1.11 ++#ifndef BROKEN_PPC_8xx_CPU15
    1.12 + /* Check if we can use the special case for clearing memory using dcbz.
    1.13 +    This requires that we know the correct cache line size for this
    1.14 +    processor.  Getting the __cache_line_size may require establishing GOT
    1.15 +    addressability, so branch out of line to set this up.  */
    1.16 + 	beq	cr1, L(checklinesize)
    1.17 ++#endif
    1.18 + 
    1.19 + /* Store blocks of 32-bytes (256-bits) starting on a 32-byte boundary.
    1.20 +    Can't assume that rCHR is zero or that the cache line size is either
    1.21 +@@ -158,6 +160,7 @@
    1.22 + 	add	rMEMP, rMEMP, rALIGN
    1.23 + 	b	L(medium_tail2)	/* 72nd instruction from .align */
    1.24 + 
    1.25 ++#ifndef BROKEN_PPC_8xx_CPU15
    1.26 + 	.align	5
    1.27 + 	nop
    1.28 + /* Clear cache lines of memory in 128-byte chunks.
    1.29 +@@ -191,6 +194,7 @@
    1.30 + 	bdnz	L(zloop)
    1.31 + 	beqlr	cr5
    1.32 + 	b	L(medium_tail2)
    1.33 ++#endif /* ! BROKEN_PPC_8xx_CPU15 */
    1.34 + 
    1.35 + 	.align	5
    1.36 + L(small):
    1.37 +@@ -248,6 +252,7 @@
    1.38 + 	stw	rCHR, -8(rMEMP)
    1.39 + 	blr
    1.40 + 
    1.41 ++#ifndef BROKEN_PPC_8xx_CPU15
    1.42 + L(checklinesize):
    1.43 + #ifdef SHARED
    1.44 + 	mflr	rTMP
    1.45 +@@ -329,6 +334,7 @@
    1.46 + L(handletail32):
    1.47 + 	clrrwi.	rALIGN, rLEN, 5
    1.48 + 	b	L(nondcbz)
    1.49 ++#endif /* ! BROKEN_PPC_8xx_CPU15 */
    1.50 + 
    1.51 + END (BP_SYM (memset))
    1.52 + libc_hidden_builtin_def (memset)
     2.1 --- a/scripts/build/libc/eglibc.sh	Thu May 07 19:24:23 2009 +0000
     2.2 +++ b/scripts/build/libc/eglibc.sh	Thu May 07 19:30:32 2009 +0000
     2.3 @@ -266,7 +266,15 @@
     2.4      
     2.5      CT_DoLog EXTRA "Building C library"
     2.6  
     2.7 -    CT_DoExecLog ALL make
     2.8 +    # eglibc build hacks
     2.9 +    # http://sourceware.org/ml/crossgcc/2008-10/msg00068.html
    2.10 +    case "${CT_ARCH},${CT_ARCH_CPU}" in
    2.11 +        powerpc,8??)
    2.12 +            CT_DoLog DEBUG "Activating support for memset on broken ppc-8xx (CPU15 erratum)"
    2.13 +            EGLIBC_BUILD_ASFLAGS="-DBROKEN_PPC_8xx_CPU15";;
    2.14 +    esac
    2.15 +
    2.16 +    CT_DoExecLog ALL make ASFLAGS="${EGLIBC_BUILD_ASFLAGS}"
    2.17  
    2.18      CT_DoLog EXTRA "Installing C library"
    2.19