Skip to contentSkip to conversation

arch/x86/lib/memmove_64.c: Convert it to assembly file and fix return value bug

PATCH New Fenghua Yu 1 participant 1 message Jan 18, 2011 x86

lore
Share & tools
lore

Fenghua Yu

author
#0 lore raw

PATCH 1/1 arch/x86/lib/memmove_64.c: Convert it to assembly file and fix return value bug

From: Fenghua Yu <[email protected]>

memmove_64.c only implements memmove() function which is mainly written in inline assembly code. Therefore it doesn't make sense to keep the assembly code in .c file. The converted code don't have push rbp, mov rsp, rbp, leaveq instructions generated by gcc at the beginning and end of memmove(). Thus the function is a bit shorter and faster.

Currently memmove() doesn't store return value to rax. This may cause issue if caller uses the return value. The patch fixes this issue.

---
 arch/x86/kernel/x8664_ksyms_64.c |    1 +
 arch/x86/lib/memmove_64.S        |  197 ++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/memmove_64.c        |  192 -------------------------------------
 3 files changed, 198 insertions(+), 192 deletions(-)
 create mode 100644 arch/x86/lib/memmove_64.S
 delete mode 100644 arch/x86/lib/memmove_64.c
arch/x86/kernel/x8664_ksyms_64.c +1 -0
index 1b950d1..9796c2f 100644
@@ -52,6 +52,7 @@ extern void *__memcpy(void *, const void *, __kernel_size_t);
 EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(__memcpy);
+EXPORT_SYMBOL(memmove);
 
 EXPORT_SYMBOL(empty_zero_page);
 #ifndef CONFIG_PARAVIRT
arch/x86/lib/memmove_64.S new file +197 -0

197 lines not on this page · raw message

arch/x86/lib/memmove_64.c deleted +0 -192

192 lines not on this page · raw message

Signature · 1 line
1.6.0.3