Commit Graph

31 Commits

Author SHA1 Message Date
b0df09335c service/sm: Take std::string by const reference in UnregisterService
Avoids the need to create a copy of the std::string instance
(potentially allocating).

The only reason RegisterService takes its argument by value is because
it's std::moved internally.
2018-11-24 00:08:13 -05:00
0080a8da58 sm: Implement RegisterService and UnregisterService
These are needed by Edizon to boot. They are used to see if a user is using SX OS, as SX OS registers a custom service called 'tx' and attempting to register a service of the same name lets the application know if it is present.
2018-11-03 20:02:18 -04:00
6a0612f2bf Removed the use of rp.MakeBuilder
Due to keeping the code style consistent in the yuzu codebase. `rb = rp.MakeBuilder(...)` was replaced with `rb{ctx, ...}`
2018-09-19 15:09:59 +10:00
da64da367b services/sm: Amend error code constants
Courtesy of @ogniK5377.

This also moves them into the cpp file and limits the visibility to
where they're directly used. It also gets rid of unused or duplicate
error codes.
2018-09-14 01:44:02 -04:00
56ab608044 core/core: Remove unnecessary sm/controller include
The only reason this include was necessary, was because the constructor
wasn't defaulted in the cpp file and the compiler would inline it
wherever it was used. However, given Controller is forward declared, all
those inlined constructors would see an incomplete type, causing a
compilation failure. So, we just place the constructor in the cpp file,
where it can see the complete type definition, allowing us to remove
this include.
2018-09-06 14:38:39 -04:00
0cbcd6ec9a kernel: Eliminate kernel global state
As means to pave the way for getting rid of global state within core,
This eliminates kernel global state by removing all globals. Instead
this introduces a KernelCore class which acts as a kernel instance. This
instance lives in the System class, which keeps its lifetime contained
to the lifetime of the System class.

This also forces the kernel types to actually interact with the main
kernel instance itself instead of having transient kernel state placed
all over several translation units, keeping everything together. It also
has a nice consequence of making dependencies much more explicit.

This also makes our initialization a tad bit more correct. Previously we
were creating a kernel process before the actual kernel was initialized,
which doesn't really make much sense.

The KernelCore class itself follows the PImpl idiom, which allows
keeping all the implementation details sealed away from everything else,
which forces the use of the exposed API and allows us to avoid any
unnecessary inclusions within the main kernel header.
2018-08-28 22:31:51 -04:00
0d46f0df12 Update clang format 2018-07-02 21:45:47 -04:00
638956aa81 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
7c9644646f general: Make formatting of logged hex values more straightforward
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
2018-05-02 09:49:36 -04:00
2a3f3bf977 sm: Move logging macros over to new fmt-compatible ones 2018-04-24 12:01:31 -04:00
659a612368 core: Relocate g_service_manager to the System class
Converts the service manager from a global into an instance-based
variable.
2018-04-20 19:44:32 -04:00
ccca5e7c28 service: Use nested namespace specifiers where applicable
Tidies up namespace declarations
2018-04-19 22:20:28 -04:00
22bc951d7e Dont call UNIMPLEMENTED for 'empty services', just return error code 2018-02-05 02:03:22 -08:00
714a576113 ResponseBuilder: Use a bit field for customizing instead of always_move_handles. 2018-01-24 22:24:20 -05:00
1b1d399e5f hle: Rename RequestBuilder to ResponseBuilder. 2018-01-24 22:24:10 -05:00
f9dae99006 service: Fix all incorrect IPC response headers. 2018-01-24 22:21:33 -05:00
0b6da0c1ab Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113)
* Added svcCreateSharedMemory

* Services which are not implemented now throw UNIMPLEMENTED()

* clang-format

* changed perms to u32

* removed camelcase
2018-01-19 19:35:25 -05:00
1247c53786 yuzu: Update license text to be consistent across project. 2018-01-13 16:22:39 -05:00
ba2ffd7b81 IPC: Take the number of domain objects as a parameter in MakeBuilder. 2018-01-07 17:11:58 -05:00
5f41477f9c SM: Fixed connecting to services with an 8-byte name, like appletOE. 2018-01-07 17:11:56 -05:00
80f6df5414 IPC: Fixed pushing ResultCodes into the command buffer.
They should have 32 bits of padding after the error code now.
2018-01-07 17:11:54 -05:00
0368324f79 IPC Cleanup: Remove 3DS-specific code and translate copy, move and domain objects in IPC requests.
Popping objects from the buffer is still not implemented.
2018-01-07 17:11:47 -05:00
b0ceb4df70 IPC: Skip the entire u64 of the command id when receiving an IPC request.
Service code now doesn't have to deal with this.
2018-01-07 17:11:45 -05:00
ad073846bc service: Clean up apm/lm/applet_oe/controller/sm ctor/dtor. 2017-12-28 15:27:30 -05:00
4fb1b24d68 hle: Implement ConvertSessionToDomain, various cleanups. 2017-10-15 01:24:22 -04:00
72eeca1f03 hle: Add service stubs for apm and appletOE. 2017-10-14 22:50:04 -04:00
960a1416de hle: Initial implementation of NX service framework and IPC. 2017-10-14 22:18:42 -04:00
0b33e36292 HLE/SRV: Implemented RegisterService.
Now system modules can do more than just crash immediately on startup.
2017-09-24 00:12:58 -05:00
6f368abe13 Service/sm: Convert 'srv:' to ServiceFramework 2017-06-08 20:59:19 -07:00
d96a9e0c11 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
23ec6b3d8f 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