diff options
author | Greg Ungerer <gerg@uclinux.org> | 2011-06-02 06:07:33 (GMT) |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2011-06-14 01:42:29 (GMT) |
commit | 734c3ce3bd4d51c932893b9f6d32b9ded31acdff (patch) | |
tree | 05e4d44e3828c8620595674341236e71c4f86e7e /arch/m68k/lib/memset.c | |
parent | 62356725987fa44bbebeb656b2a0d8c803e32ef2 (diff) | |
download | linux-fsl-qoriq-734c3ce3bd4d51c932893b9f6d32b9ded31acdff.tar.xz |
m68k: use kernel processor defines for conditional optimizations
Older m68k-linux compilers will include pre-defined symbols that
confuse what processor it is being targeted for. For example gcc-4.1.2
will pre-define __mc68020__ even if you specify the target processor
as -m68000 on the gcc command line. Newer versions of gcc have this
corrected.
In a few places the m68k code uses defined(__mc68020__) for optimizations
that include instructions that are specific to the CPU 68020 and above.
When compiling with older compilers this will be true even when we have
selected to compile for the older 68000 processors.
Switch to using the kernel processor defines, CONFIG_M68020 and friends.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/lib/memset.c')
-rw-r--r-- | arch/m68k/lib/memset.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/m68k/lib/memset.c b/arch/m68k/lib/memset.c index f649e6a..8a7639f 100644 --- a/arch/m68k/lib/memset.c +++ b/arch/m68k/lib/memset.c @@ -32,8 +32,10 @@ void *memset(void *s, int c, size_t count) temp = count >> 2; if (temp) { long *ls = s; -#if defined(__mc68020__) || defined(__mc68030__) || \ - defined(__mc68040__) || defined(__mc68060__) || defined(__mcpu32__) +#if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE) + for (; temp; temp--) + *ls++ = c; +#else size_t temp1; asm volatile ( " movel %1,%2\n" @@ -55,9 +57,6 @@ void *memset(void *s, int c, size_t count) " jpl 1b" : "=a" (ls), "=d" (temp), "=&d" (temp1) : "d" (c), "0" (ls), "1" (temp)); -#else - for (; temp; temp--) - *ls++ = c; #endif s = ls; } |