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

Function fix_member

util/cbfstool/ifwitool.c:409–431  ·  view source on GitHub ↗

* Convert to little endian format. * Returns the offset up to which the fixup was performed. */

Source from the content-addressed store, hash-verified

407 * Returns the offset up to which the fixup was performed.
408 */
409static size_t fix_member(void *data, size_t offset, size_t size_bytes)
410{
411 uint8_t *src = (uint8_t *)data + offset;
412
413 switch (size_bytes) {
414 case 1:
415 write_at_le8(data, *(uint8_t *)src, offset);
416 break;
417 case 2:
418 write_at_le16(data, *(uint16_t *)src, offset);
419 break;
420 case 4:
421 write_at_le32(data, *(uint32_t *)src, offset);
422 break;
423 case 8:
424 write_at_le64(data, *(uint64_t *)src, offset);
425 break;
426 default:
427 ERROR("Write size not supported %zd\n", size_bytes);
428 exit(-1);
429 }
430 return (offset + size_bytes);
431}
432
433
434static void print_subpart_dir(struct subpart_dir *s)

Callers 2

bpdt_fixup_write_bufferFunction · 0.85

Calls 5

write_at_le8Function · 0.85
write_at_le16Function · 0.85
write_at_le32Function · 0.85
write_at_le64Function · 0.85
exitFunction · 0.85

Tested by

no test coverage detected