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

Function pad_buffer

util/cbfstool/ifwitool.c:1027–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025}
1026
1027static void pad_buffer(struct buffer *b, size_t size)
1028{
1029 size_t buff_size = buffer_size(b);
1030
1031 assert(buff_size <= size);
1032
1033 if (buff_size == size)
1034 return;
1035
1036 struct buffer temp;
1037 alloc_buffer(&temp, size, b->name);
1038 uint8_t *data = buffer_get(&temp);
1039
1040 memcpy(data, buffer_get(b), buff_size);
1041 memset(data + buff_size, 0xFF, size - buff_size);
1042
1043 *b = temp;
1044}
1045
1046/* Initialize offsets of entries using pack order. */
1047static void bpdt_entries_init_pack_order(void)

Callers 1

Calls 5

buffer_sizeFunction · 0.85
alloc_bufferFunction · 0.85
buffer_getFunction · 0.85
memcpyFunction · 0.50
memsetFunction · 0.50

Tested by

no test coverage detected