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

Method CheckPSCI

src/include/kernel_fdt.hpp:71–84  ·  view source on GitHub ↗

* @brief 判断 PSCI 信息 * @return Expected 成功返回空,失败返回错误 * @pre fdt_header_ 不为空 */

Source from the content-addressed store, hash-verified

69 * @pre fdt_header_ 不为空
70 */
71 [[nodiscard]] auto CheckPSCI() const -> Expected<void> {
72 assert(fdt_header_ != nullptr && "fdt_header_ is null");
73
74 return FindNode("/psci").and_then([this](int offset) -> Expected<void> {
75 return GetPsciMethod(offset).and_then(
76 [this, offset](const char* method) -> Expected<void> {
77 klog::Debug("PSCI method: {}", method);
78 if (strcmp(method, "smc") != 0) {
79 return std::unexpected(Error(ErrorCode::kFdtPropertyNotFound));
80 }
81 return ValidatePsciFunctionIds(offset);
82 });
83 });
84 }
85
86 /**
87 * @brief 获取内存信息

Callers 1

ArchInitFunction · 0.80

Calls 3

DebugFunction · 0.85
strcmpFunction · 0.85
ErrorClass · 0.85

Tested by

no test coverage detected