From eef12e2655b973dccb2c4b04bc3bdb4c008ebb36 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Fri, 30 Dec 2022 19:13:15 -0500 Subject: [PATCH] refactor(el3-spmc): check emad_count offset Subsequent code will assume that it version-independent, so check it with a CASSERT. Change-Id: I233b51ef700103f1a0789d5608e3b02c96d0eeb7 Signed-off-by: Demi Marie Obenour --- include/services/el3_spmc_ffa_memory.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/services/el3_spmc_ffa_memory.h b/include/services/el3_spmc_ffa_memory.h index 2037ecadc..7bfd07568 100644 --- a/include/services/el3_spmc_ffa_memory.h +++ b/include/services/el3_spmc_ffa_memory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -254,5 +254,8 @@ struct ffa_mtd { uint64_t reserved_40_47; }; CASSERT(sizeof(struct ffa_mtd) == 48, assert_ffa_mtd_size_mismatch); +CASSERT(offsetof(struct ffa_mtd, emad_count) == + offsetof(struct ffa_mtd_v1_0, emad_count), + assert_ffa_mtd_emad_count_offset_mismatch); #endif /* EL3_SPMC_FFA_MEM_H */