You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current scheduling behavior when performing syscalls is to always attempt a reschedule, which is wrong and probably breaks some things.
The correct (although perhaps incomplete) rescheduling behavior is documented here.
This issue is a running TODO list of what's implemented and what is not.
Rescheduling
Cases when a reschedule attempt happens:
After a call to svcExitThread.
After a call to svcSleepThread.
After a KThread is awakened by a timeout interrupt (WaitSynch timeout, Sleep timeout).
In a WaitSynchronization1 call if the given timeout is greater than 0 and the thread has to wait for the object.
In a WaitSynchronizationN call if the given timeout is greater than 0 and the thread has to wait for the objects.
After a SyncRequest to a KClientSession.
After a thread resumes from wait due to a KObject signal.
After svcCreateThread.
After svcSetThreadPriority.
After svcReleaseMutex if the mutex lock count reached 0.
After a KThread is destroyed and at least one thread was waiting for it.
At the end of each SVC if the thread is marked for termination (via calling svcTerminateProcess on its parent process)
At the end of each SVC if the thread's owner process has a KDebug event associated with it.
After a call to svcExitProcess.
After a call to svcTerminateProcess.
After a KProcess is destroyed and at least one thread was waiting for it.
After a call to svcSetResourceLimit values with resource type = CPU_TIME (9) and resource value < 0x5A.
After a call to svcReplyAndReceive to reply to a KServerSession.
After a KClientSession is closed. This also causes any waiting threads to awake with an error code.
After a KServerSession is closed. This also causes any waiting threads to awake with an error code.
From here on, everything should be re-verified.
TODO: Some magic related to AddressArbiters.
TODO: Some magic related to memory mappings (svcControlMemory, some cache cleaning ops also cause a reschedule?).
TODO: After a DMA transfer?
TODO: After svcMapProcessMemory?
TODO: After svcUnmapProcessMemory?
The text was updated successfully, but these errors were encountered:
Our current scheduling behavior when performing syscalls is to always attempt a reschedule, which is wrong and probably breaks some things.
The correct (although perhaps incomplete) rescheduling behavior is documented here.
This issue is a running TODO list of what's implemented and what is not.
Rescheduling
Cases when a reschedule attempt happens:
After a call to svcExitThread.
After a call to svcSleepThread.
After a KThread is awakened by a timeout interrupt (WaitSynch timeout, Sleep timeout).
In a WaitSynchronization1 call if the given timeout is greater than 0 and the thread has to wait for the object.
In a WaitSynchronizationN call if the given timeout is greater than 0 and the thread has to wait for the objects.
After a SyncRequest to a KClientSession.
After a thread resumes from wait due to a KObject signal.
After svcCreateThread.
After svcSetThreadPriority.
After svcReleaseMutex if the mutex lock count reached 0.
After a KThread is destroyed and at least one thread was waiting for it.
At the end of each SVC if the thread is marked for termination (via calling svcTerminateProcess on its parent process)
At the end of each SVC if the thread's owner process has a KDebug event associated with it.
After a call to svcExitProcess.
After a call to svcTerminateProcess.
After a KProcess is destroyed and at least one thread was waiting for it.
After a call to svcSetResourceLimit values with resource type = CPU_TIME (9) and resource value < 0x5A.
After a call to svcReplyAndReceive to reply to a KServerSession.
After a KClientSession is closed. This also causes any waiting threads to awake with an error code.
After a KServerSession is closed. This also causes any waiting threads to awake with an error code.
From here on, everything should be re-verified.
The text was updated successfully, but these errors were encountered: