<!-- description --> @brief Provides the main entry point for all syscalls. This function will dispatch syscalls as needed. <!-- inputs/outputs --> @param mut_tls the current TLS block @param mut_page_pool the page_pool_t to use @param mut_huge_pool the huge pool to use @param mut_intrinsic the intrinsic_t to use @param mut_vm_pool the vm_pool_t to use @param mut_vp_pool the vp_pool_t to use @par
| 72 | /// @return Returns a bf_status_t containing success or failure |
| 73 | /// |
| 74 | [[nodiscard]] constexpr auto |
| 75 | dispatch_syscall( |
| 76 | tls_t &mut_tls, |
| 77 | page_pool_t &mut_page_pool, |
| 78 | huge_pool_t &mut_huge_pool, |
| 79 | intrinsic_t &mut_intrinsic, |
| 80 | vm_pool_t &mut_vm_pool, |
| 81 | vp_pool_t &mut_vp_pool, |
| 82 | vs_pool_t &mut_vs_pool, |
| 83 | ext_pool_t &mut_ext_pool, |
| 84 | vmexit_log_t &mut_log) noexcept -> syscall::bf_status_t |
| 85 | { |
| 86 | bsl::expects(nullptr != mut_tls.ext); |
| 87 | |
| 88 | switch (syscall::bf_syscall_opcode(mut_tls.ext_syscall).get()) { |
| 89 | case syscall::BF_DEBUG_OP_VAL.get(): { |
| 90 | auto const ret{dispatch_syscall_bf_debug_op( |
| 91 | mut_tls, |
| 92 | mut_page_pool, |
| 93 | mut_huge_pool, |
| 94 | mut_intrinsic, |
| 95 | mut_vm_pool, |
| 96 | mut_vp_pool, |
| 97 | mut_vs_pool, |
| 98 | mut_ext_pool, |
| 99 | mut_log)}; |
| 100 | |
| 101 | if (bsl::unlikely(ret != syscall::BF_STATUS_SUCCESS)) { |
| 102 | bsl::print<bsl::V>() << bsl::here(); |
| 103 | return ret; |
| 104 | } |
| 105 | |
| 106 | return ret; |
| 107 | } |
| 108 | |
| 109 | case syscall::BF_VS_OP_VAL.get(): { |
| 110 | auto const ret{dispatch_syscall_bf_vs_op( |
| 111 | mut_tls, |
| 112 | mut_page_pool, |
| 113 | mut_intrinsic, |
| 114 | mut_vm_pool, |
| 115 | mut_vp_pool, |
| 116 | mut_vs_pool, |
| 117 | mut_ext_pool)}; |
| 118 | if (bsl::unlikely(ret != syscall::BF_STATUS_SUCCESS)) { |
| 119 | bsl::print<bsl::V>() << bsl::here(); |
| 120 | return ret; |
| 121 | } |
| 122 | |
| 123 | return ret; |
| 124 | } |
| 125 | |
| 126 | case syscall::BF_MEM_OP_VAL.get(): { |
| 127 | auto const ret{dispatch_syscall_bf_mem_op(mut_tls, mut_page_pool, mut_huge_pool)}; |
| 128 | if (bsl::unlikely(ret != syscall::BF_STATUS_SUCCESS)) { |
| 129 | bsl::print<bsl::V>() << bsl::here(); |
| 130 | return ret; |
| 131 | } |
no test coverage detected