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

Function ext_main_entry

kernel/integration/bf_vs_op_read.cpp:291–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 /// microkernel speak the same ABI.
290 ///
291 extern "C" void
292 ext_main_entry(bsl::uint32 const version) noexcept
293 {
294 bsl::errc_type mut_ret{};
295
296 /// NOTE:
297 /// - Initialize the bf_syscall_t. This will validate the ABI version,
298 /// open a handle to the microkernel and register the required
299 /// callbacks. If this fails, we call bf_control_op_exit, which is
300 /// similar to exit() from POSIX, except that the return value is
301 /// always the same.
302 ///
303
304 mut_ret = g_mut_sys.initialize( // --
305 bsl::to_u32(version), // --
306 &bootstrap_entry, // --
307 &vmexit_entry, // --
308 &fail_entry); // --
309
310 if (bsl::unlikely(!mut_ret)) {
311 bsl::print<bsl::V>() << bsl::here();
312 return bf_control_op_exit();
313 }
314
315 mut_ret = gs_initialize(g_mut_gs, g_mut_sys, g_mut_intrinsic);
316 if (bsl::unlikely(!mut_ret)) {
317 bsl::print<bsl::V>() << bsl::here();
318 return bf_control_op_exit();
319 }
320
321 /// NOTE:
322 /// - Initialize the vp_pool_t. This will give all of our vp_t's
323 /// their IDs so that they can be allocated.
324 ///
325
326 g_mut_vp_pool.initialize(g_mut_gs, g_mut_tls, g_mut_sys, g_mut_intrinsic);
327
328 /// NOTE:
329 /// - Initialize the vs_pool_t. This will give all of our vs_t's
330 /// their IDs so that they can be allocated.
331 ///
332
333 g_mut_vs_pool.initialize(g_mut_gs, g_mut_tls, g_mut_sys, g_mut_intrinsic);
334
335 /// NOTE:
336 /// - Wait for callbacks. Note that this function does not return.
337 /// The next time the extension is executed, it will be the
338 /// bootstrap callback that was just previously registered, which
339 /// will be called on each PP that is online. Failure to call this
340 /// function leads to undefined behaviour (likely a page fault).
341 /// - This is similar to the wait() function from POSIX after having
342 /// just started some processes, with the difference being that
343 /// this will never return, so there is no need to pass in status
344 /// as there is nothing to process after this call.
345 ///
346
347 return bf_control_op_wait();
348 }

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