From 064a1d76a4f87d8c667488009fa9e9d5f5f0be2a Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 4 Nov 2020 08:06:05 -0500 Subject: libfdt: Check for 8-byte address alignment in fdt_ro_probe_() The device tree must be loaded in to memory at an 8-byte aligned address. Add a check for this condition in fdt_ro_probe_() and a new error code to return if we are not. Signed-off-by: Tom Rini Message-Id: <20201104130605.28874-1-trini@konsulko.com> Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpukit/include/libfdt.h') diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h index 5979832305..89adee3cd7 100644 --- a/cpukit/include/libfdt.h +++ b/cpukit/include/libfdt.h @@ -101,7 +101,11 @@ extern "C" { /* FDT_ERR_BADFLAGS: The function was passed a flags field that * contains invalid flags or an invalid combination of flags. */ -#define FDT_ERR_MAX 18 +#define FDT_ERR_ALIGNMENT 19 + /* FDT_ERR_ALIGNMENT: The device tree base address is not 8-byte + * aligned. */ + +#define FDT_ERR_MAX 19 /* constants */ #define FDT_MAX_PHANDLE 0xfffffffe -- cgit v1.2.3