From: Claudio Fontana <[email protected]>

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 <[email protected]>
Signed-off-by: Antonios Motakis <[email protected]>
[[email protected]: removed all signs of weakness!]
---
 hypervisor/arch/arm/lib.c | 12 ------------
 hypervisor/lib.c          | 10 ++++++++++
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/hypervisor/arch/arm/lib.c b/hypervisor/arch/arm/lib.c
index cf81117..038bf9a 100644
--- a/hypervisor/arch/arm/lib.c
+++ b/hypervisor/arch/arm/lib.c
@@ -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;
-}
diff --git a/hypervisor/lib.c b/hypervisor/lib.c
index f2a27eb..fc9af7a 100644
--- a/hypervisor/lib.c
+++ b/hypervisor/lib.c
@@ -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;
+}
-- 
2.8.0.rc3


-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to