]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: lib: replace ARM memcpy implementation with generic version
authorClaudio Fontana <claudio.fontana@huawei.com>
Thu, 12 May 2016 13:00:59 +0000 (15:00 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 07:16:28 +0000 (09:16 +0200)
Remove the memcpy implementation from the ARM port, and add a
generic version to the core library for all architectures.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Antonios Motakis <antonios.motakis@huawei.com>
[antonios.motakis@huawei.com: removed all signs of weakness!]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/lib.c
hypervisor/lib.c

index cf81117b3aabb7d0fd49da7716daef3cece43850..038bf9af5c10fb3b63804260f1235be14e0bffcc 100644 (file)
@@ -22,15 +22,3 @@ unsigned long phys_processor_id(void)
        arm_read_sysreg(MPIDR_EL1, mpidr);
        return mpidr & MPIDR_CPUID_MASK;
 }
-
-void *memcpy(void *dest, const void *src, unsigned long n)
-{
-       unsigned long i;
-       const char *csrc = src;
-       char *cdest = dest;
-
-       for (i = 0; i < n; i++)
-               cdest[i] = csrc[i];
-
-       return dest;
-}
index f2a27eb6cdfcc34c56ebba0a2dbe0638f5e96650..fc9af7aa6214edf9691c7cd606d042f9ac970ed3 100644 (file)
@@ -32,3 +32,13 @@ int strcmp(const char *s1, const char *s2)
        }
        return *(unsigned char *)s1 - *(unsigned char *)s2;
 }
+
+void *memcpy(void *dest, const void *src, unsigned long n)
+{
+       const u8 *s = src;
+       u8 *d = dest;
+
+       while (n-- > 0)
+               *d++ = *s++;
+       return dest;
+}