old-MTGos-old/kernel/hal/x86_64/mm/pmm.cpp
2016-06-17 21:39:43 +02:00

24 lines
644 B
C++

#include <base.hpp>
#include <pmm.hpp>
extern "C" const int kernel_start;
extern "C" const int kernel_end; //those are voids actually
namespace MTGosHAL {
PMM::PMM(): head(nullptr), pmm2() {}
auto PMM::init(struct multiboot_info* mb_info) -> void {
pmm2.init(mb_info);
}
auto PMM::markUsed(const void * addr, uint64_t length) -> bool {
return pmm2.markUsed(addr, length);
}
auto PMM::operator >> (void * &addr) -> PMM & {
pmm2>>addr;
return *this;
} //alloc
auto PMM::operator << (const void * addr) -> PMM & {
pmm2<<addr;
return *this;
} //free
auto PMM::operator()(int pages) -> void*{
return pmm2(pages);
} //alloc_multipage
}