summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2021-05-25 09:26:22 +0200
committerGitHub <noreply@github.com>2021-05-25 09:26:22 +0200
commitb6b73d9a5a2adc02ac9671907d66a99eb0f5fd47 (patch)
treef0cd9430f3c5ff5eb5ad8b0372b5fd85e2538928 /src/core
parentMerge pull request #6357 from lioncash/compression (diff)
parentkernel: process_capability: Add MapRegion capability (diff)
downloadyuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar.gz
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar.bz2
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar.lz
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar.xz
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.tar.zst
yuzu-b6b73d9a5a2adc02ac9671907d66a99eb0f5fd47.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/process_capability.cpp9
-rw-r--r--src/core/hle/kernel/process_capability.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp
index fcb8b1ea5..b2ceeceb3 100644
--- a/src/core/hle/kernel/process_capability.cpp
+++ b/src/core/hle/kernel/process_capability.cpp
@@ -22,6 +22,7 @@ enum : u32 {
CapabilityOffset_Syscall = 4,
CapabilityOffset_MapPhysical = 6,
CapabilityOffset_MapIO = 7,
+ CapabilityOffset_MapRegion = 10,
CapabilityOffset_Interrupt = 11,
CapabilityOffset_ProgramType = 13,
CapabilityOffset_KernelVersion = 14,
@@ -46,6 +47,7 @@ enum class CapabilityType : u32 {
Syscall = (1U << CapabilityOffset_Syscall) - 1,
MapPhysical = (1U << CapabilityOffset_MapPhysical) - 1,
MapIO = (1U << CapabilityOffset_MapIO) - 1,
+ MapRegion = (1U << CapabilityOffset_MapRegion) - 1,
Interrupt = (1U << CapabilityOffset_Interrupt) - 1,
ProgramType = (1U << CapabilityOffset_ProgramType) - 1,
KernelVersion = (1U << CapabilityOffset_KernelVersion) - 1,
@@ -187,6 +189,8 @@ ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& s
return HandleSyscallFlags(set_svc_bits, flag);
case CapabilityType::MapIO:
return HandleMapIOFlags(flag, page_table);
+ case CapabilityType::MapRegion:
+ return HandleMapRegionFlags(flag, page_table);
case CapabilityType::Interrupt:
return HandleInterruptFlags(flag);
case CapabilityType::ProgramType:
@@ -298,6 +302,11 @@ ResultCode ProcessCapabilities::HandleMapIOFlags(u32 flags, KPageTable& page_tab
return RESULT_SUCCESS;
}
+ResultCode ProcessCapabilities::HandleMapRegionFlags(u32 flags, KPageTable& page_table) {
+ // TODO(Lioncache): Implement once the memory manager can handle this.
+ return RESULT_SUCCESS;
+}
+
ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) {
constexpr u32 interrupt_ignore_value = 0x3FF;
const u32 interrupt0 = (flags >> 12) & 0x3FF;
diff --git a/src/core/hle/kernel/process_capability.h b/src/core/hle/kernel/process_capability.h
index b7a9b2e45..2a7bf5505 100644
--- a/src/core/hle/kernel/process_capability.h
+++ b/src/core/hle/kernel/process_capability.h
@@ -231,6 +231,9 @@ private:
/// Handles flags related to mapping IO pages.
ResultCode HandleMapIOFlags(u32 flags, KPageTable& page_table);
+ /// Handles flags related to mapping physical memory regions.
+ ResultCode HandleMapRegionFlags(u32 flags, KPageTable& page_table);
+
/// Handles flags related to the interrupt capability flags.
ResultCode HandleInterruptFlags(u32 flags);