| 274 | /// @param exit_reason the exit reason associated with the VMExit |
| 275 | /// |
| 276 | extern "C" void |
| 277 | vmexit_entry( |
| 278 | bsl::safe_u16::value_type const vsid, bsl::safe_u64::value_type const exit_reason) noexcept |
| 279 | { |
| 280 | /// NOTE: |
| 281 | /// - Call into the vmexit handler. This entry point serves as a |
| 282 | /// trampoline between C and C++. Specifically, the microkernel |
| 283 | /// cannot call a member function directly, and can only call |
| 284 | /// a C style function. |
| 285 | /// |
| 286 | |
| 287 | auto const ret{dispatch_vmexit( // -- |
| 288 | g_mut_gs, // -- |
| 289 | g_mut_tls, // -- |
| 290 | g_mut_sys, // -- |
| 291 | g_mut_intrinsic, // -- |
| 292 | g_mut_vp_pool, // -- |
| 293 | g_mut_vs_pool, // -- |
| 294 | bsl::to_u16(vsid), // -- |
| 295 | bsl::to_u64(exit_reason))}; |
| 296 | |
| 297 | if (bsl::unlikely(!ret)) { |
| 298 | bsl::print<bsl::V>() << bsl::here(); |
| 299 | return bf_control_op_exit(); |
| 300 | } |
| 301 | |
| 302 | /// NOTE: |
| 303 | /// - This code should never be reached. The VMExit handler should |
| 304 | /// always call one of the "run" ABIs to return back to the |
| 305 | /// microkernel when a VMExit is finished. If this is called, it |
| 306 | /// is because the VMExit handler returned with an error. |
| 307 | /// |
| 308 | |
| 309 | return bf_control_op_exit(); |
| 310 | } |
| 311 | |
| 312 | /// <!-- description --> |
| 313 | /// @brief Implements the main entry function for this example |
nothing calls this directly
no test coverage detected