hle: kernel: Rename SharedMemory to KSharedMemory.
This commit is contained in:
parent
51e8b2733c
commit
0d62f30b00
13 changed files with 54 additions and 54 deletions
|
@ -5,20 +5,20 @@
|
|||
#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"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
SharedMemory::SharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory)
|
||||
KSharedMemory::KSharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory)
|
||||
: Object{kernel}, device_memory{device_memory} {}
|
||||
|
||||
SharedMemory::~SharedMemory() {
|
||||
KSharedMemory::~KSharedMemory() {
|
||||
kernel.GetSystemResourceLimit()->Release(LimitableResource::PhysicalMemory, size);
|
||||
}
|
||||
|
||||
std::shared_ptr<SharedMemory> SharedMemory::Create(
|
||||
std::shared_ptr<KSharedMemory> 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,
|
||||
|
@ -29,8 +29,8 @@ std::shared_ptr<SharedMemory> SharedMemory::Create(
|
|||
size);
|
||||
ASSERT(memory_reservation.Succeeded());
|
||||
|
||||
std::shared_ptr<SharedMemory> shared_memory{
|
||||
std::make_shared<SharedMemory>(kernel, device_memory)};
|
||||
std::shared_ptr<KSharedMemory> shared_memory{
|
||||
std::make_shared<KSharedMemory>(kernel, device_memory)};
|
||||
|
||||
shared_memory->owner_process = owner_process;
|
||||
shared_memory->page_list = std::move(page_list);
|
||||
|
@ -44,8 +44,8 @@ std::shared_ptr<SharedMemory> SharedMemory::Create(
|
|||
return shared_memory;
|
||||
}
|
||||
|
||||
ResultCode SharedMemory::Map(Process& target_process, VAddr address, std::size_t size,
|
||||
Memory::MemoryPermission permissions) {
|
||||
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) {
|
|
@ -19,12 +19,12 @@ namespace Kernel {
|
|||
|
||||
class KernelCore;
|
||||
|
||||
class SharedMemory final : public Object {
|
||||
class KSharedMemory final : public Object {
|
||||
public:
|
||||
explicit SharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory);
|
||||
~SharedMemory() override;
|
||||
explicit KSharedMemory(KernelCore& kernel, Core::DeviceMemory& device_memory);
|
||||
~KSharedMemory() override;
|
||||
|
||||
static std::shared_ptr<SharedMemory> Create(
|
||||
static 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,
|
|
@ -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<Memory::SlabHeap<Memory::Page>> user_slab_heap_pages;
|
||||
|
||||
// Shared memory for services
|
||||
std::shared_ptr<Kernel::SharedMemory> hid_shared_mem;
|
||||
std::shared_ptr<Kernel::SharedMemory> font_shared_mem;
|
||||
std::shared_ptr<Kernel::SharedMemory> irs_shared_mem;
|
||||
std::shared_ptr<Kernel::SharedMemory> time_shared_mem;
|
||||
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;
|
||||
|
||||
// Threads used for services
|
||||
std::unordered_set<std::shared_ptr<Kernel::ServiceThread>> service_threads;
|
||||
|
@ -589,35 +589,35 @@ const Memory::SlabHeap<Memory::Page>& 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Memory::Page>& 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);
|
||||
|
|
|
@ -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<SharedMemory>(shared_memory_handle)};
|
||||
auto shared_memory{current_process->GetHandleTable().Get<KSharedMemory>(shared_memory_handle)};
|
||||
if (!shared_memory) {
|
||||
LOG_ERROR(Kernel_SVC, "Shared memory does not exist, shared_memory_handle=0x{:08X}",
|
||||
shared_memory_handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue