From 0d62f30b00fbfe598573ea8fd433bd64d7be3e5f Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 5 Feb 2021 23:14:31 -0800 Subject: hle: kernel: Rename SharedMemory to KSharedMemory. --- src/core/CMakeLists.txt | 4 +- src/core/hle/kernel/k_shared_memory.cpp | 66 +++++++++++++++++++ src/core/hle/kernel/k_shared_memory.h | 87 +++++++++++++++++++++++++ src/core/hle/kernel/kernel.cpp | 34 +++++----- src/core/hle/kernel/kernel.h | 18 ++--- src/core/hle/kernel/shared_memory.cpp | 66 ------------------- src/core/hle/kernel/shared_memory.h | 87 ------------------------- src/core/hle/kernel/svc.cpp | 4 +- src/core/hle/service/hid/hid.cpp | 2 +- src/core/hle/service/hid/hid.h | 4 +- src/core/hle/service/hid/irs.cpp | 2 +- src/core/hle/service/hid/irs.h | 4 +- src/core/hle/service/ns/pl_u.cpp | 4 +- src/core/hle/service/time/time_sharedmemory.cpp | 2 +- src/core/hle/service/time/time_sharedmemory.h | 6 +- 15 files changed, 195 insertions(+), 195 deletions(-) create mode 100644 src/core/hle/kernel/k_shared_memory.cpp create mode 100644 src/core/hle/kernel/k_shared_memory.h delete mode 100644 src/core/hle/kernel/shared_memory.cpp delete mode 100644 src/core/hle/kernel/shared_memory.h (limited to 'src/core') diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c6bdf72ec..8d4823f93 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -175,6 +175,8 @@ add_library(core STATIC hle/kernel/k_scoped_lock.h hle/kernel/k_scoped_resource_reservation.h hle/kernel/k_scoped_scheduler_lock_and_sleep.h + hle/kernel/k_shared_memory.cpp + hle/kernel/k_shared_memory.h hle/kernel/k_synchronization_object.cpp hle/kernel/k_synchronization_object.h hle/kernel/k_thread.cpp @@ -218,8 +220,6 @@ add_library(core STATIC hle/kernel/service_thread.h hle/kernel/session.cpp hle/kernel/session.h - hle/kernel/shared_memory.cpp - hle/kernel/shared_memory.h hle/kernel/svc.cpp hle/kernel/svc.h hle/kernel/svc_common.h diff --git a/src/core/hle/kernel/k_shared_memory.cpp b/src/core/hle/kernel/k_shared_memory.cpp new file mode 100644 index 000000000..dd82e0217 --- /dev/null +++ b/src/core/hle/kernel/k_shared_memory.cpp @@ -0,0 +1,66 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/assert.h" +#include "core/core.h" +#include "core/hle/kernel/k_scoped_resource_reservation.h" +#include "core/hle/kernel/k_shared_memory.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/memory/page_table.h" + +namespace Kernel { + +KSharedMemory::KSharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory) + : Object{kernel}, device_memory{device_memory} {} + +KSharedMemory::~KSharedMemory() { + kernel.GetSystemResourceLimit()->Release(LimitableResource::PhysicalMemory, size); +} + +std::shared_ptr KSharedMemory::Create( + KernelCore& kernel, Core::DeviceMemory& device_memory, Process* owner_process, + Memory::PageLinkedList&& page_list, Memory::MemoryPermission owner_permission, + Memory::MemoryPermission user_permission, PAddr physical_address, std::size_t size, + std::string name) { + + const auto resource_limit = kernel.GetSystemResourceLimit(); + KScopedResourceReservation memory_reservation(resource_limit, LimitableResource::PhysicalMemory, + size); + ASSERT(memory_reservation.Succeeded()); + + std::shared_ptr shared_memory{ + std::make_shared(kernel, device_memory)}; + + shared_memory->owner_process = owner_process; + shared_memory->page_list = std::move(page_list); + shared_memory->owner_permission = owner_permission; + shared_memory->user_permission = user_permission; + shared_memory->physical_address = physical_address; + shared_memory->size = size; + shared_memory->name = name; + + memory_reservation.Commit(); + return shared_memory; +} + +ResultCode KSharedMemory::Map(Process& target_process, VAddr address, std::size_t size, + Memory::MemoryPermission permissions) { + const u64 page_count{(size + Memory::PageSize - 1) / Memory::PageSize}; + + if (page_list.GetNumPages() != page_count) { + UNIMPLEMENTED_MSG("Page count does not match"); + } + + const Memory::MemoryPermission expected = + &target_process == owner_process ? owner_permission : user_permission; + + if (permissions != expected) { + UNIMPLEMENTED_MSG("Permission does not match"); + } + + return target_process.PageTable().MapPages(address, page_list, Memory::MemoryState::Shared, + permissions); +} + +} // namespace Kernel diff --git a/src/core/hle/kernel/k_shared_memory.h b/src/core/hle/kernel/k_shared_memory.h new file mode 100644 index 000000000..4d1354415 --- /dev/null +++ b/src/core/hle/kernel/k_shared_memory.h @@ -0,0 +1,87 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#include "common/common_types.h" +#include "core/device_memory.h" +#include "core/hle/kernel/memory/memory_block.h" +#include "core/hle/kernel/memory/page_linked_list.h" +#include "core/hle/kernel/object.h" +#include "core/hle/kernel/process.h" +#include "core/hle/result.h" + +namespace Kernel { + +class KernelCore; + +class KSharedMemory final : public Object { +public: + explicit KSharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory); + ~KSharedMemory() override; + + static std::shared_ptr Create( + KernelCore& kernel, Core::DeviceMemory& device_memory, Process* owner_process, + Memory::PageLinkedList&& page_list, Memory::MemoryPermission owner_permission, + Memory::MemoryPermission user_permission, PAddr physical_address, std::size_t size, + std::string name); + + std::string GetTypeName() const override { + return "SharedMemory"; + } + + std::string GetName() const override { + return name; + } + + static constexpr HandleType HANDLE_TYPE = HandleType::SharedMemory; + HandleType GetHandleType() const override { + return HANDLE_TYPE; + } + + /** + * Maps a shared memory block to an address in the target process' address space + * @param target_process Process on which to map the memory block + * @param address Address in system memory to map shared memory block to + * @param size Size of the shared memory block to map + * @param permissions Memory block map permissions (specified by SVC field) + */ + ResultCode Map(Process& target_process, VAddr address, std::size_t size, + Memory::MemoryPermission permissions); + + /** + * Gets a pointer to the shared memory block + * @param offset Offset from the start of the shared memory block to get pointer + * @return A pointer to the shared memory block from the specified offset + */ + u8* GetPointer(std::size_t offset = 0) { + return device_memory.GetPointer(physical_address + offset); + } + + /** + * Gets a pointer to the shared memory block + * @param offset Offset from the start of the shared memory block to get pointer + * @return A pointer to the shared memory block from the specified offset + */ + const u8* GetPointer(std::size_t offset = 0) const { + return device_memory.GetPointer(physical_address + offset); + } + + void Finalize() override {} + +private: + Core::DeviceMemory& device_memory; + Process* owner_process{}; + Memory::PageLinkedList page_list; + Memory::MemoryPermission owner_permission{}; + Memory::MemoryPermission user_permission{}; + PAddr physical_address{}; + std::size_t size{}; + std::string name; +}; + +} // namespace Kernel diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b6e6f115e..5eb602843 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -29,6 +29,7 @@ #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/k_scheduler.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory/memory_layout.h" @@ -37,7 +38,6 @@ #include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/service_thread.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/kernel/svc_results.h" #include "core/hle/kernel/time_manager.h" #include "core/hle/lock.h" @@ -288,19 +288,19 @@ struct KernelCore::Impl { layout.System().StartAddress(), layout.System().EndAddress()); - hid_shared_mem = Kernel::SharedMemory::Create( + hid_shared_mem = Kernel::KSharedMemory::Create( system.Kernel(), system.DeviceMemory(), nullptr, {hid_addr, hid_size / Memory::PageSize}, Memory::MemoryPermission::None, Memory::MemoryPermission::Read, hid_addr, hid_size, "HID:SharedMemory"); - font_shared_mem = Kernel::SharedMemory::Create( + font_shared_mem = Kernel::KSharedMemory::Create( system.Kernel(), system.DeviceMemory(), nullptr, {font_pa, font_size / Memory::PageSize}, Memory::MemoryPermission::None, Memory::MemoryPermission::Read, font_pa, font_size, "Font:SharedMemory"); - irs_shared_mem = Kernel::SharedMemory::Create( + irs_shared_mem = Kernel::KSharedMemory::Create( system.Kernel(), system.DeviceMemory(), nullptr, {irs_addr, irs_size / Memory::PageSize}, Memory::MemoryPermission::None, Memory::MemoryPermission::Read, irs_addr, irs_size, "IRS:SharedMemory"); - time_shared_mem = Kernel::SharedMemory::Create( + time_shared_mem = Kernel::KSharedMemory::Create( system.Kernel(), system.DeviceMemory(), nullptr, {time_addr, time_size / Memory::PageSize}, Memory::MemoryPermission::None, Memory::MemoryPermission::Read, time_addr, time_size, "Time:SharedMemory"); @@ -352,10 +352,10 @@ struct KernelCore::Impl { std::unique_ptr> user_slab_heap_pages; // Shared memory for services - std::shared_ptr hid_shared_mem; - std::shared_ptr font_shared_mem; - std::shared_ptr irs_shared_mem; - std::shared_ptr time_shared_mem; + std::shared_ptr hid_shared_mem; + std::shared_ptr font_shared_mem; + std::shared_ptr irs_shared_mem; + std::shared_ptr time_shared_mem; // Threads used for services std::unordered_set> service_threads; @@ -589,35 +589,35 @@ const Memory::SlabHeap& KernelCore::GetUserSlabHeapPages() const { return *impl->user_slab_heap_pages; } -Kernel::SharedMemory& KernelCore::GetHidSharedMem() { +Kernel::KSharedMemory& KernelCore::GetHidSharedMem() { return *impl->hid_shared_mem; } -const Kernel::SharedMemory& KernelCore::GetHidSharedMem() const { +const Kernel::KSharedMemory& KernelCore::GetHidSharedMem() const { return *impl->hid_shared_mem; } -Kernel::SharedMemory& KernelCore::GetFontSharedMem() { +Kernel::KSharedMemory& KernelCore::GetFontSharedMem() { return *impl->font_shared_mem; } -const Kernel::SharedMemory& KernelCore::GetFontSharedMem() const { +const Kernel::KSharedMemory& KernelCore::GetFontSharedMem() const { return *impl->font_shared_mem; } -Kernel::SharedMemory& KernelCore::GetIrsSharedMem() { +Kernel::KSharedMemory& KernelCore::GetIrsSharedMem() { return *impl->irs_shared_mem; } -const Kernel::SharedMemory& KernelCore::GetIrsSharedMem() const { +const Kernel::KSharedMemory& KernelCore::GetIrsSharedMem() const { return *impl->irs_shared_mem; } -Kernel::SharedMemory& KernelCore::GetTimeSharedMem() { +Kernel::KSharedMemory& KernelCore::GetTimeSharedMem() { return *impl->time_shared_mem; } -const Kernel::SharedMemory& KernelCore::GetTimeSharedMem() const { +const Kernel::KSharedMemory& KernelCore::GetTimeSharedMem() const { return *impl->time_shared_mem; } diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 806a0d986..c5b32b260 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -40,7 +40,7 @@ class PhysicalCore; class Process; class KResourceLimit; class KScheduler; -class SharedMemory; +class KSharedMemory; class ServiceThread; class Synchronization; class KThread; @@ -190,28 +190,28 @@ public: const Memory::SlabHeap& GetUserSlabHeapPages() const; /// Gets the shared memory object for HID services. - Kernel::SharedMemory& GetHidSharedMem(); + Kernel::KSharedMemory& GetHidSharedMem(); /// Gets the shared memory object for HID services. - const Kernel::SharedMemory& GetHidSharedMem() const; + const Kernel::KSharedMemory& GetHidSharedMem() const; /// Gets the shared memory object for font services. - Kernel::SharedMemory& GetFontSharedMem(); + Kernel::KSharedMemory& GetFontSharedMem(); /// Gets the shared memory object for font services. - const Kernel::SharedMemory& GetFontSharedMem() const; + const Kernel::KSharedMemory& GetFontSharedMem() const; /// Gets the shared memory object for IRS services. - Kernel::SharedMemory& GetIrsSharedMem(); + Kernel::KSharedMemory& GetIrsSharedMem(); /// Gets the shared memory object for IRS services. - const Kernel::SharedMemory& GetIrsSharedMem() const; + const Kernel::KSharedMemory& GetIrsSharedMem() const; /// Gets the shared memory object for Time services. - Kernel::SharedMemory& GetTimeSharedMem(); + Kernel::KSharedMemory& GetTimeSharedMem(); /// Gets the shared memory object for Time services. - const Kernel::SharedMemory& GetTimeSharedMem() const; + const Kernel::KSharedMemory& GetTimeSharedMem() const; /// Suspend/unsuspend the OS. void Suspend(bool in_suspention); diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp deleted file mode 100644 index 2eadd51d7..000000000 --- a/src/core/hle/kernel/shared_memory.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "common/assert.h" -#include "core/core.h" -#include "core/hle/kernel/k_scoped_resource_reservation.h" -#include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/memory/page_table.h" -#include "core/hle/kernel/shared_memory.h" - -namespace Kernel { - -SharedMemory::SharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory) - : Object{kernel}, device_memory{device_memory} {} - -SharedMemory::~SharedMemory() { - kernel.GetSystemResourceLimit()->Release(LimitableResource::PhysicalMemory, size); -} - -std::shared_ptr SharedMemory::Create( - KernelCore& kernel, Core::DeviceMemory& device_memory, Process* owner_process, - Memory::PageLinkedList&& page_list, Memory::MemoryPermission owner_permission, - Memory::MemoryPermission user_permission, PAddr physical_address, std::size_t size, - std::string name) { - - const auto resource_limit = kernel.GetSystemResourceLimit(); - KScopedResourceReservation memory_reservation(resource_limit, LimitableResource::PhysicalMemory, - size); - ASSERT(memory_reservation.Succeeded()); - - std::shared_ptr shared_memory{ - std::make_shared(kernel, device_memory)}; - - shared_memory->owner_process = owner_process; - shared_memory->page_list = std::move(page_list); - shared_memory->owner_permission = owner_permission; - shared_memory->user_permission = user_permission; - shared_memory->physical_address = physical_address; - shared_memory->size = size; - shared_memory->name = name; - - memory_reservation.Commit(); - return shared_memory; -} - -ResultCode SharedMemory::Map(Process& target_process, VAddr address, std::size_t size, - Memory::MemoryPermission permissions) { - const u64 page_count{(size + Memory::PageSize - 1) / Memory::PageSize}; - - if (page_list.GetNumPages() != page_count) { - UNIMPLEMENTED_MSG("Page count does not match"); - } - - const Memory::MemoryPermission expected = - &target_process == owner_process ? owner_permission : user_permission; - - if (permissions != expected) { - UNIMPLEMENTED_MSG("Permission does not match"); - } - - return target_process.PageTable().MapPages(address, page_list, Memory::MemoryState::Shared, - permissions); -} - -} // namespace Kernel diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h deleted file mode 100644 index 623bd8b11..000000000 --- a/src/core/hle/kernel/shared_memory.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -#include "common/common_types.h" -#include "core/device_memory.h" -#include "core/hle/kernel/memory/memory_block.h" -#include "core/hle/kernel/memory/page_linked_list.h" -#include "core/hle/kernel/object.h" -#include "core/hle/kernel/process.h" -#include "core/hle/result.h" - -namespace Kernel { - -class KernelCore; - -class SharedMemory final : public Object { -public: - explicit SharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory); - ~SharedMemory() override; - - static std::shared_ptr Create( - KernelCore& kernel, Core::DeviceMemory& device_memory, Process* owner_process, - Memory::PageLinkedList&& page_list, Memory::MemoryPermission owner_permission, - Memory::MemoryPermission user_permission, PAddr physical_address, std::size_t size, - std::string name); - - std::string GetTypeName() const override { - return "SharedMemory"; - } - - std::string GetName() const override { - return name; - } - - static constexpr HandleType HANDLE_TYPE = HandleType::SharedMemory; - HandleType GetHandleType() const override { - return HANDLE_TYPE; - } - - /** - * Maps a shared memory block to an address in the target process' address space - * @param target_process Process on which to map the memory block - * @param address Address in system memory to map shared memory block to - * @param size Size of the shared memory block to map - * @param permissions Memory block map permissions (specified by SVC field) - */ - ResultCode Map(Process& target_process, VAddr address, std::size_t size, - Memory::MemoryPermission permissions); - - /** - * Gets a pointer to the shared memory block - * @param offset Offset from the start of the shared memory block to get pointer - * @return A pointer to the shared memory block from the specified offset - */ - u8* GetPointer(std::size_t offset = 0) { - return device_memory.GetPointer(physical_address + offset); - } - - /** - * Gets a pointer to the shared memory block - * @param offset Offset from the start of the shared memory block to get pointer - * @return A pointer to the shared memory block from the specified offset - */ - const u8* GetPointer(std::size_t offset = 0) const { - return device_memory.GetPointer(physical_address + offset); - } - - void Finalize() override {} - -private: - Core::DeviceMemory& device_memory; - Process* owner_process{}; - Memory::PageLinkedList page_list; - Memory::MemoryPermission owner_permission{}; - Memory::MemoryPermission user_permission{}; - PAddr physical_address{}; - std::size_t size{}; - std::string name; -}; - -} // namespace Kernel diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 31d899e06..85899f83c 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -32,6 +32,7 @@ #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" #include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_synchronization_object.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/k_writable_event.h" @@ -41,7 +42,6 @@ #include "core/hle/kernel/memory/page_table.h" #include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/kernel/svc.h" #include "core/hle/kernel/svc_results.h" #include "core/hle/kernel/svc_types.h" @@ -1267,7 +1267,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han return ResultInvalidMemoryRange; } - auto shared_memory{current_process->GetHandleTable().Get(shared_memory_handle)}; + auto shared_memory{current_process->GetHandleTable().Get(shared_memory_handle)}; if (!shared_memory) { LOG_ERROR(Kernel_SVC, "Shared memory does not exist, shared_memory_handle=0x{:08X}", shared_memory_handle); diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 1e2677320..ffc3dfdc3 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -15,9 +15,9 @@ #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" #include "core/hle/kernel/k_readable_event.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/hid/errors.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/irs.h" diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 7cc0433e2..06ddcf3e4 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -14,7 +14,7 @@ struct EventType; } namespace Kernel { -class SharedMemory; +class KSharedMemory; } namespace Service::SM { @@ -69,7 +69,7 @@ private: void UpdateControllers(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); void UpdateMotion(std::uintptr_t user_data, std::chrono::nanoseconds ns_late); - std::shared_ptr shared_mem; + std::shared_ptr shared_mem; std::shared_ptr pad_update_event; std::shared_ptr motion_update_event; diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp index c8413099f..2dfa936fb 100644 --- a/src/core/hle/service/hid/irs.cpp +++ b/src/core/hle/service/hid/irs.cpp @@ -6,8 +6,8 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/hid/irs.h" namespace Service::HID { diff --git a/src/core/hle/service/hid/irs.h b/src/core/hle/service/hid/irs.h index be0c486ba..b0c8c7168 100644 --- a/src/core/hle/service/hid/irs.h +++ b/src/core/hle/service/hid/irs.h @@ -12,7 +12,7 @@ class System; } namespace Kernel { -class SharedMemory; +class KSharedMemory; } namespace Service::HID { @@ -42,7 +42,7 @@ private: void StopImageProcessorAsync(Kernel::HLERequestContext& ctx); void ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx); - std::shared_ptr shared_mem; + std::shared_ptr shared_mem; const u32 device_handle{0xABCD}; }; diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index b6ac0a81a..fcd15d81f 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -19,9 +19,9 @@ #include "core/file_sys/romfs.h" #include "core/file_sys/system_archive/system_archive.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/physical_memory.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/ns/pl_u.h" @@ -131,7 +131,7 @@ struct PL_U::Impl { } /// Handle to shared memory region designated for a shared font - std::shared_ptr shared_font_mem; + std::shared_ptr shared_font_mem; /// Backing memory for the shared font data std::shared_ptr shared_font; diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp index e0ae9f874..4d8de81be 100644 --- a/src/core/hle/service/time/time_sharedmemory.cpp +++ b/src/core/hle/service/time/time_sharedmemory.cpp @@ -22,7 +22,7 @@ SharedMemory::SharedMemory(Core::System& system) : system(system) { SharedMemory::~SharedMemory() = default; -std::shared_ptr SharedMemory::GetSharedMemoryHolder() const { +std::shared_ptr SharedMemory::GetSharedMemoryHolder() const { return shared_memory_holder; } diff --git a/src/core/hle/service/time/time_sharedmemory.h b/src/core/hle/service/time/time_sharedmemory.h index e0c3e63da..299680517 100644 --- a/src/core/hle/service/time/time_sharedmemory.h +++ b/src/core/hle/service/time/time_sharedmemory.h @@ -6,8 +6,8 @@ #include "common/common_types.h" #include "common/uuid.h" +#include "core/hle/kernel/k_shared_memory.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/time/clock_types.h" namespace Service::Time { @@ -18,7 +18,7 @@ public: ~SharedMemory(); // Return the shared memory handle - std::shared_ptr GetSharedMemoryHolder() const; + std::shared_ptr GetSharedMemoryHolder() const; // TODO(ogniK): We have to properly simulate memory barriers, how are we going to do this? template @@ -63,7 +63,7 @@ public: void SetAutomaticCorrectionEnabled(bool is_enabled); private: - std::shared_ptr shared_memory_holder; + std::shared_ptr shared_memory_holder; Core::System& system; Format shared_memory_format{}; }; -- cgit v1.2.3