[PATCH rtems-docs] cpu-supplement: Add note about device memory

Kinsey Moore kinsey.moore at oarcorp.com
Fri Mar 4 19:48:42 UTC 2022


Add information about restricted use of device memory for ARM and
AArch64.
---
 cpu-supplement/aarch64.rst | 5 +++++
 cpu-supplement/arm.rst     | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/cpu-supplement/aarch64.rst b/cpu-supplement/aarch64.rst
index 2b3d620..4576663 100644
--- a/cpu-supplement/aarch64.rst
+++ b/cpu-supplement/aarch64.rst
@@ -73,6 +73,11 @@ A flat 64-bit or 32-bit memory model is supported depending on the selected mult
 variant.  All AArch64 CPU variants support a built-in MMU for which basic initialization
 for a flat memory model is handled.
 
+Note that memcpy() and memset() must not be used on device memory as those
+functions are hand-optimized and will take advantage of unaligned accesses.
+"As per ARM"(https://developer.arm.com/documentation/ka004708/latest), unaligned
+accesses are not permitted for device memory.
+
 Interrupt Processing
 ====================
 
diff --git a/cpu-supplement/arm.rst b/cpu-supplement/arm.rst
index ac9e8c6..03a2cd2 100644
--- a/cpu-supplement/arm.rst
+++ b/cpu-supplement/arm.rst
@@ -132,6 +132,12 @@ Memory Model
 A flat 32-bit memory model is supported.  The board support package must take
 care of initializing the MMU if necessary.
 
+Note that architecture variants which support unaligned accesses must not use
+memcpy() or memset() on device memory as those functions are hand-optimized and
+will take advantage of unaligned accesses where available. "As per ARM"
+(https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Application-Level-Memory-Model/Alignment-support/Unaligned-data-access-restrictions-in-ARMv7-and-ARMv6),
+unaligned accesses are not permitted for device memory.
+
 Interrupt Processing
 ====================
 
-- 
2.30.2



More information about the devel mailing list