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

Function ext_main_entry

kernel/integration/bf_vs_op_tlb_flush.cpp:269–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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