Commit graph

21 commits

Author SHA1 Message Date
James Rowe
f61141e86a Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
Subv
06a2e0b591 Kernel/Sessions: Wake up any threads waiting on a ServerSession when its client is closed
The error code 0xC920181A will be returned by svcReplyAndReceive when the wakeup callback runs.
This lets LLE services be properly notified of clients closing the connection so they can end their handler threads instead of letting them linger indefinitely, taking up connection slots in their parent port.
2017-11-06 23:07:08 -05:00
Subv
b53fa9514f Kernel/SVC: Pass the current thread as a parameter to ClientSession::SendSyncRequest. 2017-06-29 12:30:34 -05:00
Subv
c3c9175a1c Kernel/Sessions: Clean up the list of pending request threads of a session when the client endpoint is closed. 2017-06-25 23:38:29 -05:00
Subv
8feeb81af2 Kernel/ServerSession: Keep track of which threads have issued sync requests. 2017-06-25 14:47:25 -05:00
Yuri Kunde Schlesner
838faf147e Session: Remove/add some forward declarations 2017-06-08 00:33:57 -07:00
Yuri Kunde Schlesner
d666e01cdf Kernel: Ensure objects are kept alive during ClientSession disconnection
Fixes #2760
2017-06-08 00:33:24 -07:00
Yuri Kunde Schlesner
e626a520ca HLE: Move SessionRequestHandler from Service:: to Kernel::
Most of the code that works with this is or will be in the kernel, so
it's a more appropriate place for it to be.
2017-06-05 23:40:11 -07:00
Yuri Kunde Schlesner
2cdb40d709 Kernel: Centralize error definitions in errors.h 2017-05-24 21:06:00 -07:00
Subv
37347bfa38 Kernel/Sessions: Remove the ClientSession::Create function.
It is not meant to be used by anything other than CreateSessionPair.
2017-05-21 18:52:42 -05:00
Subv
ce5bc477ca Kernel: Remove a now unused enum and variable regarding a session's status. 2017-05-15 11:22:16 -05:00
Subv
ddfabf3133 Kernel: Use a Session object to keep track of the status of a Client/Server session pair.
Reduce the associated port's connection count when a ServerSession is destroyed.
2017-05-15 11:22:15 -05:00
Subv
016307ae65 Fixed the codestyle to match our clang-format rules. 2016-12-14 12:45:36 -05:00
Subv
386112da32 Added a framework for partially handling Session disconnections.
Further implementation will happen in a future commit.

Fixes a regression.
2016-12-08 15:01:10 -05:00
Subv
f9bcf89510 Use std::move where appropriate. 2016-12-08 11:06:19 -05:00
Subv
dd8887c8cf KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it. 2016-12-05 11:02:08 -05:00
Subv
2ce61344d6 Declare empty ServerSession and ClientSession constructors as default. 2016-12-02 22:58:02 -05:00
Subv
2eceee3a4c Fixed the rebase mistakes. 2016-11-30 23:28:31 -05:00
Subv
009b15b3aa A bit of a redesign.
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.
2016-11-30 23:12:35 -05:00
Subv
c5e7e0fa26 IPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists.
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
2016-11-30 23:04:00 -05:00
Subv
073653e858 Kernel/IPC: Use Ports and Sessions as the fundamental building block of 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.
2016-11-30 23:02:05 -05:00