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

Function bootstrap_entry

kernel/integration/bf_mem_op_alloc_huge.cpp:108–151  ·  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 constexpr auto size{0x2000_u64};
116
117 void *pmut_mut_ptr{};
118 bsl::safe_u64 mut_phys{};
119
120 constexpr auto hndl{BF_INVALID_HANDLE};
121 bf_status_t const ret{
122 bf_mem_op_alloc_huge_impl(hndl.get(), size.get(), &pmut_mut_ptr, mut_phys.data())};
123 integration::require(ret != BF_STATUS_SUCCESS);
124 }
125
126 // success
127 {
128 constexpr auto size{0x2000_u64};
129 bsl::safe_u64 mut_phys{};
130
131 auto const *const ptr{g_mut_sys.bf_mem_op_alloc_huge<bsl::uint8>(size, mut_phys)};
132 integration::require(nullptr != ptr);
133 }
134
135 // allocate until we run out of memory.
136 {
137 constexpr auto size{0x2000_u64};
138
139 while (true) {
140 auto const *const ptr{g_mut_sys.bf_mem_op_alloc_huge<bsl::uint8>(size)};
141 if (nullptr == ptr) {
142 break;
143 }
144
145 bsl::touch();
146 }
147 }
148
149 bsl::debug() << "success. remaining backtrace is expected\n" << bsl::here();
150 return bf_control_op_exit();
151 }
152
153 /// <!-- description -->
154 /// @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