| 105 | /// @param ppid0 the physical process to bootstrap |
| 106 | /// |
| 107 | extern "C" void |
| 108 | bootstrap_entry(bsl::safe_u16::value_type const ppid0) noexcept |
| 109 | { |
| 110 | constexpr auto one{bsl::safe_u16::magic_1()}; |
| 111 | |
| 112 | auto const vpid{g_mut_sys.bf_vp_op_create_vp({})}; |
| 113 | integration::require(vpid.is_valid()); |
| 114 | |
| 115 | // invalid handle |
| 116 | { |
| 117 | constexpr auto hndl{BF_INVALID_HANDLE}; |
| 118 | bf_status_t const ret{bf_vs_op_init_as_root_impl(hndl.get(), {})}; |
| 119 | integration::require(ret != BF_STATUS_SUCCESS); |
| 120 | } |
| 121 | |
| 122 | // invalid id |
| 123 | { |
| 124 | constexpr auto vsid{BF_INVALID_ID}; |
| 125 | bf_status_t const ret{bf_vs_op_init_as_root_impl({}, vsid.get())}; |
| 126 | integration::require(ret != BF_STATUS_SUCCESS); |
| 127 | } |
| 128 | |
| 129 | // id out of range |
| 130 | { |
| 131 | constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) + one).checked()}; |
| 132 | bf_status_t const ret{bf_vs_op_init_as_root_impl({}, vsid.get())}; |
| 133 | integration::require(ret != BF_STATUS_SUCCESS); |
| 134 | } |
| 135 | |
| 136 | // id never allocated |
| 137 | { |
| 138 | constexpr auto vsid{(bsl::to_u16(HYPERVISOR_MAX_VSS) - one).checked()}; |
| 139 | bf_status_t const ret{bf_vs_op_init_as_root_impl({}, vsid.get())}; |
| 140 | integration::require(ret != BF_STATUS_SUCCESS); |
| 141 | } |
| 142 | |
| 143 | auto const vsid{g_mut_sys.bf_vs_op_create_vs(vpid, bsl::to_u16(ppid0))}; |
| 144 | integration::require(vsid.is_valid()); |
| 145 | |
| 146 | // success |
| 147 | { |
| 148 | auto const ret{g_mut_sys.bf_vs_op_init_as_root(vsid)}; |
| 149 | integration::require(ret); |
| 150 | } |
| 151 | |
| 152 | bsl::debug() << "success. remaining backtrace is expected\n" << bsl::here(); |
| 153 | return bf_control_op_exit(); |
| 154 | } |
| 155 | |
| 156 | /// <!-- description --> |
| 157 | /// @brief Implements the fast fail entry function. This is registered |
nothing calls this directly
no test coverage detected