about summary refs log tree commit diff
path: root/sysdeps/i386/bzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/bzero.c')
-rw-r--r--sysdeps/i386/bzero.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sysdeps/i386/bzero.c b/sysdeps/i386/bzero.c
index 99f2352dc6..80574cca6a 100644
--- a/sysdeps/i386/bzero.c
+++ b/sysdeps/i386/bzero.c
@@ -1,6 +1,6 @@
 /* bzero -- set a block of memory to zero.  For Intel 80x86, x>=3.
    This file is part of the GNU C Library.
-   Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1993, 1997, 1998 Free Software Foundation, Inc.
    Contributed by Torbjorn Granlund (tege@sics.se).
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ __bzero (dstpp, len)
      size_t len;
 {
   /* N.B.: This code is almost verbatim from memset.c.  */
-
+  int d0;
   unsigned long int dstp = (unsigned long int) dstpp;
 
   /* This explicit register allocation
@@ -55,25 +55,25 @@ __bzero (dstpp, len)
       /* Fill bytes until DSTP is aligned on a longword boundary.  */
       asm volatile ("rep\n"
 		    "stosb" /* %0, %2, %3 */ :
-		    "=D" (dstp) :
-		    "0" (dstp), "c" ((-dstp) % OPSIZ), "a" (x) :
-		    "cx");
+		    "=D" (dstp), "=c" (d0) :
+		    "0" (dstp), "1" ((-dstp) % OPSIZ), "a" (x) :
+		    "memory");
 
       /* Fill longwords.  */
       asm volatile ("rep\n"
 		    "stosl" /* %0, %2, %3 */ :
-		    "=D" (dstp) :
-		    "0" (dstp), "c" (len / OPSIZ), "a" (x) :
-		    "cx");
+		    "=D" (dstp), "=c" (d0) :
+		    "0" (dstp), "1" (len / OPSIZ), "a" (x) :
+		    "memory");
       len %= OPSIZ;
     }
 
   /* Write the last few bytes.  */
   asm volatile ("rep\n"
 		"stosb" /* %0, %2, %3 */ :
-		"=D" (dstp) :
+		"=D" (dstp), "=c" (d0) :
 		"0" (dstp), "c" (len), "a" (x) :
-		"cx");
+		"memory");
 }
 weak_alias (__bzero, bzero)