diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index d461dc6e8..223b3ce37 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -102,7 +102,7 @@ public: */ ResultVal> CreateThread(std::string name, VAddr entry_point, u32 priority, u32 arg, s32 processor_id, VAddr stack_top, - SharedPtr owner_process); + Process* owner_process); /** * Creates a semaphore. @@ -156,7 +156,7 @@ public: * linear heap. * @param name Optional object name, used for debugging purposes. */ - SharedPtr CreateSharedMemory(SharedPtr owner_process, u32 size, + SharedPtr CreateSharedMemory(Process* owner_process, u32 size, MemoryPermission permissions, MemoryPermission other_permissions, VAddr address = 0, diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 70a937222..4f0b2e8ee 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -14,7 +14,7 @@ namespace Kernel { SharedMemory::SharedMemory(KernelSystem& kernel) : Object(kernel) {} SharedMemory::~SharedMemory() {} -SharedPtr KernelSystem::CreateSharedMemory(SharedPtr owner_process, u32 size, +SharedPtr KernelSystem::CreateSharedMemory(Process* owner_process, u32 size, MemoryPermission permissions, MemoryPermission other_permissions, VAddr address, MemoryRegion region, diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index d5d862927..18a87b9fe 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -58,7 +58,7 @@ public: u8* GetPointer(u32 offset = 0); /// Process that created this shared memory block. - SharedPtr owner_process; + Process* owner_process; /// Address of shared memory block in the owner process if specified. VAddr base_address; /// Physical address of the shared memory block in the linear heap if no address was specified diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 94a820f34..0e7a21c0a 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -785,9 +785,9 @@ static ResultCode CreateThread(Handle* out_handle, u32 priority, u32 entry_point break; } - CASCADE_RESULT(SharedPtr thread, - Core::System::GetInstance().Kernel().CreateThread( - name, entry_point, priority, arg, processor_id, stack_top, current_process)); + CASCADE_RESULT(SharedPtr thread, Core::System::GetInstance().Kernel().CreateThread( + name, entry_point, priority, arg, processor_id, + stack_top, current_process.get())); thread->context->SetFpscr(FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO); // 0x03C00000 @@ -1157,7 +1157,7 @@ static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32 region = current_process->flags.memory_region; shared_memory = Core::System::GetInstance().Kernel().CreateSharedMemory( - current_process, size, static_cast(my_permission), + current_process.get(), size, static_cast(my_permission), static_cast(other_permission), addr, region); CASCADE_RESULT(*out_handle, current_process->handle_table.Create(std::move(shared_memory))); diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 69680acf8..11ea54fbd 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -320,8 +320,7 @@ static void ResetThreadContext(const std::unique_ptr> KernelSystem::CreateThread(std::string name, VAddr entry_point, u32 priority, u32 arg, s32 processor_id, - VAddr stack_top, - SharedPtr owner_process) { + VAddr stack_top, Process* owner_process) { // Check if priority is in ranged. Lowest priority -> highest priority id. if (priority > ThreadPrioLowest) { LOG_ERROR(Kernel_SVC, "Invalid thread priority: {}", priority); @@ -447,7 +446,7 @@ SharedPtr SetupMainThread(KernelSystem& kernel, u32 entry_point, u32 pri // Initialize new "main" thread auto thread_res = kernel.CreateThread("main", entry_point, priority, 0, owner_process->ideal_processor, - Memory::HEAP_VADDR_END, owner_process); + Memory::HEAP_VADDR_END, owner_process.get()); SharedPtr thread = std::move(thread_res).Unwrap(); diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index bb0ab5b15..9c7dd45cc 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -189,7 +189,7 @@ public: /// Mutexes that this thread is currently waiting for. boost::container::flat_set> pending_mutexes; - SharedPtr owner_process; ///< Process that owns this thread + Process* owner_process; ///< Process that owns this thread /// Objects that the thread is waiting on, in the same order as they were // passed to WaitSynchronization1/N.