tiny68k: introduce memcpy32
authorAlan Cox <alan@linux.intel.com>
Tue, 22 Jan 2019 23:45:26 +0000 (23:45 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 22 Jan 2019 23:45:26 +0000 (23:45 +0000)
Kernel/cpu-68000/cpu.h
Kernel/platform-tiny68k/libc.c

index 9e4cbac..5069f11 100644 (file)
@@ -80,3 +80,9 @@ register struct u_data *udata_ptr asm ("a5");
 
 #define __packed               __attribute__((packed))
 #define barrier()              asm volatile("":::"memory")
+
+/* Memory helpers */
+/* This one doesn't yet work! */
+extern void copy_blocks(void *, void *, unsigned int);
+
+extern void *memcpy32(void *to, const void *from, size_t bytes);
index 6b8ef84..f172e3b 100644 (file)
@@ -11,6 +11,16 @@ void *memcpy(void *d, const void *s, size_t sz)
   return d;
 }
 
+void *memcpy32(void *d, const void *s, size_t sz)
+{
+  uint32_t *dp = d;
+  const uint32_t *sp = s;
+  sz >>= 2;
+  while(sz--)
+    *dp++ = *sp++;
+  return d;
+}
+
 void *memset(void *d, int c, size_t sz)
 {
   unsigned char *p = d;