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

Function main

payloads/linuxcheck/linuxcheck.c:22–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20extern struct sysinfo_t lib_sysinfo;
21
22int main(void)
23{
24 int ret, i;
25
26 buts("Greetings from linuxcheck, via hard-coded calls to serial functions.\n");
27 if (console_out == NULL)
28 buts("Bad news: console_out is NULL\n");
29 if (lib_sysinfo.serial == NULL)
30 buts("Bad news: lib_sysinfo.serial is NULL. Very little will work well.\n");
31 ret = lib_get_sysinfo();
32 if (ret) {
33 buts("lib_get_sysinfo() is non-zero");
34 hex32(ret);
35 buts("\n");
36 }
37
38 buts("The next line should be puts works\n");
39 puts("puts works\n");
40 buts("If you did not see puts works, then you have a console issues\n");
41 buts("The next line should be 'printf works'\n");
42 printf("printf works\n");
43 buts(" ... if you did not see printf works, then you have a printf issue\n");
44 printf("Number of memory ranges: %d\n", lib_sysinfo.n_memranges);
45 for (i = 0; i < lib_sysinfo.n_memranges; i++) {
46 printf("%d: base 0x%08llx size 0x%08llx type 0x%x\n", i, lib_sysinfo.memrange[i].base, lib_sysinfo.memrange[i].size, lib_sysinfo.memrange[i].type);
47 }
48 buts("Now we will halt. Bye");
49 halt();
50 return 0;
51}

Callers

nothing calls this directly

Calls 6

butsFunction · 0.85
hex32Function · 0.85
putsFunction · 0.85
printfFunction · 0.85
lib_get_sysinfoFunction · 0.50
haltFunction · 0.50

Tested by

no test coverage detected