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

Function ext_main_entry

kernel/integration/bf_debug_op_dump_vm.cpp:241–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 /// microkernel speak the same ABI.
240 ///
241 extern "C" void
242 ext_main_entry(bsl::uint32 const version) noexcept
243 {
244 bsl::errc_type mut_ret{};
245
246 /// NOTE:
247 /// - Initialize the bf_syscall_t. This will validate the ABI version,
248 /// open a handle to the microkernel and register the required
249 /// callbacks. If this fails, we call bf_control_op_exit, which is
250 /// similar to exit() from POSIX, except that the return value is
251 /// always the same.
252 ///
253
254 mut_ret = g_mut_sys.initialize( // --
255 bsl::to_u32(version), // --
256 &bootstrap_entry, // --
257 &vmexit_entry, // --
258 &fail_entry); // --
259
260 if (bsl::unlikely(!mut_ret)) {
261 bsl::print<bsl::V>() << bsl::here();
262 return bf_control_op_exit();
263 }
264
265 mut_ret = gs_initialize(g_mut_gs, g_mut_sys, g_mut_intrinsic);
266 if (bsl::unlikely(!mut_ret)) {
267 bsl::print<bsl::V>() << bsl::here();
268 return bf_control_op_exit();
269 }
270
271 /// NOTE:
272 /// - Initialize the vp_pool_t. This will give all of our vp_t's
273 /// their IDs so that they can be allocated.
274 ///
275
276 g_mut_vp_pool.initialize(g_mut_gs, g_mut_tls, g_mut_sys, g_mut_intrinsic);
277
278 /// NOTE:
279 /// - Initialize the vs_pool_t. This will give all of our vs_t's
280 /// their IDs so that they can be allocated.
281 ///
282
283 g_mut_vs_pool.initialize(g_mut_gs, g_mut_tls, g_mut_sys, g_mut_intrinsic);
284
285 /// NOTE:
286 /// - Wait for callbacks. Note that this function does not return.
287 /// The next time the extension is executed, it will be the
288 /// bootstrap callback that was just previously registered, which
289 /// will be called on each PP that is online. Failure to call this
290 /// function leads to undefined behaviour (likely a page fault).
291 /// - This is similar to the wait() function from POSIX after having
292 /// just started some processes, with the difference being that
293 /// this will never return, so there is no need to pass in status
294 /// as there is nothing to process after this call.
295 ///
296
297 return bf_control_op_wait();
298 }

Callers

nothing calls this directly

Calls 4

bf_control_op_exitFunction · 0.50
gs_initializeFunction · 0.50
bf_control_op_waitFunction · 0.50
initializeMethod · 0.45

Tested by

no test coverage detected