summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-10 10:34:20 -0400
committerGravatar GitHub2018-10-10 10:34:20 -0400
commit68b3d8b7a974780ff1eef3fe5764b2dd9cdb4d32 (patch)
tree1c5d3e1b178d7252cd3e752d8f2a99017a0ecb6d /src/core/hle/kernel/svc.cpp
parentMerge pull request #1461 from lioncash/warn (diff)
parentkernel/thread: Use a regular pointer for the owner/current process (diff)
downloadyuzu-68b3d8b7a974780ff1eef3fe5764b2dd9cdb4d32.tar.gz
yuzu-68b3d8b7a974780ff1eef3fe5764b2dd9cdb4d32.tar.xz
yuzu-68b3d8b7a974780ff1eef3fe5764b2dd9cdb4d32.zip
Merge pull request #1469 from lioncash/ptr
kernel/thread: Use a regular pointer for the owner/current process
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index b488b508d..3afcce3fe 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -341,7 +341,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
341 LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id, 341 LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id,
342 info_sub_id, handle); 342 info_sub_id, handle);
343 343
344 const auto& current_process = Core::CurrentProcess(); 344 const auto* current_process = Core::CurrentProcess();
345 const auto& vm_manager = current_process->VMManager(); 345 const auto& vm_manager = current_process->VMManager();
346 346
347 switch (static_cast<GetInfoType>(info_id)) { 347 switch (static_cast<GetInfoType>(info_id)) {
@@ -439,7 +439,7 @@ static ResultCode GetThreadContext(VAddr thread_context, Handle handle) {
439 return ERR_INVALID_HANDLE; 439 return ERR_INVALID_HANDLE;
440 } 440 }
441 441
442 const auto current_process = Core::CurrentProcess(); 442 const auto* current_process = Core::CurrentProcess();
443 if (thread->GetOwnerProcess() != current_process) { 443 if (thread->GetOwnerProcess() != current_process) {
444 return ERR_INVALID_HANDLE; 444 return ERR_INVALID_HANDLE;
445 } 445 }
@@ -531,7 +531,7 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s
531 return ERR_INVALID_HANDLE; 531 return ERR_INVALID_HANDLE;
532 } 532 }
533 533
534 return shared_memory->Map(Core::CurrentProcess().get(), addr, permissions_type, 534 return shared_memory->Map(Core::CurrentProcess(), addr, permissions_type,
535 MemoryPermission::DontCare); 535 MemoryPermission::DontCare);
536} 536}
537 537
@@ -550,7 +550,7 @@ static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64
550 auto& kernel = Core::System::GetInstance().Kernel(); 550 auto& kernel = Core::System::GetInstance().Kernel();
551 auto shared_memory = kernel.HandleTable().Get<SharedMemory>(shared_memory_handle); 551 auto shared_memory = kernel.HandleTable().Get<SharedMemory>(shared_memory_handle);
552 552
553 return shared_memory->Unmap(Core::CurrentProcess().get(), addr); 553 return shared_memory->Unmap(Core::CurrentProcess(), addr);
554} 554}
555 555
556/// Query process memory 556/// Query process memory
@@ -588,7 +588,7 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAdd
588 588
589/// Exits the current process 589/// Exits the current process
590static void ExitProcess() { 590static void ExitProcess() {
591 auto& current_process = Core::CurrentProcess(); 591 auto* current_process = Core::CurrentProcess();
592 592
593 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID()); 593 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID());
594 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running, 594 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running,
@@ -636,7 +636,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
636 auto& kernel = Core::System::GetInstance().Kernel(); 636 auto& kernel = Core::System::GetInstance().Kernel();
637 CASCADE_RESULT(SharedPtr<Thread> thread, 637 CASCADE_RESULT(SharedPtr<Thread> thread,
638 Thread::Create(kernel, name, entry_point, priority, arg, processor_id, stack_top, 638 Thread::Create(kernel, name, entry_point, priority, arg, processor_id, stack_top,
639 Core::CurrentProcess())); 639 *Core::CurrentProcess()));
640 const auto new_guest_handle = kernel.HandleTable().Create(thread); 640 const auto new_guest_handle = kernel.HandleTable().Create(thread);
641 if (new_guest_handle.Failed()) { 641 if (new_guest_handle.Failed()) {
642 return new_guest_handle.Code(); 642 return new_guest_handle.Code();