summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-04-01 17:28:49 -0400
committerGravatar Fernando Sahmkow2020-06-27 11:36:05 -0400
commit48fa3b7a0f2054a836b0a8061e6b082c246b5ae0 (patch)
tree37a09cfb55f13ebf2df2b9a71622c599733100b0 /src/core/hle/kernel/thread.h
parentKernel/svcBreak: Implement CacheInvalidation for Singlecore and correct svcBr... (diff)
downloadyuzu-48fa3b7a0f2054a836b0a8061e6b082c246b5ae0.tar.gz
yuzu-48fa3b7a0f2054a836b0a8061e6b082c246b5ae0.tar.xz
yuzu-48fa3b7a0f2054a836b0a8061e6b082c246b5ae0.zip
General: Cleanup legacy code.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 61963148d..3ae0df6ef 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -128,9 +128,6 @@ public:
128 128
129 using ThreadSynchronizationObjects = std::vector<std::shared_ptr<SynchronizationObject>>; 129 using ThreadSynchronizationObjects = std::vector<std::shared_ptr<SynchronizationObject>>;
130 130
131 using WakeupCallback =
132 std::function<bool(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
133 std::shared_ptr<SynchronizationObject> object, std::size_t index)>;
134 using HLECallback = std::function<bool(std::shared_ptr<Thread> thread)>; 131 using HLECallback = std::function<bool(std::shared_ptr<Thread> thread)>;
135 132
136 /** 133 /**
@@ -235,7 +232,7 @@ public:
235 } 232 }
236 233
237 /// Resumes a thread from waiting 234 /// Resumes a thread from waiting
238 void /* deprecated */ ResumeFromWait(); 235 void ResumeFromWait();
239 236
240 void OnWakeUp(); 237 void OnWakeUp();
241 238
@@ -249,27 +246,6 @@ public:
249 /// 246 ///
250 void CancelWait(); 247 void CancelWait();
251 248
252 /**
253 * Schedules an event to wake up the specified thread after the specified delay
254 * @param nanoseconds The time this thread will be allowed to sleep for
255 */
256 void /* deprecated */ WakeAfterDelay(s64 nanoseconds);
257
258 /// Cancel any outstanding wakeup events for this thread
259 void /* deprecated */ CancelWakeupTimer();
260
261 /**
262 * Sets the result after the thread awakens (from svcWaitSynchronization)
263 * @param result Value to set to the returned result
264 */
265 void /*deprecated*/ SetWaitSynchronizationResult(ResultCode result);
266
267 /**
268 * Sets the output parameter value after the thread awakens (from svcWaitSynchronization)
269 * @param output Value to set to the output parameter
270 */
271 void /*deprecated*/ SetWaitSynchronizationOutput(s32 output);
272
273 void SetSynchronizationResults(SynchronizationObject* object, ResultCode result); 249 void SetSynchronizationResults(SynchronizationObject* object, ResultCode result);
274 250
275 Core::ARM_Interface& ArmInterface(); 251 Core::ARM_Interface& ArmInterface();
@@ -330,11 +306,6 @@ public:
330 */ 306 */
331 VAddr GetCommandBufferAddress() const; 307 VAddr GetCommandBufferAddress() const;
332 308
333 /// Returns whether this thread is waiting on objects from a WaitSynchronization call.
334 bool IsSleepingOnWait() const {
335 return status == ThreadStatus::WaitSynch;
336 }
337
338 ThreadContext32& GetContext32() { 309 ThreadContext32& GetContext32() {
339 return context_32; 310 return context_32;
340 } 311 }
@@ -469,18 +440,10 @@ public:
469 arb_wait_address = address; 440 arb_wait_address = address;
470 } 441 }
471 442
472 bool HasWakeupCallback() const {
473 return wakeup_callback != nullptr;
474 }
475
476 bool HasHLECallback() const { 443 bool HasHLECallback() const {
477 return hle_callback != nullptr; 444 return hle_callback != nullptr;
478 } 445 }
479 446
480 void SetWakeupCallback(WakeupCallback callback) {
481 wakeup_callback = std::move(callback);
482 }
483
484 void SetHLECallback(HLECallback callback) { 447 void SetHLECallback(HLECallback callback) {
485 hle_callback = std::move(callback); 448 hle_callback = std::move(callback);
486 } 449 }
@@ -501,22 +464,10 @@ public:
501 return hle_object; 464 return hle_object;
502 } 465 }
503 466
504 void InvalidateWakeupCallback() {
505 SetWakeupCallback(nullptr);
506 }
507
508 void InvalidateHLECallback() { 467 void InvalidateHLECallback() {
509 SetHLECallback(nullptr); 468 SetHLECallback(nullptr);
510 } 469 }
511 470
512 /**
513 * Invokes the thread's wakeup callback.
514 *
515 * @pre A valid wakeup callback has been set. Violating this precondition
516 * will cause an assertion to trigger.
517 */
518 bool InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
519 std::shared_ptr<SynchronizationObject> object, std::size_t index);
520 bool InvokeHLECallback(std::shared_ptr<Thread> thread); 471 bool InvokeHLECallback(std::shared_ptr<Thread> thread);
521 472
522 u32 GetIdealCore() const { 473 u32 GetIdealCore() const {
@@ -698,11 +649,6 @@ private:
698 /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. 649 /// Handle used as userdata to reference this object when inserting into the CoreTiming queue.
699 Handle global_handle = 0; 650 Handle global_handle = 0;
700 651
701 /// Callback that will be invoked when the thread is resumed from a waiting state. If the thread
702 /// was waiting via WaitSynchronization then the object will be the last object that became
703 /// available. In case of a timeout, the object will be nullptr. DEPRECATED
704 WakeupCallback wakeup_callback;
705
706 /// Callback for HLE Events 652 /// Callback for HLE Events
707 HLECallback hle_callback; 653 HLECallback hle_callback;
708 Handle hle_time_event; 654 Handle hle_time_event;