MCPcopy Create free account
hub / github.com/coreboot/coreboot / parse_fitc_table

Function parse_fitc_table

util/ifdtool/ifdtool.c:1724–1740  ·  view source on GitHub ↗

* Helper function to parse the FPT to retrieve the FITC start offset and size. * FITC is a sub-partition table inside CSE data partition known as FPT. * * CSE Region * |-----> CSE Data Partition Offset * | |-------> FPT Entry * | | |-> Sub Partition 1 * | | |-> Sub Partition 2 * | | |-> FI

Source from the content-addressed store, hash-verified

1722 * | | | | -> FITC Length
1723 */
1724static int parse_fitc_table(struct cse_fpt *fpt, uint32_t *offset,
1725 size_t *size)
1726{
1727 size_t num_part_header = fpt->count;
1728 /* Move to the next structure which is FPT sub-partition entries */
1729 struct cse_fpt_sub_part *fpt_sub_part = (struct cse_fpt_sub_part *)(fpt + 1);
1730 for (size_t index = 0; index < num_part_header; index++) {
1731 if (!strncmp(fpt_sub_part->signature, "FITC", 4)) {
1732 *offset = fpt_sub_part->offset;
1733 *size = fpt_sub_part->length;
1734 return 0;
1735 }
1736 fpt_sub_part++;
1737 }
1738
1739 return -1;
1740}
1741
1742/*
1743 * Formula to calculate the GPR0 protection range as below:

Callers 1

calculate_gpr0_rangeFunction · 0.85

Calls 1

strncmpFunction · 0.50

Tested by

no test coverage detected