MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / riscv_cpu_init

Function riscv_cpu_init

tinyemu/riscv_cpu.c:1349–1375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1347
1348#if CONFIG_RISCV_MAX_XLEN == MAX_XLEN
1349RISCVCPUState *riscv_cpu_init(PhysMemoryMap *mem_map, int max_xlen)
1350{
1351 const RISCVCPUClass *c;
1352 switch(max_xlen) {
1353 /* with emscripten we compile a single CPU */
1354#if defined(EMSCRIPTEN)
1355 case MAX_XLEN:
1356 c = &glue(riscv_cpu_class, MAX_XLEN);
1357 break;
1358#else
1359 case 32:
1360 c = &riscv_cpu_class32;
1361 break;
1362 case 64:
1363 c = &riscv_cpu_class64;
1364 break;
1365#if CONFIG_RISCV_MAX_XLEN == 128
1366 case 128:
1367 c = &riscv_cpu_class128;
1368 break;
1369#endif
1370#endif /* !EMSCRIPTEN */
1371 default:
1372 return NULL;
1373 }
1374 return c->riscv_cpu_init(mem_map);
1375}
1376#endif /* CONFIG_RISCV_MAX_XLEN == MAX_XLEN */
1377

Callers 1

riscv_machine_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected