summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar Subv2018-04-20 12:01:14 -0500
committerGravatar Subv2018-04-20 21:04:25 -0500
commite81a2080ebf9712231dd29c081141780ffd46cfb (patch)
treeb93d23dde3c3a0e86edeb44a1c1f1e18ac839bd6 /src/core/hle/kernel/thread.h
parentMerge pull request #367 from lioncash/clamp (diff)
downloadyuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.gz
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.xz
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.zip
Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock.
Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case. Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock. TODO: * Fix svcWaitProcessWideKey * Fix svcSignalProcessWideKey * Remove the Mutex class.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index dbf47e269..a3a6e6a64 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -43,6 +43,7 @@ enum ThreadStatus {
43 THREADSTATUS_WAIT_IPC, ///< Waiting for the reply from an IPC request 43 THREADSTATUS_WAIT_IPC, ///< Waiting for the reply from an IPC request
44 THREADSTATUS_WAIT_SYNCH_ANY, ///< Waiting due to WaitSynch1 or WaitSynchN with wait_all = false 44 THREADSTATUS_WAIT_SYNCH_ANY, ///< Waiting due to WaitSynch1 or WaitSynchN with wait_all = false
45 THREADSTATUS_WAIT_SYNCH_ALL, ///< Waiting due to WaitSynchronizationN with wait_all = true 45 THREADSTATUS_WAIT_SYNCH_ALL, ///< Waiting due to WaitSynchronizationN with wait_all = true
46 THREADSTATUS_WAIT_MUTEX, ///< Waiting due to an ArbitrateLock/WaitProcessWideKey svc
46 THREADSTATUS_DORMANT, ///< Created but not yet made ready 47 THREADSTATUS_DORMANT, ///< Created but not yet made ready
47 THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated 48 THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated
48}; 49};
@@ -217,7 +218,10 @@ public:
217 // passed to WaitSynchronization1/N. 218 // passed to WaitSynchronization1/N.
218 std::vector<SharedPtr<WaitObject>> wait_objects; 219 std::vector<SharedPtr<WaitObject>> wait_objects;
219 220
220 VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address 221 // If waiting on a ConditionVariable, this is the ConditionVariable address
222 VAddr condvar_wait_address;
223 VAddr mutex_wait_address; ///< If waiting on a Mutex, this is the mutex address
224 Handle wait_handle; ///< The handle used to wait for the mutex.
221 225
222 std::string name; 226 std::string name;
223 227