git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://github.com/thepowersgang/acess2
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
arch
/
x86_64
/
lib.c
diff --git
a/KernelLand/Kernel/arch/x86_64/lib.c
b/KernelLand/Kernel/arch/x86_64/lib.c
index
977cffd
..
85dda82
100644
(file)
--- a/
KernelLand/Kernel/arch/x86_64/lib.c
+++ b/
KernelLand/Kernel/arch/x86_64/lib.c
@@
-370,11
+370,11
@@
void *memset(void *__dest, int __val, size_t __count)
__asm__ __volatile__ ("rep stosb" : : "D"(__dest),"a"(__val),"c"(__count));
else {
Uint8 *dst = __dest;
__asm__ __volatile__ ("rep stosb" : : "D"(__dest),"a"(__val),"c"(__count));
else {
Uint8 *dst = __dest;
+ size_t qwords = __count / 8;
+ size_t trail_bytes = __count % 8;
- __asm__ __volatile__ ("rep stosq" : : "D"(dst),"a"(0),"c"(__count/8));
- dst += __count & ~7;
- __count = __count & 7;
- while( __count-- )
+ __asm__ __volatile__ ("rep stosq" : "=D"(dst) : "D"(dst),"a"(0),"c"(qwords));
+ while( trail_bytes-- )
*dst++ = 0;
}
return __dest;
*dst++ = 0;
}
return __dest;
UCC
git Repository :: git.ucc.asn.au