summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string.c8
-rw-r--r--ulib.c7
2 files changed, 4 insertions, 11 deletions
diff --git a/string.c b/string.c
index c6b6de6..cb890ee 100644
--- a/string.c
+++ b/string.c
@@ -1,14 +1,10 @@
#include "types.h"
+#include "x86.h"
void*
memset(void *dst, int c, uint n)
{
- char *d;
-
- d = (char*)dst;
- while(n-- > 0)
- *d++ = c;
-
+ stosb(dst, c, n);
return dst;
}
diff --git a/ulib.c b/ulib.c
index ed2542d..0268c26 100644
--- a/ulib.c
+++ b/ulib.c
@@ -2,6 +2,7 @@
#include "stat.h"
#include "fcntl.h"
#include "user.h"
+#include "x86.h"
char*
strcpy(char *s, char *t)
@@ -35,11 +36,7 @@ strlen(char *s)
void*
memset(void *dst, int c, uint n)
{
- char *d;
-
- d = dst;
- while(n-- > 0)
- *d++ = c;
+ stosb(dst, c, n);
return dst;
}