diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index 496342873..17fd262fd 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -95,7 +95,7 @@ struct ext_man_dbg_abi { struct ext_man_config_data { struct ext_man_elem_header hdr; - struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM]; + struct config_elem elems[]; } __packed; #endif /* __KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/init/ext_manifest.c b/src/init/ext_manifest.c index 2e9b5b557..6568ffebf 100644 --- a/src/init/ext_manifest.c +++ b/src/init/ext_manifest.c @@ -85,10 +85,14 @@ const struct ext_man_dbg_abi ext_man_dbg_info }, }; +/* increment this value after adding any element to ext_man_config dictionary */ +#define CONFIG_ELEM_CNT (EXT_MAN_CONFIG_LAST_ELEM - 1) + const struct ext_man_config_data ext_man_config __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") = { .hdr.type = EXT_MAN_ELEM_CONFIG_DATA, - .hdr.elem_size = ALIGN_UP(sizeof(struct ext_man_config_data), + .hdr.elem_size = ALIGN_UP(sizeof(struct ext_man_config_data) + + sizeof(struct config_elem) * CONFIG_ELEM_CNT, EXT_MAN_ALIGN), .elems = { {EXT_MAN_CONFIG_IPC_MSG_SIZE, SOF_IPC_MSG_MAX_SIZE},