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

Function bootstrap_entry

kernel/integration/bf_mem_op_alloc_page.cpp:108–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 /// @param ppid0 the physical process to bootstrap
107 ///
108 extern "C" void
109 bootstrap_entry(bsl::safe_u16::value_type const ppid0) noexcept
110 {
111 bsl::discard(ppid0);
112
113 // invalid handle
114 {
115 void *pmut_mut_ptr{};
116 bsl::safe_u64 mut_phys{};
117
118 constexpr auto hndl{BF_INVALID_HANDLE};
119 bf_status_t const ret{
120 bf_mem_op_alloc_page_impl(hndl.get(), &pmut_mut_ptr, mut_phys.data())};
121 integration::require(ret != BF_STATUS_SUCCESS);
122 }
123
124 // success
125 {
126 bsl::safe_u64 mut_phys{};
127 auto const *const ptr{g_mut_sys.bf_mem_op_alloc_page<lib::basic_page_4k_t>(mut_phys)};
128 integration::require(nullptr != ptr);
129 }
130
131 // allocate until we run out of memory.
132 {
133 while (true) {
134 auto const *const ptr{g_mut_sys.bf_mem_op_alloc_page<lib::basic_page_4k_t>()};
135 if (nullptr == ptr) {
136 break;
137 }
138
139 bsl::touch();
140 }
141 }
142
143 bsl::debug() << "success. remaining backtrace is expected\n" << bsl::here();
144 return bf_control_op_exit();
145 }
146
147 /// <!-- description -->
148 /// @brief Implements the fast fail entry function. This is registered

Callers

nothing calls this directly

Calls 4

requireFunction · 0.85
bf_control_op_exitFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected