Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
[pandora-kernel.git] / arch / m68k / lib / memcpy.c
index 62182c8..10ca051 100644 (file)
@@ -22,6 +22,15 @@ void *memcpy(void *to, const void *from, size_t n)
                from = cfrom;
                n--;
        }
+#if defined(CONFIG_M68000)
+       if ((long)from & 1) {
+               char *cto = to;
+               const char *cfrom = from;
+               for (; n; n--)
+                       *cto++ = *cfrom++;
+               return xto;
+       }
+#endif
        if (n > 2 && (long)to & 2) {
                short *sto = to;
                const short *sfrom = from;
@@ -34,8 +43,10 @@ void *memcpy(void *to, const void *from, size_t n)
        if (temp) {
                long *lto = to;
                const long *lfrom = from;
-#if defined(__mc68020__) || defined(__mc68030__) || \
-    defined(__mc68040__) || defined(__mc68060__) || defined(__mcpu32__)
+#if defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE)
+               for (; temp; temp--)
+                       *lto++ = *lfrom++;
+#else
                asm volatile (
                        "       movel %2,%3\n"
                        "       andw  #7,%3\n"
@@ -56,9 +67,6 @@ void *memcpy(void *to, const void *from, size_t n)
                        "       jpl   4b"
                        : "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1)
                        : "0" (lfrom), "1" (lto), "2" (temp));
-#else
-               for (; temp; temp--)
-                       *lto++ = *lfrom++;
 #endif
                to = lto;
                from = lfrom;