diff options
author | Pierre-Clément Tosi <pierre-clement.tosi@arm.com> | 2019-03-28 19:59:12 +0000 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-05-13 12:48:44 +0100 |
commit | 5285b7816cb9bfee01dc21e9380c478c251bbe06 (patch) | |
tree | b2aabde3596197aa3d9aa97f85a8e62530281b67 /product/rddaniel | |
parent | 085421a47774642d256f890d1d04b17600d41ae0 (diff) |
sds: Detect region overflow at compile time
We can use sizes of all structures defined in config_sds.c
to detect if SDS region is sufficient.
Change-Id: Ia029c3a416226675cab75747dce1c0a4ab52c25b
Signed-off-by: Pierre-Clément Tosi <pierre-clement.tosi@arm.com>
Signed-off-by: Girish Pathak <girish.pathak@arm.com>
Diffstat (limited to 'product/rddaniel')
-rw-r--r-- | product/rddaniel/scp_ramfw/config_sds.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/product/rddaniel/scp_ramfw/config_sds.c b/product/rddaniel/scp_ramfw/config_sds.c index 95ff1ce7..7d7e81a7 100644 --- a/product/rddaniel/scp_ramfw/config_sds.c +++ b/product/rddaniel/scp_ramfw/config_sds.c @@ -106,6 +106,17 @@ static struct fwk_element sds_element_table[] = { { 0 }, /* Termination description. */ }; +static_assert(SCP_SDS_SECURE_SIZE > + RDDANIEL_SDS_CPU_INFO_SIZE + + RDDANIEL_SDS_FIRMWARE_VERSION_SIZE + + RDDANIEL_SDS_RESET_SYNDROME_SIZE + +#ifdef BUILD_MODE_DEBUG + RDDANIEL_SDS_CPU_BOOTCTR_SIZE + + RDDANIEL_SDS_CPU_FLAGS_SIZE + +#endif + RDDANIEL_SDS_FEATURE_AVAILABILITY_SIZE, + "SDS structures too large for SDS S-RAM.\n"); + static const struct fwk_element *sds_get_element_table(fwk_id_t module_id) { static_assert(BUILD_VERSION_MAJOR < UINT8_MAX, "Invalid version size"); |