David Marcec
188da5880b
Ported #4296 from citra
...
This will allow us to easily remove the use of "NFC" in "System"
2018-10-06 16:49:01 +10:00
Lioncash
9f57c22ae2
service: Add missing headers inclusions where applicable
...
Gets rid of a few indirect inclusions.
2018-09-25 17:14:38 -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
bunnei
b4cc42e615
Merge pull request #1080 from lioncash/ret
...
sm/controller: Correct return value of QueryPointerBufferSize
2018-08-15 18:25:05 -04:00
Lioncash
c5986c7bf7
kernel/server_session: Add IsSession() member function
...
Allows querying the inverse of IsDomain() to make things more readable.
This will likely also be usable in the event of implementing
ConvertDomainToSession().
2018-08-15 06:50:50 -04:00
Lioncash
d9f92aa9b0
sm/controller: Correct return value of QueryPointerBufferSize
...
This should be returning a u16 according to Switch Brew.
2018-08-15 06:16:10 -04:00
Lioncash
38c2af9330
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-01 23:34:42 -04:00
Lioncash
e664bf00ed
hle/service: Make constructors explicit where applicable
...
Prevents implicit construction and makes these lingering non-explicit
constructors consistent with the rest of the other classes in services.
2018-07-19 12:25:02 -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
eb3be60fc2
controller: DuplicateSession should return a ClientSession.
2018-02-03 12:09:33 -05: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
bunnei
a3aadaea60
hle: Integrate Domain handling into ServerSession.
2018-01-24 22:18:56 -05:00
bunnei
4fabdf77d7
hle: Remove Domain and SyncObject kernel objects.
2018-01-24 22:18:54 -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
eae8413876
controller: Use DuplicateSession for DuplicateSessionEx.
2018-01-17 21:48:17 -05:00
bunnei
182548ec86
yuzu: Update license text to be consistent across project.
2018-01-13 16:22:39 -05:00
Subv
d3f259cd73
IPC: Make DuplicateSession return the Domain instead of the Session if the request was made on a Domain interface.
2018-01-07 17:12:07 -05:00
Subv
b01b7eea52
IPC: Corrected some command headers in the IPC Controller interface.
2018-01-07 17:12:03 -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
33fa650a20
controller: Implement DuplicateSession.
2017-12-29 00:39:34 -05:00
bunnei
9d04a45a90
kernel: Fix implementation of ConvertSessionToDomain.
2017-12-29 00:36:22 -05:00
bunnei
82fb80da76
service: Clean up apm/lm/applet_oe/controller/sm ctor/dtor.
2017-12-28 15:27:30 -05:00
bunnei
714dd3da6d
hle: Use Switch formatted result codes.
2017-10-31 19:26:11 -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
775cf60729
Merge remote-tracking branch 'upstream/master' into nx
...
# Conflicts:
# src/core/CMakeLists.txt
# src/core/arm/dynarmic/arm_dynarmic.cpp
# src/core/arm/dyncom/arm_dyncom.cpp
# src/core/hle/kernel/process.cpp
# src/core/hle/kernel/thread.cpp
# src/core/hle/kernel/thread.h
# src/core/hle/kernel/vm_manager.cpp
# src/core/loader/3dsx.cpp
# src/core/loader/elf.cpp
# src/core/loader/ncch.cpp
# src/core/memory.cpp
# src/core/memory.h
# src/core/memory_setup.h
2017-10-09 23:56:20 -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
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
7747a25345
Service/sm: Convert srv: to use IPC helpers
2017-06-11 13:10:21 -07: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
Yuri Kunde Schlesner
d9e7be32de
Service/sm: Use an actual semaphore for the notification semaphore
...
An Event was used way back then when we didn't have proper working
semaphores. Our Semaphore implementation is good enough now.
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