summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2023-12-13 21:39:38 -0600
committerGravatar Narr the Reg2023-12-13 23:24:28 -0600
commit64f68e96354df3afb9bb563c888793f98ecb5026 (patch)
tree82a1f3f51902e0a926bae4ae8a84ba1dcf2a145b /src/core/hle/kernel/kernel.cpp
parentMerge pull request #12342 from FearlessTobi/fix-msvc (diff)
downloadyuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.gz
yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.tar.xz
yuzu-64f68e96354df3afb9bb563c888793f98ecb5026.zip
service: hid: Allow to create multiple instances of shared memory
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 8cb05ca0b..e479dacde 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -135,7 +135,6 @@ struct KernelCore::Impl {
135 obj = nullptr; 135 obj = nullptr;
136 } 136 }
137 }; 137 };
138 CleanupObject(hid_shared_mem);
139 CleanupObject(font_shared_mem); 138 CleanupObject(font_shared_mem);
140 CleanupObject(irs_shared_mem); 139 CleanupObject(irs_shared_mem);
141 CleanupObject(time_shared_mem); 140 CleanupObject(time_shared_mem);
@@ -744,22 +743,16 @@ struct KernelCore::Impl {
744 void InitializeHackSharedMemory(KernelCore& kernel) { 743 void InitializeHackSharedMemory(KernelCore& kernel) {
745 // Setup memory regions for emulated processes 744 // Setup memory regions for emulated processes
746 // TODO(bunnei): These should not be hardcoded regions initialized within the kernel 745 // TODO(bunnei): These should not be hardcoded regions initialized within the kernel
747 constexpr std::size_t hid_size{0x40000};
748 constexpr std::size_t font_size{0x1100000}; 746 constexpr std::size_t font_size{0x1100000};
749 constexpr std::size_t irs_size{0x8000}; 747 constexpr std::size_t irs_size{0x8000};
750 constexpr std::size_t time_size{0x1000}; 748 constexpr std::size_t time_size{0x1000};
751 constexpr std::size_t hidbus_size{0x1000}; 749 constexpr std::size_t hidbus_size{0x1000};
752 750
753 hid_shared_mem = KSharedMemory::Create(system.Kernel());
754 font_shared_mem = KSharedMemory::Create(system.Kernel()); 751 font_shared_mem = KSharedMemory::Create(system.Kernel());
755 irs_shared_mem = KSharedMemory::Create(system.Kernel()); 752 irs_shared_mem = KSharedMemory::Create(system.Kernel());
756 time_shared_mem = KSharedMemory::Create(system.Kernel()); 753 time_shared_mem = KSharedMemory::Create(system.Kernel());
757 hidbus_shared_mem = KSharedMemory::Create(system.Kernel()); 754 hidbus_shared_mem = KSharedMemory::Create(system.Kernel());
758 755
759 hid_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None,
760 Svc::MemoryPermission::Read, hid_size);
761 KSharedMemory::Register(kernel, hid_shared_mem);
762
763 font_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None, 756 font_shared_mem->Initialize(system.DeviceMemory(), nullptr, Svc::MemoryPermission::None,
764 Svc::MemoryPermission::Read, font_size); 757 Svc::MemoryPermission::Read, font_size);
765 KSharedMemory::Register(kernel, font_shared_mem); 758 KSharedMemory::Register(kernel, font_shared_mem);
@@ -1190,14 +1183,6 @@ const KSystemResource& KernelCore::GetSystemSystemResource() const {
1190 return *impl->sys_system_resource; 1183 return *impl->sys_system_resource;
1191} 1184}
1192 1185
1193Kernel::KSharedMemory& KernelCore::GetHidSharedMem() {
1194 return *impl->hid_shared_mem;
1195}
1196
1197const Kernel::KSharedMemory& KernelCore::GetHidSharedMem() const {
1198 return *impl->hid_shared_mem;
1199}
1200
1201Kernel::KSharedMemory& KernelCore::GetFontSharedMem() { 1186Kernel::KSharedMemory& KernelCore::GetFontSharedMem() {
1202 return *impl->font_shared_mem; 1187 return *impl->font_shared_mem;
1203} 1188}