| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
Kernel/SVC: Partially implemented svcReplyAndReceive
|
|
ClientSession::SendSyncRequest.
|
|
It behaves mostly as WaitSynchronizationN with wait_all = false, except for IPC buffer translation.
The target thread of an IPC response will now wake up when responding.
IPC buffer translation is currently not implemented.
Error passing back to svcSendSyncRequest is currently not implemented.
|
|
|
|
|
|
|
|
|
|
Now that HandleTable doesn't directly depend on WaitObject anymore, this
can be separated from the main kernel.h header.
|
|
This isn't necessary anymore since plain Get works correctly for
WaitObjects.
|
|
|
|
This was now mostly unused except by thread creation, which used a
symbol of the entrypoint, if available, to name the thread.
|
|
|
|
|
|
|
|
creating a thread and remove the priority clamping code.
|
|
priority clamping code from Thread::SetPriority.
|
|
Don't yield execution in SleepThread(0) if there are no available threads to run
|
|
Closes #2400
|
|
available threads to run.
With this we avoid an useless temporary deschedule of the current thread.
|
|
the objects that a thread is waiting on.
|
|
WaitSynchronization1 and WaitSynchronizationN with wait_all = true.
This commit removes the overly general THREADSTATUS_WAIT_SYNCH and replaces it with two more granular statuses:
THREADSTATUS_WAIT_SYNCH_ANY when a thread waits on objects via WaitSynchronization1 or WaitSynchronizationN with wait_all = false.
THREADSTATUS_WAIT_SYNCH_ALL when a thread waits on objects via WaitSynchronizationN with wait_all = true.
|
|
the priority via mutexes
|
|
|
|
The implementation is based on reverse engineering of the 3DS's kernel.
A mutex holder's priority will be temporarily boosted to the best priority among any threads that want to acquire any of its held mutexes.
When the holder releases the mutex, it's priority will be boosted to the best priority among the threads that want to acquire any of its remaining held mutexes.
|
|
This will be useful when implementing mutex priority inheritance.
|
|
Not all syscalls should cause reschedules, this commit attempts to remedy that, however, it still does not cover all cases.
|
|
|
|
|
|
|
|
|
|
|
|
Threading: Reworked the way our scheduler works.
|
|
|
|
|
|
by a timeout.
|
|
Define a variable with the value of the sync timeout error code.
Use a boost::flat_map instead of an unordered_map to hold the equivalence of objects and wait indices in a WaitSynchN call.
|
|
|
|
The error code was taken from the 3DS kernel.
|
|
ServerSessions created from it.
|
|
|
|
Threads will now be awakened when the objects they're waiting on are signaled, instead of repeating the WaitSynchronization call every now and then.
The scheduler is now called once after every SVC call, and once after a thread is awakened from sleep by its timeout callback.
This new implementation is based off reverse-engineering of the real kernel.
See https://gist.github.com/Subv/02f29bd9f1e5deb7aceea1e8f019c8f4 for a more detailed description of how the real kernel handles rescheduling.
|
|
returning from a ConnectToPort or GetServiceHandle call.
|
|
Sessions and Ports are now detached from each other.
HLE services are handled by means of a SessionRequestHandler class, Interface now inherits from this class.
The File and Directory classes are no longer kernel objects, but SessionRequestHandlers instead, bound to a ServerSession when requested.
File::OpenLinkFile now creates a new session pair and binds the File instance to it.
|
|
Inter Process Communication.
All handles obtained via srv::GetServiceHandle or svcConnectToPort are references to ClientSessions.
Service modules will wait on the counterpart of those ClientSessions (Called ServerSessions) using svcReplyAndReceive or svcWaitSynchronization[1|N], and will be awoken when a SyncRequest is performed.
HLE Interfaces are now ClientPorts which override the HandleSyncRequest virtual member function to perform command handling immediately.
|
|
|
|
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|