diff options
| author | Austin Clements <amdragon@mit.edu> | 2011-09-01 10:41:21 -0400 |
|---|---|---|
| committer | Austin Clements <amdragon@mit.edu> | 2011-09-01 10:41:27 -0400 |
| commit | d0f3efca650eccd5179e045cd07f7d723037defc (patch) | |
| tree | f28734b5ac99749ebb0927e079a4c656f6e0d847 /string.c | |
| parent | e25b74ca8069e340c3f2c267d09beed6d9328250 (diff) | |
| download | xv6-labs-2022-d0f3efca650eccd5179e045cd07f7d723037defc.tar.xz xv6-labs-2022-d0f3efca650eccd5179e045cd07f7d723037defc.zip | |
Use stosl in memset; makes boot time bearable
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4,7 +4,11 @@ void* memset(void *dst, int c, uint n) { - stosb(dst, c, n); + if ((int)dst%4 == 0 && n%4 == 0){ + c &= 0xFF; + stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); + } else + stosb(dst, c, n); return dst; } |
