feat: initial
This commit is contained in:
commit
92d8a91be4
20 changed files with 1058 additions and 0 deletions
19
kernel/include/memory/sections.h
Normal file
19
kernel/include/memory/sections.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
#include "memory/pointer.h"
|
||||
|
||||
struct KernelSection {
|
||||
uint64_t vma_start;
|
||||
uint64_t vma_end;
|
||||
const char* name;
|
||||
|
||||
paddr_t phys_start() const { return paddr_t{vma_start >= high_base ? vma_start - high_base : vma_start}; }
|
||||
paddr_t phys_end() const { return paddr_t{vma_end >= high_base ? vma_end - high_base : vma_end}; }
|
||||
};
|
||||
|
||||
extern KernelSection __reserved_ranges_start__[], __reserved_ranges_end__[];
|
||||
|
||||
template<typename Fn>
|
||||
void for_each_reserved_section(Fn&& fn) {
|
||||
for (auto* s = __reserved_ranges_start__; s < __reserved_ranges_end__; ++s)
|
||||
fn(*s);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue