lkml.org 
[lkml]   [2010]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 09/20] x86 inline memcpy
Export an inline_memcpy() API. Useful when the memcpy size is unknown but the
caller cannot afford the cost of a function call. Useful for very frequent
memcpy callers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
arch/x86/include/asm/string_32.h | 7 +++++++
arch/x86/include/asm/string_64.h | 7 +++++++
2 files changed, 14 insertions(+)

Index: linux.trees.git/arch/x86/include/asm/string_32.h
===================================================================
--- linux.trees.git.orig/arch/x86/include/asm/string_32.h 2010-06-21 17:50:21.000000000 -0400
+++ linux.trees.git/arch/x86/include/asm/string_32.h 2010-06-21 17:56:49.000000000 -0400
@@ -44,6 +44,13 @@ static __always_inline void *__memcpy(vo
return to;
}

+#define __HAVE_ARCH_INLINE_MEMCPY
+static __always_inline void *inline_memcpy(void *to, const void *from,
+ size_t n)
+{
+ return __memcpy(to, from, n);
+}
+
/*
* This looks ugly, but the compiler can optimize it totally,
* as the count is constant.
Index: linux.trees.git/arch/x86/include/asm/string_64.h
===================================================================
--- linux.trees.git.orig/arch/x86/include/asm/string_64.h 2010-06-21 17:50:21.000000000 -0400
+++ linux.trees.git/arch/x86/include/asm/string_64.h 2010-06-21 17:57:13.000000000 -0400
@@ -23,6 +23,13 @@ static __always_inline void *__inline_me
return to;
}

+#define __HAVE_ARCH_INLINE_MEMCPY
+static __always_inline void *inline_memcpy(void *to, const void *from,
+ size_t n)
+{
+ return __inline_memcpy(to, from, n);
+}
+
/* Even with __builtin_ the compiler may decide to use the out of line
function. */



\
 
 \ /
  Last update: 2010-07-10 01:43    [W:0.097 / U:1.184 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site