summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-02-26 18:55:11 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:35:16 -0400
commit5b6a67f849d0d78d6f71ccb7d93f48a97760a901 (patch)
tree36c1b5b4481bd1486e0e25a2656001f831298d51 /src/core/hle/kernel/svc.cpp
parentCPU_Manager: Reconfigre guest threads for dynamrmic downsides (diff)
downloadyuzu-5b6a67f849d0d78d6f71ccb7d93f48a97760a901.tar.gz
yuzu-5b6a67f849d0d78d6f71ccb7d93f48a97760a901.tar.xz
yuzu-5b6a67f849d0d78d6f71ccb7d93f48a97760a901.zip
SVC: Cleanup old methods.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 768d72b92..8634d3feb 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -622,7 +622,6 @@ static void Break(Core::System& system, u32 reason, u64 info1, u64 info2) {
622 622
623 // Kill the current thread 623 // Kill the current thread
624 current_thread->Stop(); 624 current_thread->Stop();
625 system.PrepareReschedule();
626 } 625 }
627} 626}
628 627
@@ -1004,6 +1003,7 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size
1004/// Sets the thread activity 1003/// Sets the thread activity
1005static ResultCode SetThreadActivity(Core::System& system, Handle handle, u32 activity) { 1004static ResultCode SetThreadActivity(Core::System& system, Handle handle, u32 activity) {
1006 LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, activity=0x{:08X}", handle, activity); 1005 LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, activity=0x{:08X}", handle, activity);
1006 UNIMPLEMENTED();
1007 if (activity > static_cast<u32>(ThreadActivity::Paused)) { 1007 if (activity > static_cast<u32>(ThreadActivity::Paused)) {
1008 return ERR_INVALID_ENUM_VALUE; 1008 return ERR_INVALID_ENUM_VALUE;
1009 } 1009 }
@@ -1032,7 +1032,6 @@ static ResultCode SetThreadActivity(Core::System& system, Handle handle, u32 act
1032 1032
1033 thread->SetActivity(static_cast<ThreadActivity>(activity)); 1033 thread->SetActivity(static_cast<ThreadActivity>(activity));
1034 1034
1035 system.PrepareReschedule(thread->GetProcessorID());
1036 return RESULT_SUCCESS; 1035 return RESULT_SUCCESS;
1037} 1036}
1038 1037
@@ -1385,6 +1384,7 @@ static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_ha
1385/// Exits the current process 1384/// Exits the current process
1386static void ExitProcess(Core::System& system) { 1385static void ExitProcess(Core::System& system) {
1387 auto* current_process = system.Kernel().CurrentProcess(); 1386 auto* current_process = system.Kernel().CurrentProcess();
1387 UNIMPLEMENTED();
1388 1388
1389 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID()); 1389 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID());
1390 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running, 1390 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running,
@@ -1394,8 +1394,6 @@ static void ExitProcess(Core::System& system) {
1394 1394
1395 // Kill the current thread 1395 // Kill the current thread
1396 system.CurrentScheduler().GetCurrentThread()->Stop(); 1396 system.CurrentScheduler().GetCurrentThread()->Stop();
1397
1398 system.PrepareReschedule();
1399} 1397}
1400 1398
1401/// Creates a new thread 1399/// Creates a new thread
@@ -1458,8 +1456,6 @@ static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr e
1458 thread->SetName( 1456 thread->SetName(
1459 fmt::format("thread[entry_point={:X}, handle={:X}]", entry_point, *new_thread_handle)); 1457 fmt::format("thread[entry_point={:X}, handle={:X}]", entry_point, *new_thread_handle));
1460 1458
1461 system.PrepareReschedule(thread->GetProcessorID());
1462
1463 return RESULT_SUCCESS; 1459 return RESULT_SUCCESS;
1464} 1460}
1465 1461
@@ -1545,6 +1541,8 @@ static ResultCode WaitProcessWideKeyAtomic(Core::System& system, VAddr mutex_add
1545 return ERR_INVALID_ADDRESS; 1541 return ERR_INVALID_ADDRESS;
1546 } 1542 }
1547 1543
1544 UNIMPLEMENTED();
1545
1548 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4)); 1546 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4));
1549 1547
1550 auto* const current_process = system.Kernel().CurrentProcess(); 1548 auto* const current_process = system.Kernel().CurrentProcess();
@@ -1569,7 +1567,6 @@ static ResultCode WaitProcessWideKeyAtomic(Core::System& system, VAddr mutex_add
1569 1567
1570 // Note: Deliberately don't attempt to inherit the lock owner's priority. 1568 // Note: Deliberately don't attempt to inherit the lock owner's priority.
1571 1569
1572 system.PrepareReschedule(current_thread->GetProcessorID());
1573 return RESULT_SUCCESS; 1570 return RESULT_SUCCESS;
1574} 1571}
1575 1572
@@ -1580,6 +1577,8 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1580 1577
1581 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4)); 1578 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4));
1582 1579
1580 UNIMPLEMENTED();
1581
1583 // Retrieve a list of all threads that are waiting for this condition variable. 1582 // Retrieve a list of all threads that are waiting for this condition variable.
1584 auto* const current_process = system.Kernel().CurrentProcess(); 1583 auto* const current_process = system.Kernel().CurrentProcess();
1585 std::vector<std::shared_ptr<Thread>> waiting_threads = 1584 std::vector<std::shared_ptr<Thread>> waiting_threads =
@@ -1634,7 +1633,6 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1634 thread->SetMutexWaitAddress(0); 1633 thread->SetMutexWaitAddress(0);
1635 thread->SetWaitHandle(0); 1634 thread->SetWaitHandle(0);
1636 thread->SetWaitSynchronizationResult(RESULT_SUCCESS); 1635 thread->SetWaitSynchronizationResult(RESULT_SUCCESS);
1637 system.PrepareReschedule(thread->GetProcessorID());
1638 } else { 1636 } else {
1639 // The mutex is already owned by some other thread, make this thread wait on it. 1637 // The mutex is already owned by some other thread, make this thread wait on it.
1640 const Handle owner_handle = static_cast<Handle>(mutex_val & Mutex::MutexOwnerMask); 1638 const Handle owner_handle = static_cast<Handle>(mutex_val & Mutex::MutexOwnerMask);
@@ -1646,7 +1644,6 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1646 thread->SetStatus(ThreadStatus::WaitMutex); 1644 thread->SetStatus(ThreadStatus::WaitMutex);
1647 1645
1648 owner->AddMutexWaiter(thread); 1646 owner->AddMutexWaiter(thread);
1649 system.PrepareReschedule(thread->GetProcessorID());
1650 } 1647 }
1651 } 1648 }
1652} 1649}
@@ -1661,6 +1658,7 @@ static ResultCode WaitForAddress(Core::System& system, VAddr address, u32 type,
1661 LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}", address, 1658 LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}", address,
1662 type, value, timeout); 1659 type, value, timeout);
1663 1660
1661 UNIMPLEMENTED();
1664 // If the passed address is a kernel virtual address, return invalid memory state. 1662 // If the passed address is a kernel virtual address, return invalid memory state.
1665 if (Core::Memory::IsKernelVirtualAddress(address)) { 1663 if (Core::Memory::IsKernelVirtualAddress(address)) {
1666 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address, address={:016X}", address); 1664 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address, address={:016X}", address);
@@ -1677,9 +1675,6 @@ static ResultCode WaitForAddress(Core::System& system, VAddr address, u32 type,
1677 auto& address_arbiter = system.Kernel().CurrentProcess()->GetAddressArbiter(); 1675 auto& address_arbiter = system.Kernel().CurrentProcess()->GetAddressArbiter();
1678 const ResultCode result = 1676 const ResultCode result =
1679 address_arbiter.WaitForAddress(address, arbitration_type, value, timeout); 1677 address_arbiter.WaitForAddress(address, arbitration_type, value, timeout);
1680 if (result == RESULT_SUCCESS) {
1681 system.PrepareReschedule();
1682 }
1683 return result; 1678 return result;
1684} 1679}
1685 1680
@@ -1689,6 +1684,8 @@ static ResultCode SignalToAddress(Core::System& system, VAddr address, u32 type,
1689 LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}", 1684 LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}",
1690 address, type, value, num_to_wake); 1685 address, type, value, num_to_wake);
1691 1686
1687 UNIMPLEMENTED();
1688
1692 // If the passed address is a kernel virtual address, return invalid memory state. 1689 // If the passed address is a kernel virtual address, return invalid memory state.
1693 if (Core::Memory::IsKernelVirtualAddress(address)) { 1690 if (Core::Memory::IsKernelVirtualAddress(address)) {
1694 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address, address={:016X}", address); 1691 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address, address={:016X}", address);
@@ -1945,7 +1942,6 @@ static ResultCode SignalEvent(Core::System& system, Handle handle) {
1945 } 1942 }
1946 1943
1947 writable_event->Signal(); 1944 writable_event->Signal();
1948 system.PrepareReschedule();
1949 return RESULT_SUCCESS; 1945 return RESULT_SUCCESS;
1950} 1946}
1951 1947