feat: start adding physical memory allocator
This commit is contained in:
parent
8dc53f662e
commit
e2ea22ad53
15 changed files with 440 additions and 38 deletions
|
|
@ -17,3 +17,14 @@ void for_each_reserved_section(Fn&& fn) {
|
|||
for (auto* s = __reserved_ranges_start__; s < __reserved_ranges_end__; ++s)
|
||||
fn(*s);
|
||||
}
|
||||
|
||||
inline bool is_in_reserved_section(paddr_t ptr, size_t size = 1) {
|
||||
bool res = false;
|
||||
for_each_reserved_section([&](const KernelSection& section) {
|
||||
if (ptr.address < section.phys_end().address &&
|
||||
section.phys_start().address < ptr.address + size) {
|
||||
res = true;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue