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

Function allocate_buffer

util/cbfstool/cse_serger.c:620–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620static int allocate_buffer(struct buffer *buff, struct buffer *wbuff, const char *str)
621{
622 if (params.version_str == NULL) {
623 ERROR("No version provided!\n");
624 return -1;
625 }
626
627 ifwi.bpdt_ops = get_bpdt_ops(NULL);
628 if (!ifwi.bpdt_ops)
629 return -1;
630
631 if (buffer_create(buff, BUFF_SIZE_ALIGN, str)) {
632 ERROR("Buffer creation error!\n");
633 return -1;
634 }
635
636 void *data = buffer_get(buff);
637 memset(data, 0xff, buffer_size(buff));
638
639 buffer_clone(wbuff, buff);
640
641 return 0;
642}
643
644static size_t get_cse_region_end_offset(void)
645{

Callers 2

fill_layout_bufferFunction · 0.85
cmd_create_bpdtFunction · 0.85

Calls 6

get_bpdt_opsFunction · 0.85
buffer_createFunction · 0.85
buffer_getFunction · 0.85
buffer_sizeFunction · 0.85
buffer_cloneFunction · 0.85
memsetFunction · 0.50

Tested by

no test coverage detected