From: John Hodge Date: Fri, 21 Oct 2011 01:27:45 +0000 (+0800) Subject: Kernel - memmove improved (but with an assumption) X-Git-Tag: rel0.13~14 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1aa76857dd6dccd56d9313552ebf63a9897866b0;p=tpg%2Facess2.git Kernel - memmove improved (but with an assumption) --- diff --git a/Kernel/lib.c b/Kernel/lib.c index 4d65108a..6263dc8a 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -966,6 +966,10 @@ void *memmove(void *__dest, const void *__src, size_t len) if( (tVAddr)dest + len < (tVAddr)src ) return memcpy(dest, src, len); + // NOTE: Assumes memcpy works forward + if( (tVAddr)dest < (tVAddr)src ) + return memcpy(dest, src, len); + if( (tVAddr)dest < (tVAddr)src ) block_size = (tVAddr)src - (tVAddr)dest; else