MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / loader_init

Function loader_init

loader/src/loader_init.c:51–81  ·  view source on GitHub ↗

* <!-- description --> * @brief This function contains all of the code that is common between * all archiectures and all platforms that is needed for initializing * the loader. This function will call platform and architecture specific * functions as needed. * * <!-- inputs/outputs --> * @return LOADER_SUCCESS on success, LOADER_FAILURE on failure. */

Source from the content-addressed store, hash-verified

49 * @return LOADER_SUCCESS on success, LOADER_FAILURE on failure.
50 */
51NODISCARD int64_t
52loader_init(void) NOEXCEPT
53{
54 if (VMM_STATUS_CORRUPT == g_mut_vmm_status) {
55 bferror("Unable to init, previous VMM failed to properly stop");
56 return LOADER_FAILURE;
57 }
58
59 if (alloc_mk_debug_ring(&g_pmut_mut_mk_debug_ring)) {
60 bferror("alloc_mk_debug_ring failed");
61 goto alloc_mk_debug_ring_failed;
62 }
63
64 if (alloc_and_copy_mk_code_aliases(&g_mut_mk_code_aliases)) {
65 bferror("alloc_and_copy_mk_code_aliases failed");
66 goto alloc_and_copy_mk_code_aliases_failed;
67 }
68
69#ifdef DEBUG_LOADER
70 dump_mk_debug_ring(g_pmut_mut_mk_debug_ring);
71 dump_mk_code_aliases(&g_mut_mk_code_aliases);
72#endif
73
74 return LOADER_SUCCESS;
75
76alloc_and_copy_mk_code_aliases_failed:
77alloc_mk_debug_ring_failed:
78
79 (void)loader_fini();
80 return LOADER_FAILURE;
81}

Callers 10

loaderEvtDeviceAddFunction · 0.85
testsFunction · 0.85
testsFunction · 0.85
testsFunction · 0.85
testsFunction · 0.85
test_stop_vmm.cppFile · 0.85
testsFunction · 0.85
testsFunction · 0.85
dev_initFunction · 0.85
efi_mainFunction · 0.85

Calls 6

alloc_mk_debug_ringFunction · 0.85
dump_mk_debug_ringFunction · 0.85
loader_finiFunction · 0.85
bferrorFunction · 0.50
dump_mk_code_aliasesFunction · 0.50

Tested by 6

testsFunction · 0.68
testsFunction · 0.68
testsFunction · 0.68
testsFunction · 0.68
testsFunction · 0.68
testsFunction · 0.68