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

Function emit_chip_headers

util/sconfig/main.c:1366–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1364}
1365
1366static void emit_chip_headers(FILE *fil, struct chip *chip)
1367{
1368 struct chip *tmp = chip;
1369
1370 while (chip) {
1371 if (chip->chiph_exists)
1372 fprintf(fil, "#include \"%s/chip.h\"\n", chip->name);
1373 chip = chip->next;
1374 }
1375 fprintf(fil, "\n#if !DEVTREE_EARLY\n");
1376 fprintf(fil,
1377 "__attribute__((weak)) struct chip_operations mainboard_ops = {};\n");
1378
1379 chip = tmp;
1380 while (chip) {
1381 /* A lot of cpus do not define chip_operations at all, and the ones
1382 that do only initialise .name. */
1383 if (strstr(chip->name_underscore, "cpu_") == chip->name_underscore) {
1384 fprintf(fil,
1385 "__attribute__((weak)) struct chip_operations %s_ops = {};\n",
1386 chip->name_underscore);
1387 } else {
1388 fprintf(fil, "extern struct chip_operations %s_ops;\n",
1389 chip->name_underscore);
1390 }
1391 chip = chip->next;
1392 }
1393 fprintf(fil, "#endif\n");
1394}
1395
1396static void emit_chip_instance(FILE *fil, struct chip_instance *instance)
1397{

Callers 1

generate_outputcFunction · 0.85

Calls 2

fprintfFunction · 0.85
strstrFunction · 0.50

Tested by

no test coverage detected