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

Function fpt_parse

util/cbfstool/cse_fpt.c:139–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139static int fpt_parse(const char *image_name)
140{
141 struct buffer *input_buff = &fpt.input_buff;
142 struct buffer fpt_buff;
143
144 if (buffer_from_file(input_buff, image_name)) {
145 ERROR("Failed to read input file %s\n", image_name);
146 return -1;
147 }
148
149 if (get_fpt_buff(input_buff, &fpt_buff))
150 return -1;
151
152 fpt.hdr_ops = get_fpt_hdr_ops(&fpt_buff);
153 if (fpt.hdr_ops == NULL) {
154 ERROR("FPT header format not supported!\n");
155 return -1;
156 }
157
158 fpt.hdr = fpt.hdr_ops->read(&fpt_buff);
159 if (!fpt.hdr) {
160 ERROR("Unable to read FPT header!\n");
161 return -1;
162 }
163
164 return read_fpt_entries(&fpt_buff);
165}
166
167static bool is_partition_valid(const struct fpt_entry *e)
168{

Callers 1

mainFunction · 0.85

Calls 5

buffer_from_fileFunction · 0.85
get_fpt_buffFunction · 0.85
get_fpt_hdr_opsFunction · 0.85
read_fpt_entriesFunction · 0.85
readMethod · 0.80

Tested by

no test coverage detected