MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / CheckElfClass

Method CheckElfClass

src/include/kernel_elf.hpp:143–151  ·  view source on GitHub ↗

* 检查 ELF class (32/64 bit) */

Source from the content-addressed store, hash-verified

141 * 检查 ELF class (32/64 bit)
142 */
143 [[nodiscard]] auto CheckElfClass() const -> Expected<void> {
144 if (elf_[EI_CLASS] == ELFCLASS32) {
145 return std::unexpected(Error(ErrorCode::kElfUnsupported32Bit));
146 }
147 if (elf_[EI_CLASS] != ELFCLASS64) {
148 return std::unexpected(Error(ErrorCode::kElfInvalidClass));
149 }
150 return {};
151 }
152};
153
154using KernelElfSingleton = etl::singleton<KernelElf>;

Callers

nothing calls this directly

Calls 1

ErrorClass · 0.85

Tested by

no test coverage detected