Commit graph

37 commits

Author SHA1 Message Date
bunnei
5cb0f276fe kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects.

- See https://github.com/citra-emu/citra/pull/4710 for details.
2019-11-24 20:15:51 -05:00
Lioncash
479a873d97 service/sm: Improve debug log for RegisterService
Now it also indicates the name and max session count. This also gives a
name to the unknown bool. This indicates if the created port is supposed
to be using light handles or regular handles internally. This is passed
to the respective svcCreatePort parameter internally.
2018-12-18 18:22:22 -05:00
Lioncash
129d373b58 hle/service, hle/sm: Compress usages of MakeResult()
These auto-deduce the result based off its arguments, so there's no need
to do that work for the compiler, plus, the function return value itself
already indicates what we're returning.
2018-12-06 01:33:22 -05:00
Lioncash
e3fdcaadc1 hle/service, hle/sm: Use structured bindings where applicable
Gets rid of the need to keep the variables separate from their actual
initialization spots.
2018-12-06 01:31:26 -05:00
bunnei
aa55b8925e Merge pull request #1801 from ogniK5377/log-before-execute
Changed logging to be "Log before execution", Added more error logging, all services/svc should now log on some level
2018-11-29 00:58:46 -05:00
David Marcec
5ae0d6cba2 Changed logging to be "Log before execution", Added more error logging, all services should now log on some level 2018-11-26 17:06:13 +11:00
Lioncash
ecfdfae795 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
Zach Hilman
3b5982f9a1 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
David Marcec
cfbfad9ffe 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
Lioncash
b1aad83113 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
Lioncash
30638f9c95 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
Lioncash
4913549d6b 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
James Rowe
d74d2a77cb Update clang format 2018-07-02 21:45:47 -04:00
James Rowe
e159c550d8 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
Lioncash
1b310cbb3a 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
Lioncash
3cac963a7d sm: Move logging macros over to new fmt-compatible ones 2018-04-24 12:01:31 -04:00
Lioncash
4bd499d440 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
Lioncash
6d94dd21a5 service: Use nested namespace specifiers where applicable
Tidies up namespace declarations
2018-04-19 22:20:28 -04:00
David Marcec
6a19c31308 Dont call UNIMPLEMENTED for 'empty services', just return error code 2018-02-05 02:03:22 -08:00
bunnei
ca93cbddcb ResponseBuilder: Use a bit field for customizing instead of always_move_handles. 2018-01-24 22:24:20 -05:00
bunnei
f328cb2c7c hle: Rename RequestBuilder to ResponseBuilder. 2018-01-24 22:24:10 -05:00
bunnei
427b97e60c service: Fix all incorrect IPC response headers. 2018-01-24 22:21:33 -05:00
David
61a92c7347 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
bunnei
182548ec86 yuzu: Update license text to be consistent across project. 2018-01-13 16:22:39 -05:00
Subv
f262afb38a IPC: Take the number of domain objects as a parameter in MakeBuilder. 2018-01-07 17:11:58 -05:00
Subv
ed8e7b90cd SM: Fixed connecting to services with an 8-byte name, like appletOE. 2018-01-07 17:11:56 -05:00
Subv
7d966999d4 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
Subv
fd93b1e0ef 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
Subv
6a6013d4c3 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
bunnei
82fb80da76 service: Clean up apm/lm/applet_oe/controller/sm ctor/dtor. 2017-12-28 15:27:30 -05: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
Subv
2e487c9bce HLE/SRV: Implemented RegisterService.
Now system modules can do more than just crash immediately on startup.
2017-09-24 00:12:58 -05:00
Yuri Kunde Schlesner
211fea5441 Service/sm: Convert 'srv:' to ServiceFramework 2017-06-08 20:59:19 -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