feat: start adding physical memory allocator
This commit is contained in:
parent
8dc53f662e
commit
e2ea22ad53
15 changed files with 440 additions and 38 deletions
|
|
@ -7,13 +7,12 @@ constexpr uint64_t high_base = 0xFFFF800000000000;
|
|||
#define read_symbol(symbol) [](){uint64_t res; asm volatile("movabsq $" symbol ", %0": "=r"(res)); return res;}()
|
||||
|
||||
struct paddr_t {
|
||||
uint64_t address;
|
||||
|
||||
template<typename T>
|
||||
T* access() {
|
||||
return reinterpret_cast<T*>(address+high_base);
|
||||
}
|
||||
uint64_t address;
|
||||
|
||||
template<typename T>
|
||||
T* access() {
|
||||
return reinterpret_cast<T*>(address+high_base);
|
||||
}
|
||||
};
|
||||
|
||||
inline void* operator new(size_t, void* p) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue