[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/string: Clean up x86/string.h



commit 78825e1c60faadf99d9ed6c1a01a617b7543f506
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri May 12 15:07:16 2017 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed May 31 14:05:25 2017 +0100

    x86/string: Clean up x86/string.h
    
     * None of the GCC docs mention memmove() in its list of builtins even 
today,
       but 4.1 does have the builtin, meaning that all currently supported
       compilers have it.
     * Consistently use Xen style, matching the common code, and introduce 
symbol
       definitions for function pointer use.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <JBeulich@xxxxxxxx>
---
 xen/arch/x86/string.c        | 11 ++++-------
 xen/include/asm-x86/string.h | 18 ++++++++++++++----
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/string.c b/xen/arch/x86/string.c
index 1387dfb..cd85a38 100644
--- a/xen/arch/x86/string.c
+++ b/xen/arch/x86/string.c
@@ -1,14 +1,13 @@
 /******************************************************************************
  * string.c
- * 
+ *
  * These provide something for compiler-emitted string operations to link
  * against.
  */
 
 #include <xen/lib.h>
 
-#undef memcpy
-void *memcpy(void *dest, const void *src, size_t n)
+void *(memcpy)(void *dest, const void *src, size_t n)
 {
     long d0, d1, d2;
 
@@ -23,8 +22,7 @@ void *memcpy(void *dest, const void *src, size_t n)
     return dest;
 }
 
-#undef memset
-void *memset(void *s, int c, size_t n)
+void *(memset)(void *s, int c, size_t n)
 {
     long d0, d1;
 
@@ -37,8 +35,7 @@ void *memset(void *s, int c, size_t n)
     return s;
 }
 
-#undef memmove
-void *memmove(void *dest, const void *src, size_t n)
+void *(memmove)(void *dest, const void *src, size_t n)
 {
     long d0, d1, d2;
 
diff --git a/xen/include/asm-x86/string.h b/xen/include/asm-x86/string.h
index c48d9c3..6f3c960 100644
--- a/xen/include/asm-x86/string.h
+++ b/xen/include/asm-x86/string.h
@@ -2,13 +2,23 @@
 #define __X86_STRING_H__
 
 #define __HAVE_ARCH_MEMCPY
-#define memcpy(t,f,n) (__builtin_memcpy((t),(f),(n)))
+void *memcpy(void *dest, const void *src, size_t n);
+#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
 
-/* Some versions of gcc don't have this builtin. It's non-critical anyway. */
 #define __HAVE_ARCH_MEMMOVE
-extern void *memmove(void *dest, const void *src, size_t n);
+void *memmove(void *dest, const void *src, size_t n);
+#define memmove(d, s, n) __builtin_memmove(d, s, n)
 
 #define __HAVE_ARCH_MEMSET
-#define memset(s,c,n) (__builtin_memset((s),(c),(n)))
+void *memset(void *dest, int c, size_t n);
+#define memset(s, c, n) __builtin_memset(s, c, n)
 
 #endif /* __X86_STRING_H__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.