[rtems commit] Fix device tree blob alignment
Sebastian Huber
sebh at rtems.org
Tue Jan 11 16:54:16 UTC 2022
Module: rtems
Branch: master
Commit: 00081b30a8b879d5e0a91d1ce369ec6c9eb9b839
Changeset: http://git.rtems.org/rtems/commit/?id=00081b30a8b879d5e0a91d1ce369ec6c9eb9b839
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jan 11 17:59:34 2022 +0100
Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
---
bsps/shared/start/bsp-fdt.c | 8 ++++----
testsuites/libtests/libfdt01/some.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bsps/shared/start/bsp-fdt.c b/bsps/shared/start/bsp-fdt.c
index 50a485e..f0a7e54 100644
--- a/bsps/shared/start/bsp-fdt.c
+++ b/bsps/shared/start/bsp-fdt.c
@@ -28,12 +28,12 @@
#endif
#ifdef BSP_FDT_BLOB_READ_ONLY
-static const uint32_t
-bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT =
+static RTEMS_ALIGNED(8) const uint32_t
+bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] =
{ 0xdeadbeef };
#else
-static uint32_t
-bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT;
+static RTEMS_ALIGNED(8) uint32_t
+bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)];
#endif
void bsp_fdt_copy(const void *src)
diff --git a/testsuites/libtests/libfdt01/some.c b/testsuites/libtests/libfdt01/some.c
index 5eed911..d5d8b7a 100644
--- a/testsuites/libtests/libfdt01/some.c
+++ b/testsuites/libtests/libfdt01/some.c
@@ -4,9 +4,9 @@
* WARNING: Automatically generated -- do not edit!
*/
-#include <sys/types.h>
+#include <rtems.h>
-const unsigned char some_bin[] = {
+RTEMS_ALIGNED(8) const unsigned char some_bin[] = {
0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x38,
0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48,
More information about the vc
mailing list