lkml.org 
[lkml]   [2010]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] x86, mem: Remove gcc < 4.1 support code for memcpy()
Date
We require gcc 4.1 or later, so remove support code for previous
versions of gcc.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/include/asm/string_32.h | 21 ---------------------
1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index 3d3e835..fde4eb2 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -177,16 +177,8 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
*/

#ifndef CONFIG_KMEMCHECK
-
-#if (__GNUC__ >= 4)
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
#else
-#define memcpy(t, f, n) \
- (__builtin_constant_p((n)) \
- ? __constant_memcpy((t), (f), (n)) \
- : __memcpy((t), (f), (n)))
-#endif
-#else
/*
* kmemcheck becomes very happy if we use the REP instructions unconditionally,
* because it means that we know both memory operands in advance.
@@ -284,12 +276,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,

{
int d0, d1;
-#if __GNUC__ == 4 && __GNUC_MINOR__ == 0
- /* Workaround for broken gcc 4.0 */
- register unsigned long eax asm("%eax") = pattern;
-#else
unsigned long eax = pattern;
-#endif

switch (count % 4) {
case 0:
@@ -321,15 +308,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
: __memset_generic((s), (c), (count)))

#define __HAVE_ARCH_MEMSET
-#if (__GNUC__ >= 4)
#define memset(s, c, count) __builtin_memset(s, c, count)
-#else
-#define memset(s, c, count) \
- (__builtin_constant_p(c) \
- ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \
- (count)) \
- : __memset((s), (c), (count)))
-#endif

/*
* find the first occurrence of byte 'c', or 1 past the area if none
--
1.7.2.1


\
 
 \ /
  Last update: 2010-09-13 22:19    [W:0.089 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site