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

Function print_vbt

util/intelvbttool/intelvbttool.c:924–954  ·  view source on GitHub ↗

Short VBT summary in human readable form */

Source from the content-addressed store, hash-verified

922
923/* Short VBT summary in human readable form */
924static void print_vbt(const struct fileobject *fo)
925{
926 const struct bdb_header *bdb;
927
928 if (fo->size < sizeof(struct vbt_header))
929 return;
930
931 const struct vbt_header *head = (const struct vbt_header *)fo->data;
932
933 print("Found VBT:\n");
934 printt("signature: <%20.20s>\n", head->signature);
935 printt("version: %d.%02d\n", head->version / 100, head->version % 100);
936 if (head->header_size != sizeof(struct vbt_header))
937 printt("header size: 0x%x\n", head->header_size);
938 printt("VBT size: 0x%x\n", head->vbt_size);
939 printt("VBT checksum: 0x%x\n", head->vbt_checksum);
940
941 if (head->bdb_offset > (fo->size - sizeof(struct bdb_header))) {
942 printerr("invalid BDB offset\n");
943 return;
944 }
945 bdb = (const struct bdb_header *)
946 ((const char *)head + head->bdb_offset);
947
948 if (memcmp("BIOS_DATA_BLOCK ", bdb->signature, 16) != 0) {
949 printerr("invalid BDB signature:%s\n", bdb->signature);
950 return;
951 }
952 printt("BDB version: %u.%02u\n", bdb->version / 100,
953 bdb->version % 100);
954}
955
956static void print_usage(const char *argv0, struct option *long_options)
957{

Callers 1

mainFunction · 0.85

Calls 4

printFunction · 0.85
printtFunction · 0.85
printerrFunction · 0.85
memcmpFunction · 0.50

Tested by

no test coverage detected