kern: implement KUnsafeMemory

This commit is contained in:
Michael Scire 2020-04-26 02:35:10 -07:00
parent 7bc0250cea
commit 970b85bf9a
4 changed files with 86 additions and 0 deletions

View file

@ -35,6 +35,7 @@ namespace ams::kern {
class KMemoryBlockSlabManager;
class KBlockInfoManager;
class KSynchronization;
class KUnsafeMemory;
@ -72,6 +73,7 @@ namespace ams::kern {
static KBlockInfoManager s_block_info_manager;
static KSupervisorPageTable s_supervisor_page_table;
static KSynchronization s_synchronization;
static KUnsafeMemory s_unsafe_memory;
static KWorkerTaskManager s_worker_task_managers[KWorkerTaskManager::WorkerType_Count];
private:
static ALWAYS_INLINE KCoreLocalContext &GetCoreLocalContext() {
@ -144,6 +146,10 @@ namespace ams::kern {
return s_synchronization;
}
static ALWAYS_INLINE KUnsafeMemory &GetUnsafeMemory() {
return s_unsafe_memory;
}
static ALWAYS_INLINE KWorkerTaskManager &GetWorkerTaskManager(KWorkerTaskManager::WorkerType type) {
MESOSPHERE_ASSERT(type <= KWorkerTaskManager::WorkerType_Count);
return s_worker_task_managers[type];