Commit graph

118 commits

Author SHA1 Message Date
Subv
2d06628c52 NV: Implemented (with stubs) the vi:m service and some of its subservices.
The homebrew display test application now properly writes graphics data to the graphics buffer but we still don't have a way to compose the display layers.
2018-01-10 23:28:09 -05:00
bunnei
9d04a45a90 kernel: Fix implementation of ConvertSessionToDomain. 2017-12-29 00:36:22 -05:00
bunnei
26495098a9 service: Add empty interface for pctl:a. 2017-12-28 23:44:39 -05:00
bunnei
6d0751cd00 service: Halt on ReportUnimplementedFunction and improve output log. 2017-12-28 15:24:59 -05:00
bunnei
f9d160c819 service: Add empty interface for aoc:u. 2017-12-28 15:24:05 -05:00
bunnei
1edc9cc327 service: Return proper result code for IPC::CommandType::Close. 2017-10-31 19:30:05 -04:00
bunnei
c6a1d24720 service: Add CreatePort function (that does not register/install). 2017-10-18 21:34:19 -04:00
bunnei
c40bfc606d service: Print correct command ID on unimplemented function. 2017-10-17 18:02:08 -04:00
bunnei
be299c7636 hle: Implement ConvertSessionToDomain, various cleanups. 2017-10-15 01:24:22 -04:00
bunnei
9ce5a90aa6 hle: Add service stubs for apm and appletOE. 2017-10-14 22:50:04 -04:00
bunnei
2ea8867549 hle: Initial implementation of NX service framework and IPC. 2017-10-14 22:18:42 -04:00
bunnei
877d4c71d3 Remove more 3DS-specific code. 2017-10-12 21:45:06 -04:00
bunnei
e36d959e34 Remove more 3DS-specific code. 2017-10-12 21:29:53 -04:00
bunnei
dd4ffef0a2 hle: Remove a large amount of 3ds-specific service code. 2017-10-10 17:32:14 -04:00
Subv
891916efff Services/NS: Port ns:s to the new service framework. 2017-09-16 10:52:45 -05:00
Yuri Kunde Schlesner
03964e9cd2 Merge pull request #2790 from yuriks/remove-movefrom
Remove ResultVal::MoveFrom
2017-06-20 22:04:09 -07:00
Yuri Kunde Schlesner
c27dad4cd1 ResultVal: Remove MoveFrom()
Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in
case you already have an rvalue.
2017-06-18 19:03:15 -07:00
Yuri Kunde Schlesner
6382e341f8 Kernel/IPC: Make HLERequestContext usable from outside kernel 2017-06-18 16:05:12 -07:00
Yuri Kunde Schlesner
e639024013 Kernel: Basic support for IPC translation for HLE services 2017-06-11 13:10:21 -07:00
Yuri Kunde Schlesner
1e8c1ed676 ServiceFramework: Use separate copy of command buffer
Copy the IPC command buffer to/from the request context before/after the
handler is invoked. This is part of a move away from using global data
for handling IPC requests.
2017-06-11 13:07:33 -07:00
Yuri Kunde Schlesner
211fea5441 Service/sm: Convert 'srv:' to ServiceFramework 2017-06-08 20:59:19 -07:00
Yuri Kunde Schlesner
147ec9e842 Service: Remove a few redundant namespace qualifiers 2017-06-08 00:11:37 -07:00
Yuri Kunde Schlesner
0a7f4f531f Service: Add new ServiceFramework framework for writing HLE services
The old "Interface" class had a few problems such as using free
functions (Which didn't allow you to write the service handler as if it
were a regular class.) which weren't very extensible. (Only received one
parameter with a pointer to the Interface object.)

The new ServiceFramework aims to solve these problems by working with
member functions and passing a generic context struct as parameter. This
struct can be extended in the future without having to update all
existing service implementations.
2017-06-08 00:11:37 -07:00
Yuri Kunde Schlesner
f68fd997cd Service: Remove unnecessary includes from service.h
This has a huge fallout in terms of needing to fix other files because
all service implementations included that file.
2017-06-06 02:57:23 -07:00
Yuri Kunde Schlesner
0e3e091a0d Service: Make service registration part of the sm implementation
Also enhances the GetServiceHandle implementation to be more accurate.
2017-06-06 02:57:04 -07:00
Yuri Kunde Schlesner
c17330e05f Service: Move SRV interface to a new sm/ subdirectory
This will contain the implementation of the sm (Service Manager) system
module.
2017-06-06 02:57:04 -07:00
Yuri Kunde Schlesner
8a35f3634e 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
41a3feea66 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
bunnei
d71a04381c Merge pull request #2308 from mailwl/ac-i
Service/AC: add ac:i service
2017-01-12 10:12:46 -05:00
mailwl
45b03ee367 Service/NFC: stub GetTagInRangeEvent
Fix Fatal Error in Mini-Mario & Friends - amiibo Challenge
2016-12-30 09:40:54 +03:00
mailwl
d5ca5dd75e Service/AC: add ac:i service 2016-12-30 09:20:11 +03:00
mailwl
3a05b161bc Service/NWM: add nwm services 2016-12-22 22:51:27 +03:00
bunnei
338e24ae80 Merge pull request #2314 from mailwl/account
Service/ACT: move ACT services to folder
2016-12-15 13:51:29 -05:00
Yuri Kunde Schlesner
c99b5e3122 Merge pull request #2249 from Subv/sessions_v3
Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.
2016-12-14 20:35:33 -08:00
Subv
3e80a1a1c1 Fixed the codestyle to match our clang-format rules. 2016-12-14 12:45:36 -05:00
mailwl
11e9681df2 Service/ACT: move ACT services to folder 2016-12-14 09:05:46 +03:00
Lioncash
b0ebdfae34 Add all services to the Service namespace
Previously there was a split where some of the services were in the
Service namespace and others were not.
2016-12-11 00:07:27 +00:00
Subv
6df6ad46c4 Moved the HLE command buffer translation task to ServerSession instead of the HLE handler superclass. 2016-12-09 12:52:12 -05:00
Subv
79f53e6daa Kernel/IPC: Small codestyle cleanup 2016-12-09 12:39:12 -05:00
Subv
17d8d69c6e 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
021e732815 Use std::move where appropriate. 2016-12-08 11:06:19 -05:00
Lioncash
c7a1fc1d0a service: Add mvd and qtm services
Adds the two New3DS-only modules.

3dbrew was used for command information.
2016-12-08 04:34:03 -05:00
Lioncash
c74ecaaa85 service: Add nfc services
3dbrew was used for the command information.
2016-12-08 03:24:41 -05:00
Subv
708ece3fff 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
977039e722 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
4f2326c8a9 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
d2305d375f 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
edcacd7cdd 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
302ef594a6 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
fa5d9d8266 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00