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

Function cbfs_module_init

payloads/coreinfo/cbfs_module.c:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static int cbfs_module_init(void)
87{
88 struct cbfile *f;
89 int index = 0;
90
91 header = *(void **)HEADER_ADDR;
92 if (header->magic != ntohl(HEADER_MAGIC)) {
93 header = NULL;
94 return 0;
95 }
96
97 for (f = firstfile(); f; f = nextfile(f))
98 filecount++;
99
100 filenames = malloc(filecount * sizeof(char *));
101 if (filenames == NULL)
102 return 0;
103
104 for (f = firstfile(); f; f = nextfile(f))
105 filenames[index++] = strdup((const char *)f->filename);
106
107 return 0;
108}
109
110static int cbfs_module_redraw(WINDOW * win)
111{

Callers

nothing calls this directly

Calls 4

firstfileFunction · 0.85
nextfileFunction · 0.85
mallocFunction · 0.50
strdupFunction · 0.50

Tested by

no test coverage detected