summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-05-31 09:45:59 -0400
committerRobert Morris <[email protected]>2019-05-31 09:45:59 -0400
commit2ec1959fd1016a18ef3b2d154ce7076be8f237e4 (patch)
tree1aa75252085964283b3a2c735771f4da02346517 /string.c
parent0f90388c893d1924e89e2e4d2187eda0004e9d73 (diff)
downloadxv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.gz
xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.bz2
xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.zip
fork/wait/exit work
Diffstat (limited to 'string.c')
-rw-r--r--string.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/string.c b/string.c
index 861ea25..d99e612 100644
--- a/string.c
+++ b/string.c
@@ -1,14 +1,13 @@
#include "types.h"
-#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
- if ((uint64)dst%4 == 0 && n%4 == 0){
- c &= 0xFF;
- stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
- } else
- stosb(dst, c, n);
+ char *cdst = (char *) dst;
+ int i;
+ for(i = 0; i < n; i++){
+ cdst[i] = c;
+ }
return dst;
}