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

Function vmexit_entry

example/default/src/main.cpp:196–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 /// @param exit_reason the exit reason associated with the VMExit
195 ///
196 extern "C" void
197 vmexit_entry(
198 bsl::safe_u16::value_type const vsid, bsl::safe_u64::value_type const exit_reason) noexcept
199 {
200 /// NOTE:
201 /// - Call into the vmexit handler. This entry point serves as a
202 /// trampoline between C and C++. Specifically, the microkernel
203 /// cannot call a member function directly, and can only call
204 /// a C style function.
205 ///
206
207 auto const ret{dispatch_vmexit( // --
208 g_mut_gs, // --
209 g_mut_tls, // --
210 g_mut_sys, // --
211 g_mut_intrinsic, // --
212 g_mut_vp_pool, // --
213 g_mut_vs_pool, // --
214 bsl::to_u16(vsid), // --
215 bsl::to_u64(exit_reason))};
216
217 if (bsl::unlikely(!ret)) {
218 bsl::print<bsl::V>() << bsl::here();
219 return syscall::bf_control_op_exit();
220 }
221
222 /// NOTE:
223 /// - This code should never be reached. The VMExit handler should
224 /// always call one of the "run" ABIs to return back to the
225 /// microkernel when a VMExit is finished. If this is called, it
226 /// is because the VMExit handler returned with an error.
227 ///
228
229 return syscall::bf_control_op_exit();
230 }
231
232 /// <!-- description -->
233 /// @brief Implements the main entry function for this example

Callers 1

behavior.cppFile · 0.50

Calls 2

dispatch_vmexitFunction · 0.50
bf_control_op_exitFunction · 0.50

Tested by

no test coverage detected