Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/common/lib/libc/arch/i386/string/small Pull up following ...



details:   https://anonhg.NetBSD.org/src/rev/1e2be84a05fe
branches:  netbsd-7
changeset: 798379:1e2be84a05fe
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Sep 29 15:31:01 2014 +0000

description:
Pull up following revision(s) (requested by khorben in ticket #118):
        common/lib/libc/arch/i386/string/small/strchr.S: revision 1.3
Look for the character to locate before checking for the NUL character
As documented in PR port-i386/49208, this fixes strchr(s, '\0'), as used by
the FAT first-stage bootloader on x86 (bootxx_msdos).
strchr(s, '\0') is otherwise equivalent to strlen(string), which would
probably look nicer in the original file, dosfs.c from libsa.
Confirmed working in qemu and on real hardware.
ok joerg@
XXX pull-up to netbsd-6 and netbsd-7

diffstat:

 common/lib/libc/arch/i386/string/small/strchr.S |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 3ec65366a6e8 -r 1e2be84a05fe common/lib/libc/arch/i386/string/small/strchr.S
--- a/common/lib/libc/arch/i386/string/small/strchr.S   Mon Sep 22 11:20:39 2014 +0000
+++ b/common/lib/libc/arch/i386/string/small/strchr.S   Mon Sep 29 15:31:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $      */
+/*     $NetBSD: strchr.S,v 1.2.4.1 2014/09/29 15:31:01 msaitoh Exp $   */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <machine/asm.h>
-       RCSID("$NetBSD: strchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
+       RCSID("$NetBSD: strchr.S,v 1.2.4.1 2014/09/29 15:31:01 msaitoh Exp $")
 
 ENTRY(strchr)
        popl    %edx            /* Return address */
@@ -39,10 +39,10 @@
        pushl   %eax
        pushl   %edx
 1:
+       cmpb    %cl, 0(%eax)
+       je 3f
        cmpb    $0, 0(%eax)
        je 2f
-       cmpb    %cl, 0(%eax)
-       je 3f
        incl    %eax
        jmp 1b
 2:



Home | Main Index | Thread Index | Old Index