<!-- description --> @brief Initializes this ext_pool_t <!-- 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_t to use @param system_rpt the system RPT provided by the loader @param elf_files the ext_elf_files provided by the loader @return Returns bsl::errc_success on success, bsl::errc_failure and friends othe
| 83 | /// and friends otherwise |
| 84 | /// |
| 85 | [[nodiscard]] constexpr auto |
| 86 | initialize( |
| 87 | tls_t &mut_tls, |
| 88 | page_pool_t &mut_page_pool, |
| 89 | huge_pool_t &mut_huge_pool, |
| 90 | root_page_table_t const &system_rpt, |
| 91 | loader::ext_elf_files_t const &elf_files) noexcept -> bsl::errc_type |
| 92 | { |
| 93 | bsl::finally mut_release_on_error{ |
| 94 | [this, &mut_tls, &mut_page_pool, &mut_huge_pool]() noexcept -> void { |
| 95 | this->release(mut_tls, mut_page_pool, mut_huge_pool); |
| 96 | }}; |
| 97 | |
| 98 | for (bsl::safe_idx mut_i{}; mut_i < m_pool.size(); ++mut_i) { |
| 99 | auto *const pmut_ext{m_pool.at_if(mut_i)}; |
| 100 | |
| 101 | if (nullptr == *elf_files.at_if(mut_i)) { |
| 102 | break; |
| 103 | } |
| 104 | |
| 105 | auto const ret{pmut_ext->initialize( |
| 106 | mut_tls, |
| 107 | mut_page_pool, |
| 108 | bsl::to_u16(mut_i), |
| 109 | *elf_files.at_if(mut_i), |
| 110 | system_rpt)}; |
| 111 | |
| 112 | if (bsl::unlikely(!ret)) { |
| 113 | bsl::print<bsl::V>() << bsl::here(); |
| 114 | return ret; |
| 115 | } |
| 116 | |
| 117 | bsl::touch(); |
| 118 | } |
| 119 | |
| 120 | mut_release_on_error.ignore(); |
| 121 | return bsl::errc_success; |
| 122 | } |
| 123 | |
| 124 | /// <!-- description --> |
| 125 | /// @brief Release the ext_pool_t |