From b8c156a9c3ad49850e04af4b455b22b767c4c2bb Mon Sep 17 00:00:00 2001 From: Miguel Silva Date: Fri, 5 Apr 2024 13:34:15 +0100 Subject: [PATCH] fix: Align an element inside a packed struct The compiler issues errors when trying to get the reference of elements of packed structs since it might result in unaligned pointer values. As such we forced the elements in question to be aligned inside the struct. Signed-off-by: Miguel Silva --- src/arch/armv8/inc/arch/psci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/armv8/inc/arch/psci.h b/src/arch/armv8/inc/arch/psci.h index ad0fb8310..29e5ad1d6 100644 --- a/src/arch/armv8/inc/arch/psci.h +++ b/src/arch/armv8/inc/arch/psci.h @@ -87,7 +87,7 @@ struct psci_off_state { uint64_t vttbr_el2; uint64_t wakeup_reason; paddr_t flat_map; - struct gicc_state gicc_state; + struct gicc_state gicc_state __attribute__((aligned(8))); } __attribute__((packed, aligned(8))); enum wakeup_reason {