kern: implement KMemoryManager init

This commit is contained in:
Michael Scire 2020-02-06 17:40:57 -08:00
parent 1de607c183
commit f7d3d50f33
9 changed files with 283 additions and 9 deletions

View file

@ -29,6 +29,7 @@ namespace ams::kern {
class KInterruptManager;
class KInterruptTaskManager;
class KScheduler;
class KMemoryManager;
class Kernel {
public:
@ -42,6 +43,7 @@ namespace ams::kern {
static KThread s_main_threads[cpu::NumCores];
static KThread s_idle_threads[cpu::NumCores];
static KResourceLimit s_system_resource_limit;
static KMemoryManager s_memory_manager;
private:
static ALWAYS_INLINE KCoreLocalContext &GetCoreLocalContext() {
return reinterpret_cast<KCoreLocalRegion *>(cpu::GetCoreLocalRegionAddress())->current.context;
@ -84,6 +86,10 @@ namespace ams::kern {
return GetCoreLocalContext().hardware_timer;
}
static ALWAYS_INLINE KMemoryManager &GetMemoryManager() {
return s_memory_manager;
}
static ALWAYS_INLINE KResourceLimit &GetSystemResourceLimit() {
return s_system_resource_limit;
}