aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@gmail.com>2024-08-20 15:10:39 +0300
committerJeff Johnston <jjohnstn@redhat.com>2024-08-20 18:23:06 -0400
commit3e9f6a005c8df720dbdd42bba92df8081ee722c2 (patch)
treecbaa2bbd080b77c446fc0501183313a6c2084a87
parent2c46bffba0d2ed0b94af3b82a93a5a853b4725d2 (diff)
downloadnewlib-3e9f6a005c8df720dbdd42bba92df8081ee722c2.zip
newlib-3e9f6a005c8df720dbdd42bba92df8081ee722c2.tar.gz
newlib-3e9f6a005c8df720dbdd42bba92df8081ee722c2.tar.bz2
arc: Use __ARC_UNALIGNED__ compiler macro
Replace __ARC_ALIGNED_ACCESS__ macro with the compiler defined macro __ARC_UNALIGNED__ and improve file comments. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
-rw-r--r--newlib/libc/machine/arc/memcpy-archs.S18
1 files changed, 17 insertions, 1 deletions
diff --git a/newlib/libc/machine/arc/memcpy-archs.S b/newlib/libc/machine/arc/memcpy-archs.S
index f30dafd..3c477a7 100644
--- a/newlib/libc/machine/arc/memcpy-archs.S
+++ b/newlib/libc/machine/arc/memcpy-archs.S
@@ -70,7 +70,21 @@
# define ZOLAND 0xF
#endif
-#ifdef __ARC_ALIGNED_ACCESS__
+
+;;; MEMCPY copy memory regions
+;;; Input arguments:
+;;; r0 - output memory region
+;;; r1 - input memory region
+;;; r2 - size in bytes
+;;; Returns:
+;;; r0 - pointer to the first byte of the output region
+;;; Clobber:
+;;; r1, r2, r3, r4, r5, r6, r8r9, r10r11, lp_count
+
+#if !defined (__ARC_UNALIGNED__)
+
+;;; MEMCPY routine for the case when the CPU only accepts ALIGNED
+;;; accesses to memory.
ENTRY (memcpy)
prefetch [r1] ; Prefetch the read location
prefetchw [r0] ; Prefetch the write location
@@ -268,6 +282,8 @@ ENDFUNC (memcpy)
#else
+;;; MEMCPY routine which is used by systems with unaligned memory
+;;; accesses. This is the case for most of ARCHS CPU family.
ENTRY(memcpy)
prefetch [r1] ; Prefetch the read location
prefetchw [r0] ; Prefetch the write location