From: Roland McGrath Date: Fri, 11 Jun 2004 10:15:39 +0000 (+0000) Subject: * sysdeps/arm/strlen.S [__ARMEB__]: Compute correctly for big-endian. X-Git-Tag: cvs/fedora-base~405 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1847a84656ed3f8432d1c6d7c804e07b7caa84b;p=thirdparty%2Fglibc.git * sysdeps/arm/strlen.S [__ARMEB__]: Compute correctly for big-endian. From Krzysztof Halasa . --- diff --git a/ChangeLog b/ChangeLog index c8b8c929697..674a172a614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-11 Roland McGrath + + * sysdeps/arm/strlen.S [__ARMEB__]: Compute correctly for big-endian. + From Krzysztof Halasa . + 2004-06-10 Jakub Jelinek * elf/tls-macros.h [__s390x__] (TLS_LD, TLS_GD): Clobber also r14. diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 1f5c3f6f435..01de11fa826 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2004-06-11 Martin Schwidefsky + + * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap): + Add memory clobber to inline assembly. + (__lll_mutex_trylock): Likewise. + (__lll_mutex_cond_trylock): Likewise. + 2004-06-07 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue): diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 9549cff64ef..34f8b09f619 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -112,7 +112,7 @@ " jl 0b\n" \ "1:" \ : "=Q" (*__futex), "=&d" (oldval), "=&d" (newval) \ - : "m" (*__futex) : "cc" ); \ + : "m" (*__futex) : "cc", "memory" ); \ } while (0) @@ -124,7 +124,7 @@ __lll_mutex_trylock (int *futex) __asm __volatile ("cs %0,%3,%1" : "=d" (old), "=Q" (*futex) - : "0" (0), "d" (1), "m" (*futex) : "cc" ); + : "0" (0), "d" (1), "m" (*futex) : "cc", "memory" ); return old != 0; } #define lll_mutex_trylock(futex) __lll_mutex_trylock (&(futex)) @@ -138,7 +138,7 @@ __lll_mutex_cond_trylock (int *futex) __asm __volatile ("cs %0,%3,%1" : "=d" (old), "=Q" (*futex) - : "0" (0), "d" (2), "m" (*futex) : "cc" ); + : "0" (0), "d" (2), "m" (*futex) : "cc", "memory" ); return old != 0; } #define lll_mutex_cond_trylock(futex) __lll_mutex_cond_trylock (&(futex)) diff --git a/sysdeps/arm/strlen.S b/sysdeps/arm/strlen.S index f29528ada2e..a83c41d26af 100644 --- a/sysdeps/arm/strlen.S +++ b/sysdeps/arm/strlen.S @@ -53,12 +53,21 @@ Laligned: @ here, we have a word in r2. Does it ldrne r2, [r1], $4 @ and we continue to the next word bne Laligned @ Llastword: @ drop through to here once we find a +#ifdef __ARMEB__ + tst r2, $0xff000000 @ word that has a zero byte in it + addne r0, r0, $1 @ + tstne r2, $0x00ff0000 @ and add up to 3 bytes on to it + addne r0, r0, $1 @ + tstne r2, $0x0000ff00 @ (if first three all non-zero, 4th + addne r0, r0, $1 @ must be zero) +#else tst r2, $0x000000ff @ word that has a zero byte in it addne r0, r0, $1 @ tstne r2, $0x0000ff00 @ and add up to 3 bytes on to it addne r0, r0, $1 @ tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th addne r0, r0, $1 @ must be zero) +#endif RETINSTR(mov,pc,lr) END(strlen) libc_hidden_builtin_def (strlen)