diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-04 08:22:07 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:50 +0200 |
commit | 086db71e942dc3468bccb741cabf62fdd221e790 (patch) | |
tree | 46dda7ba6a9d2a1590b09ddddb450595879b2896 /src/core/hle/kernel/kernel.cpp | |
parent | hle: kernel: Migrate KProcess to KAutoObject. (diff) | |
download | yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar.gz yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar.bz2 yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar.lz yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar.xz yuzu-086db71e942dc3468bccb741cabf62fdd221e790.tar.zst yuzu-086db71e942dc3468bccb741cabf62fdd221e790.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 1b5b11564..cac76a6ec 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -575,22 +575,27 @@ struct KernelCore::Impl { const PAddr irs_phys_addr{system_pool.GetAddress() + hid_size + font_size}; const PAddr time_phys_addr{system_pool.GetAddress() + hid_size + font_size + irs_size}; - hid_shared_mem = Kernel::KSharedMemory::Create( - system.Kernel(), system.DeviceMemory(), nullptr, {hid_phys_addr, hid_size / PageSize}, - KMemoryPermission::None, KMemoryPermission::Read, hid_phys_addr, hid_size, - "HID:SharedMemory"); - font_shared_mem = Kernel::KSharedMemory::Create( - system.Kernel(), system.DeviceMemory(), nullptr, {font_phys_addr, font_size / PageSize}, - KMemoryPermission::None, KMemoryPermission::Read, font_phys_addr, font_size, - "Font:SharedMemory"); - irs_shared_mem = Kernel::KSharedMemory::Create( - system.Kernel(), system.DeviceMemory(), nullptr, {irs_phys_addr, irs_size / PageSize}, - KMemoryPermission::None, KMemoryPermission::Read, irs_phys_addr, irs_size, - "IRS:SharedMemory"); - time_shared_mem = Kernel::KSharedMemory::Create( - system.Kernel(), system.DeviceMemory(), nullptr, {time_phys_addr, time_size / PageSize}, - KMemoryPermission::None, KMemoryPermission::Read, time_phys_addr, time_size, - "Time:SharedMemory"); + hid_shared_mem = std::make_unique<KSharedMemory>(system.Kernel()); + font_shared_mem = std::make_unique<KSharedMemory>(system.Kernel()); + irs_shared_mem = std::make_unique<KSharedMemory>(system.Kernel()); + time_shared_mem = std::make_unique<KSharedMemory>(system.Kernel()); + + hid_shared_mem->Initialize(system.Kernel(), system.DeviceMemory(), nullptr, + {hid_phys_addr, hid_size / PageSize}, KMemoryPermission::None, + KMemoryPermission::Read, hid_phys_addr, hid_size, + "HID:SharedMemory"); + font_shared_mem->Initialize(system.Kernel(), system.DeviceMemory(), nullptr, + {font_phys_addr, font_size / PageSize}, KMemoryPermission::None, + KMemoryPermission::Read, font_phys_addr, font_size, + "Font:SharedMemory"); + irs_shared_mem->Initialize(system.Kernel(), system.DeviceMemory(), nullptr, + {irs_phys_addr, irs_size / PageSize}, KMemoryPermission::None, + KMemoryPermission::Read, irs_phys_addr, irs_size, + "IRS:SharedMemory"); + time_shared_mem->Initialize(system.Kernel(), system.DeviceMemory(), nullptr, + {time_phys_addr, time_size / PageSize}, KMemoryPermission::None, + KMemoryPermission::Read, time_phys_addr, time_size, + "Time:SharedMemory"); } void InitializePageSlab() { @@ -644,10 +649,10 @@ struct KernelCore::Impl { std::unique_ptr<KSlabHeap<Page>> user_slab_heap_pages; // Shared memory for services - std::shared_ptr<Kernel::KSharedMemory> hid_shared_mem; - std::shared_ptr<Kernel::KSharedMemory> font_shared_mem; - std::shared_ptr<Kernel::KSharedMemory> irs_shared_mem; - std::shared_ptr<Kernel::KSharedMemory> time_shared_mem; + std::unique_ptr<Kernel::KSharedMemory> hid_shared_mem; + std::unique_ptr<Kernel::KSharedMemory> font_shared_mem; + std::unique_ptr<Kernel::KSharedMemory> irs_shared_mem; + std::unique_ptr<Kernel::KSharedMemory> time_shared_mem; // Threads used for services std::unordered_set<std::shared_ptr<Kernel::ServiceThread>> service_threads; |