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

Method GetMemory

src/include/kernel_fdt.hpp:92–101  ·  view source on GitHub ↗

* @brief 获取内存信息 * @return Expected > 内存信息<地址,长度> * @pre fdt_header_ 不为空 * @post 返回第一个 reg 条目的 base 和 size */

Source from the content-addressed store, hash-verified

90 * @post 返回第一个 reg 条目的 base 和 size
91 */
92 [[nodiscard]] auto GetMemory() const
93 -> Expected<std::pair<uint64_t, size_t>> {
94 assert(fdt_header_ != nullptr && "fdt_header_ is null");
95
96 return FindNode("/memory").and_then(
97 [this](int offset) -> Expected<std::pair<uint64_t, size_t>> {
98 return GetRegProperty(offset).transform(
99 [](std::pair<uint64_t, size_t> reg) { return reg; });
100 });
101 }
102
103 /**
104 * @brief 获取串口信息

Callers 3

BasicInfoMethod · 0.80
BasicInfoMethod · 0.80
TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64