From: John Hodge Date: Fri, 11 Nov 2011 04:59:49 +0000 (+0800) Subject: Kernel/x86 - Distinguished tracing of unaligned memcpys from aligned X-Git-Tag: rel0.14~124 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=51d1da69cd1c30ff20a2ff1d958fe0cd149c9cbf;p=tpg%2Facess2.git Kernel/x86 - Distinguished tracing of unaligned memcpys from aligned --- diff --git a/Kernel/arch/x86/lib.c b/Kernel/arch/x86/lib.c index 9dc631d0..0b802d1e 100644 --- a/Kernel/arch/x86/lib.c +++ b/Kernel/arch/x86/lib.c @@ -324,10 +324,12 @@ int memcmp(const void *m1, const void *m2, size_t Num) */ void *memcpy(void *Dest, const void *Src, size_t Num) { -// Debug("\nmemcpy:Num=0x%x by %p", Num, __builtin_return_address(0)); - if( ((Uint)Dest & 3) || ((Uint)Src & 3) ) + if( ((Uint)Dest & 3) || ((Uint)Src & 3) ) { __asm__ __volatile__ ("rep movsb" :: "D" (Dest), "S" (Src), "c" (Num)); +// Debug("\nmemcpy:Num=0x%x by %p (UA)", Num, __builtin_return_address(0)); + } else { +// Debug("\nmemcpy:Num=0x%x by %p", Num, __builtin_return_address(0)); __asm__ __volatile__ ( "rep movsl;\n\t" "mov %3, %%ecx;\n\t"