Commit graph

35 commits

Author SHA1 Message Date
Hamish Milne
7b846ffa98 clang-format fixes 2020-02-13 17:39:15 +08:00
Hamish Milne
6917eaf53b Use load_construct_data for kernel objects 2020-02-13 17:38:25 +08:00
Hamish Milne
3e752002c4 Replace g_kernel with Core::Global etc. 2020-02-13 17:38:21 +08:00
Hamish Milne
06891d9454 Added client/server objects 2020-02-13 17:38:16 +08:00
Hamish Milne
f79c9668a3 Added shader state; WIP kernel objects 2020-02-13 17:38:10 +08:00
Weiyi Wang
6ee908dc84 kernel: silence -Wreorder 2019-07-14 14:44:17 -04:00
Lioncash
42535468c3 kernel/server_session: Return a std::pair from CreateSessionPair()
Keeps the return type consistent with the function name. While we're at
it, we can also reduce the amount of boilerplate involved with handling
these by using structured bindings.
2019-04-15 21:46:57 +02:00
Weiyi Wang
5f11c5f733 Kernel: replace boost::intrusive_ptr with std::shared_ptr 2019-03-24 14:32:11 -04:00
Weiyi Wang
751ebe55e9 Kernel: pass ref down to Object and wrap ID counter into kernel state 2018-10-18 21:41:36 -04:00
Weiyi Wang
13c26b4371 Kernel: pass ref to session pair 2018-10-18 21:41:36 -04:00
Weiyi Wang
1213a298df Kernel: pass ref to port 2018-10-18 21:41:36 -04:00
Merry
9b9227089b
Merge pull request #4121 from FearlessTobi/port-894
Port #894 from yuzu: "kernel: Move object class to its own source files"
2018-08-26 00:02:33 +01:00
zhaowenlan1779
75927ee462 Port "client_port: Make all data members private" from yuzu (#4064)
* client_port: Make all data members private

These members don't need to be entirely exposed, we can instead expose
an API to operate on them without directly needing to mutate them

We can also guard against overflow/API misuse this way as well, given
active_sessions is an unsigned value.

* make the condition an assert
2018-08-24 19:31:20 +02:00
Lioncash
63c7b44ba8 kernel: Move object class to its own source files
General moving to keep kernel object types separate from the direct
kernel code. Also essentially a preliminary cleanup before eliminating
global kernel state in the kernel code.
2018-08-23 17:31:59 +02:00
James Rowe
f61141e86a Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
Yuri Kunde Schlesner
6354d08359 Kernel: Add a dedicated SetHleHandler method to ServerPort/ServerSession
This allows attaching a HLE handle to a ServerPort at any point after it
is created, allowing port/session creation to be generic between HLE and
regular services.
2017-06-06 02:56:32 -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
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
c93c5a72bb Return an error code when connecting to a saturated port.
The error code was taken from the 3DS kernel.
2016-12-05 13:59:57 -05:00
Subv
00f0c77570 Split SessionRequestHandler::HandleSyncRequest into HandleSyncRequest, TranslateRequest and HandleSyncRequestImpl.
HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services.
2016-12-05 12:05:00 -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
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
c19afd2118 Kernel/HLE: Service::Interface no longer inherits from any Kernel object, and is now its own standalone class.
Interface is now used by aggregation in ClientPort, to forward service commands to their HLE implementation if needed.
2016-11-30 23:03:59 -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
Yuri Kunde Schlesner
84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot
ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner
396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot
dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Subv
3d9fbffbab Kernel: Added ClientPort and ServerPort classes.
This is part of an ongoing effort to implement support for multiple processes.
2016-06-05 09:35:31 -05:00