summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/board
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-10-23 03:16:38 +0200
committerLiam <byteslice@airmail.cc>2023-11-10 18:01:35 +0100
commit2a255b2d61a445fb2b83cc8af7632e3d720e1292 (patch)
tree37f5c16ba52339d91e57c5b975639dc1eb60b9f7 /src/core/hle/kernel/board
parentMerge pull request #11981 from lucasreis1/patch (diff)
downloadyuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.gz
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.bz2
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.lz
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.xz
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.tar.zst
yuzu-2a255b2d61a445fb2b83cc8af7632e3d720e1292.zip
Diffstat (limited to 'src/core/hle/kernel/board')
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp13
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.h7
2 files changed, 17 insertions, 3 deletions
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
index 59364efa1..37fa39a73 100644
--- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
@@ -222,7 +222,7 @@ Result KSystemControl::AllocateSecureMemory(KernelCore& kernel, KVirtualAddress*
};
// We succeeded.
- *out = KPageTable::GetHeapVirtualAddress(kernel.MemoryLayout(), paddr);
+ *out = KPageTable::GetHeapVirtualAddress(kernel, paddr);
R_SUCCEED();
}
@@ -238,8 +238,17 @@ void KSystemControl::FreeSecureMemory(KernelCore& kernel, KVirtualAddress addres
ASSERT(Common::IsAligned(size, alignment));
// Close the secure region's pages.
- kernel.MemoryManager().Close(KPageTable::GetHeapPhysicalAddress(kernel.MemoryLayout(), address),
+ kernel.MemoryManager().Close(KPageTable::GetHeapPhysicalAddress(kernel, address),
size / PageSize);
}
+// Insecure Memory.
+KResourceLimit* KSystemControl::GetInsecureMemoryResourceLimit(KernelCore& kernel) {
+ return kernel.GetSystemResourceLimit();
+}
+
+u32 KSystemControl::GetInsecureMemoryPool() {
+ return static_cast<u32>(KMemoryManager::Pool::SystemNonSecure);
+}
+
} // namespace Kernel::Board::Nintendo::Nx
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.h b/src/core/hle/kernel/board/nintendo/nx/k_system_control.h
index ff1feec70..60c5e58b7 100644
--- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.h
+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.h
@@ -8,7 +8,8 @@
namespace Kernel {
class KernelCore;
-}
+class KResourceLimit;
+} // namespace Kernel
namespace Kernel::Board::Nintendo::Nx {
@@ -40,6 +41,10 @@ public:
u32 pool);
static void FreeSecureMemory(KernelCore& kernel, KVirtualAddress address, size_t size,
u32 pool);
+
+ // Insecure Memory.
+ static KResourceLimit* GetInsecureMemoryResourceLimit(KernelCore& kernel);
+ static u32 GetInsecureMemoryPool();
};
} // namespace Kernel::Board::Nintendo::Nx