xv6: use stosb for memset
This commit is contained in:
parent
c396d065d3
commit
8220135362
8
string.c
8
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue