Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86080?usp=email )
Change subject: CFR: Add version field to root struct ......................................................................
CFR: Add version field to root struct
Add a version field to the CFR root struct so parsers can check compatibility when parsing structs.
Change-Id: Ifcb950f1bdedc0ab925f3841befb7e7001c0f7f4 Signed-off-by: Filip Brozovic fbrozovic@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/86080 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Matt DeVillier matt.devillier@gmail.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/commonlib/include/commonlib/cfr.h M src/commonlib/include/commonlib/coreboot_tables.h M src/drivers/option/cfr.c 3 files changed, 4 insertions(+), 0 deletions(-)
Approvals: Angel Pons: Looks good to me, approved Matt DeVillier: Looks good to me, but someone else must approve build bot (Jenkins): Verified
diff --git a/src/commonlib/include/commonlib/cfr.h b/src/commonlib/include/commonlib/cfr.h index cc8431a..5d8b37b 100644 --- a/src/commonlib/include/commonlib/cfr.h +++ b/src/commonlib/include/commonlib/cfr.h @@ -49,6 +49,8 @@ * */
+#define CFR_VERSION 0x00000000 + enum cfr_tags { CFR_TAG_OPTION_FORM = 1, CFR_TAG_ENUM_VALUE = 2, diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index def48b7..78dbe8e 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -602,6 +602,7 @@ struct lb_cfr { uint32_t tag; uint32_t size; + uint32_t version; uint32_t checksum; /* Checksum of the variable payload. */ /* struct lb_cfr_option_form forms[] */ }; diff --git a/src/drivers/option/cfr.c b/src/drivers/option/cfr.c index e833d7b..15c4fd9 100644 --- a/src/drivers/option/cfr.c +++ b/src/drivers/option/cfr.c @@ -307,6 +307,7 @@
cfr_root->tag = LB_TAG_CFR_ROOT; cfr_root->size = sizeof(*cfr_root); + cfr_root->version = CFR_VERSION;
current += cfr_root->size; while (sm_root && sm_root[i])