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

Function read_header

util/amdfwtool/amdfwread.c:98–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static int read_header(FILE *fw, uint32_t offset, void *header, size_t header_size)
99{
100 if (fseek(fw, offset, SEEK_SET) != 0) {
101 ERR("Failed to seek to file offset 0x%x\n", offset);
102 return 1;
103 }
104
105 if (fread(header, header_size, 1, fw) != 1) {
106 ERR("Failed to read header at 0x%x\n", offset);
107 return 1;
108 }
109
110 return 0;
111}
112
113static int read_fw_header(FILE *fw, uint32_t offset, embedded_firmware *fw_header)
114{

Callers 5

read_fw_headerFunction · 0.85
test_if_psp_directoryFunction · 0.85
read_psp_directoryFunction · 0.85
read_ish_directoryFunction · 0.85
read_bios_directoryFunction · 0.85

Calls 2

fseekFunction · 0.85
freadFunction · 0.85

Tested by 1

test_if_psp_directoryFunction · 0.68