| Commit message (Collapse) | Author | Files | Lines |
|
|
|
- Prevents a cloned session's handler from being overwritten by another disconnected session.
- Fixes session handler nullptr asserts with Pokemon Sword & Shield.
|
|
- Pokemon Sword/Shield are still hitting this for some reason, causing an svcBreak.
|
|
- Previously, we would allocate a thread per session, which adds new threads on CloneCurrentObject.
- This results in race conditions with N sessions queuing requests to the same service interface.
- Fixes Pokken Tournament DX crashes/softlocks, which were regressed by #6347.
|
|
Now that we have most of core free of shadowing, we can enable the
warning as an error to catch anything that may be remaining and also
eliminate this class of logic bug entirely.
|
|
|
|
- This was not actually closing sessions before.
|
|
- This allows us to create a new interface each time ConnectToNamedPort is called, removing the assumption that these are static.
|
|
|
|
|
|
- This makes it such that we can safely access service members from CoreTiming thread.
|
|
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
|
|
* hle: services: Fix a crash with improper NVFlinger lifetime management.
- This crash would happen when attempting to shutdown yuzu early on in boot.
|
|
Removes more instances of reliance on global state.
|
|
* 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.
|
|
|
|
Allows games to log data to the SD.
|
|
Applies the override specifier where applicable. In the case of
destructors that are defaulted in their definition, they can
simply be removed.
This also removes the unnecessary inclusions being done in audin_u and
audrec_u, given their close proximity.
|
|
Gets rid of the largest set of mutable global state within the core.
This also paves a way for eliminating usages of GetInstance() on the
System class as a follow-up.
Note that no behavioral changes have been made, and this simply extracts
the functionality into a class. This also has the benefit of making
dependencies on the core timing functionality explicit within the
relevant interfaces.
|
|
Services created with the ServiceFramework base class install themselves as HleHandlers with an owning shared_ptr in the ServerPort ServiceFrameworkBase::port member variable, creating a cyclic ownership between ServiceFrameworkBase and the ServerPort, preventing deletion of the service objects.
Fix that by removing the ServiceFrameworkBase::port member because that was only used to detect multiple attempts at installing a port. Instead store a flag if the port was already installed to achieve the same functionality.
|
|
Neither of these functions alter the ownership of the provided pointer,
so we can simply make the parameters a reference rather than a direct
shared pointer alias. This way we also disallow passing incorrect memory values like
nullptr.
|
|
|
|
Now that we have a class representing the kernel in some capacity, we
now have a place to put the named port map, so we move it over and get
rid of another piece of global state within the core.
|
|
struct should be used when the data type is very simple or otherwise has
no invariants associated with it. Given these are used to form a
hierarchy, class should be used instead.
|
|
|
|
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.
|
|
Avoids unwanted implicit conversions. Thankfully, given the large amount
of cleanup in past PRs, only this tiny amount is left over to cover.
|
|
Converts the service manager from a global into an instance-based
variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
This has a huge fallout in terms of needing to fix other files because
all service implementations included that file.
|
|
Also enhances the GetServiceHandle implementation to be more accurate.
|
|
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.
|
|
|
|
|
|
|
|
|
|
Further implementation will happen in a future commit.
Fixes a regression.
|
|
|
|
|
|
HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services.
|
|
|
|
|
|
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.
|
|
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
|
|
Interface is now used by aggregation in ClientPort, to forward service commands to their HLE implementation if needed.
|
|
|
|
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.
|
|
|
|
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|
|
|
|
|
|
|
|
|
|
This reduces the time for a full recompile from 65.43s to 59.53s (~9%)
|
|
This coincidentally fixes an issue about the PTM service failing to create its SharedExtSaveData archive due to the FS service not being initialized by the time the creating code runs.
Ideally I'd like to move each process to its own folder, and have a single file per process that registers the service classes, which would be in their own files inside that folder. Then each service class would just call functions from the process to complete the commands.
|
|
Uses less memory (strings and function table is stored in constant data)
and speeds up start up (no need to allocate and copy strings).
|
|
|
|
|
|
|
|
Fixes #423.
|
|
This handle manager more closely mirrors the behaviour of the CTR-OS
one. In addition object ref-counts and support for DuplicateHandle have
been added.
Note that support for DuplicateHandle is still experimental, since parts
of the kernel still use Handles internally, which will likely cause
troubles if two different handles to the same object are used to e.g.
wait on a synchronization primitive.
|
|
|
|
|
|
This is a first step at fixing the conceptual insanity that is our
handling of service and IPC calls. For now, interfaces still directly
derived from Session because we don't have the infrastructure to do it
properly. (That is, Processes and scheduling them.)
|
|
|
|
|
|
|
|
All service calls in the CTR OS return result codes indicating the
success or failure of the call. Previous to this commit, Citra's HLE
emulation of services and the kernel universally either ignored errors
or returned dummy -1 error codes.
This commit makes an initial effort to provide an infrastructure for
error reporting and propagation which can be use going forward to make
HLE calls accurately return errors as the original system. A few parts
of the code have been updated to use the new system where applicable.
One part of this effort is the definition of the `ResultCode` type,
which provides facilities for constructing and parsing error codes in
the structured format used by the CTR.
The `ResultVal` type builds on `ResultCode` by providing a container for
values returned by function that can report errors. It enforces that
correct error checking will be done on function returns by preventing
the use of the return value if the function returned an error code.
Currently this change is mostly internal since errors are still
suppressed on the ARM<->HLE border, as a temporary compatibility hack.
As functionality is implemented and tested this hack can be eventually
removed.
|
|
|
|
This was automated using `clang-modernize`.
|
|
|
|
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues)
- added handle types for all different CTROS handles
|
|
- updated CreateHandle/DeleteHandle to use KernelObject's
|
|
- various cleanups
|
|
|
|
- added ResetType enum
|
|
- added a helper function for getting command buffer for services
- fixed bug where GSP DMA was incorrectly being done in DataSynchronizationBarrier (instead of gsp_TriggerCmdReqQueue)
|
|
|
|
- added option to create/delete service handles
|
|
- various cleanups/refactors to HLE services
|
|
|
|
- added function tables for service calls
- lots of refactoring
|
|
|
|
|
|
- added a manager for keeping track of services/ports
- added a memory mapped region for memory accessed by HLE
- added HLE for GetThreadCommandBuffer function
|
|
- added service.h as an initial service interface
|