summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/service.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-02-18vi: manage resources independently of nvnflinger and refactorLiam1-10/+0
2024-02-18nvnflinger: convert to processLiam1-11/+0
2024-01-25service: add template serializer for method callsLiam1-0/+16
2023-08-20sockets: avoid locking around socket session callsLiam1-2/+2
2023-04-26core: service: Add FunctionInfoTyped to allow expanding existing interfacesgerman771-8/+12
2023-03-01nvnflinger: fix nameLiam1-5/+5
2023-03-01service: move hle_ipc from kernelLiam1-11/+9
2023-02-21service: refactor server architectureLiam1-17/+2
Converts services to have their own processes
2022-10-31kernel: invert session request handling flowLiam1-0/+4
2022-10-23core: barrier service thread shutdownLiam1-0/+2
2022-06-27core: Replace all instances of ResultCode with Resultgerman771-2/+2
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-12hle: kernel: Use std::mutex instead of spin locks for most kernel locking.bunnei1-3/+2
2022-04-02hle: service: Add option for service interfaces to create or use the default thread.bunnei1-5/+9
2022-03-25hle: vi: Integrate new NVFlinger and HosBinderDriverServer service.bunnei1-1/+3
2021-07-21hle: service: sm: Refactor to better manage ports.bunnei1-1/+1
2021-07-21hle: service: Add a helper module for managing kernel objects.bunnei1-2/+3
2021-06-10hle: service: sm: Remove redundant session reservation, etc.bunnei1-1/+4
- We were double-reserving, causing us to run out of sessions in Pokemon Sword & Shield.
2021-06-10hle: service: Increase arbitrary max sessions limit.bunnei1-4/+1
- Pokemon Sword/Shield are still hitting this for some reason, causing an svcBreak.
2021-06-10hle: service: Use correct size for ServerSessionCountMax.bunnei1-4/+6
2021-06-10hle: kernel: KServerSession: Fix client disconnected.bunnei1-1/+1
- Prevents a cloned session's handler from being overwritten by another disconnected session. - Fixes session handler nullptr asserts with Pokemon Sword & Shield.
2021-06-09hle: service: Increase arbitrary max sessions limit.bunnei1-1/+1
- Pokemon Sword/Shield are still hitting this for some reason, causing an svcBreak.
2021-06-05hle: kernel: Refactor to allocate a ServiceThread per service handler.bunnei1-2/+3
- 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.
2021-05-16core: Make variable shadowing a compile-time errorLioncash1-6/+6
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.
2021-05-11hle: service: Add support for dispatching TIPC requests.bunnei1-1/+23
2021-05-11hle: service: Implement IPC::CommandType::Close.bunnei1-1/+2
- This was not actually closing sessions before.
2021-05-11hle: kernel: Implement named service ports using service interface factory.bunnei1-3/+5
- This allows us to create a new interface each time ConnectToNamedPort is called, removing the assumption that these are static.
2021-05-06hle: kernel: Remove deprecated Object class.bunnei1-1/+0
2021-05-06hle: kernel: Migrate KSession, KClientSession, and KServerSession to KAutoObject.bunnei1-4/+1
2020-12-29hle: service: Acquire and release a lock on requests.bunnei1-4/+12
- This makes it such that we can safely access service members from CoreTiming thread.
2020-11-27service: Eliminate usages of the global system instanceLioncash1-5/+13
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
2020-11-24hle: services: Fix a crash with improper NVFlinger lifetime management. (#4977)bunnei1-5/+16
* hle: services: Fix a crash with improper NVFlinger lifetime management. - This crash would happen when attempting to shutdown yuzu early on in boot.
2020-09-07service: Remove two usages of the global system accessorLioncash1-2/+2
Removes more instances of reliance on global state.
2019-11-25kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei1-1/+1
* 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-09-21services: Pass FileSystemController as reference to services that need itZach Hilman1-4/+4
2019-06-29fsp-srv: Implement OutputAccessLogToSdCardZach Hilman1-2/+1
Allows games to log data to the SD.
2019-04-04core: Add missing override specifiers where applicableLioncash1-1/+1
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.
2019-02-16core_timing: Convert core timing into a classLioncash1-5/+10
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.
2018-12-13Fix Service object leak on emulation stopJens Schmer1-5/+3
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.
2018-10-13filesystem: Make CreateFactories() and InstallInterface() take a VfsFilesystem instance by referenceLioncash1-2/+1
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.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-3/+3
2018-09-02service: Migrate global named port map to the KernelCore classLioncash1-7/+0
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.
2018-08-12vfs: Make type hierarchy objects classes instead of structsLioncash1-1/+1
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.
2018-08-09core: Port core to VfsFilesystem for file accessZach Hilman1-1/+6
2018-08-02kernel: Move object class to its own source filesLioncash1-2/+1
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-07-24core: Make converting constructors explicit where applicableLioncash1-1/+1
Avoids unwanted implicit conversions. Thankfully, given the large amount of cleanup in past PRs, only this tiny amount is left over to cover.
2018-04-21core: Relocate g_service_manager to the System classLioncash1-1/+1
Converts the service manager from a global into an instance-based variable.
2018-01-21Format: Run the new clang format on everythingJames Rowe1-2/+2
2018-01-13yuzu: Update license text to be consistent across project.bunnei1-1/+1
2017-12-29kernel: Fix implementation of ConvertSessionToDomain.bunnei1-1/+1
2017-11-01service: Return proper result code for IPC::CommandType::Close.bunnei1-1/+1
2017-10-19service: Add CreatePort function (that does not register/install).bunnei1-0/+2
2017-10-15hle: Initial implementation of NX service framework and IPC.bunnei1-80/+4
2017-06-08Service: Add new ServiceFramework framework for writing HLE servicesYuri Kunde Schlesner1-0/+150
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-06Service: Remove unnecessary includes from service.hYuri Kunde Schlesner1-5/+7
This has a huge fallout in terms of needing to fix other files because all service implementations included that file.
2017-06-06Service: Make service registration part of the sm implementationYuri Kunde Schlesner1-2/+0
Also enhances the GetServiceHandle implementation to be more accurate.
2017-06-06HLE: Move SessionRequestHandler from Service:: to Kernel::Yuri Kunde Schlesner1-43/+2
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-05-30Kernel: Move HandleTable to a separate fileYuri Kunde Schlesner1-1/+0
2016-12-26IPC helpers exampleLectem1-0/+1
2016-12-14Fixed the codestyle to match our clang-format rules.Subv1-8/+13
2016-12-09Moved the HLE command buffer translation task to ServerSession instead of the HLE handler superclass.Subv1-20/+10
2016-12-08Added a framework for partially handling Session disconnections.Subv1-0/+18
Further implementation will happen in a future commit. Fixes a regression.
2016-12-08Use std::move where appropriate.Subv1-156/+3
2016-12-05HLE: Use a member variable instead of a virtual function to retrieve the max number of sessions that can be connected to an HLE service at the same time.Subv1-5/+13
2016-12-05Split SessionRequestHandler::HandleSyncRequest into HandleSyncRequest, TranslateRequest and HandleSyncRequestImpl.Subv1-6/+22
HandleSyncRequest now takes care of calling the command buffer translate function before actually invoking the command handler for HLE services.
2016-12-05KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it.Subv1-4/+10
2016-12-01Fixed the rebase mistakes.Subv1-25/+25
2016-12-01A bit of a redesign.Subv1-5/+174
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-12-01IPC/HLE: Associate the ClientSessions with their parent port's HLE interface if it exists.Subv1-1/+1
Pass the triggering ServerSession to the HLE command handler to differentiate which session caused the request.
2016-12-01Kernel/HLE: Service::Interface no longer inherits from any Kernel object, and is now its own standalone class.Subv1-8/+4
Interface is now used by aggregation in ClientPort, to forward service commands to their HLE implementation if needed.
2016-12-01fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.Subv1-1/+1
2016-12-01 Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.Subv1-5/+16
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-30Set client SDK version to Service APIsmailwl1-0/+12
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-3/+0
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-5/+5
2015-06-28Core: Cleanup file_sys includes.Emmanuel Gil Peyrot1-0/+2
2015-06-28Common: Cleanup key_map includes.Emmanuel Gil Peyrot1-1/+0
2015-05-07Common: Remove common.hYuri Kunde Schlesner1-1/+1
2015-04-14De-inline functions from Interface, removing them from service.hYuri Kunde Schlesner1-50/+5
This reduces the time for a full recompile from 65.43s to 59.53s (~9%)
2015-03-04Services: Moved the PTM and APT services to their own folderSubv1-0/+3
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.
2015-02-02Service: Store function names as const char* instead of std::stringYuri Kunde Schlesner1-6/+6
Uses less memory (strings and function table is stored in constant data) and speeds up start up (no need to allocate and copy strings).
2015-02-02Service: Clean-up InterfaceYuri Kunde Schlesner1-22/+9
2015-02-02Make Port/Service registration and querying more HW-accurateYuri Kunde Schlesner1-24/+6
2015-01-10Logging: Log all called service functions (under trace). Compile out all trace logs under release for performance.archshift1-11/+20
2015-01-07Fix double-free in Service manager during shutdownYuri Kunde Schlesner1-11/+4
Fixes #423.
2014-12-28Kernel: New handle managerYuri Kunde Schlesner1-2/+3
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.
2014-12-28Rename ObjectPool to HandleTableYuri Kunde Schlesner1-2/+2
2014-12-21License changepurpasmart961-1/+1
2014-12-15Remove SyncRequest from K::Object and create a new K::Session typeYuri Kunde Schlesner1-18/+8
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.)
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner1-7/+1
2014-11-25Log the cmd_buff arguments when citra comes across an unimplemented functionarchshift1-12/+12
2014-11-24Remove duplicated docs/update them for changed parameters.Yuri Kunde Schlesner1-10/+0
2014-11-24HLE: Revamp error handling throrough the HLE codeYuri Kunde Schlesner1-6/+6
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.
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generatedEmmanuel Gil Peyrot1-7/+7
2014-10-26Add `override` keyword through the code.Yuri Kunde Schlesner1-5/+5
This was automated using `clang-modernize`.
2014-09-06core: Pass string by reference in FetchFromPortName and DeleteServiceLioncash1-2/+2
2014-08-18Core: Alter the kernel string functions to use std::string instead of const char*.Lioncash1-5/+5
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
2014-06-13HLE: Updated all uses of NULL to nullptr (to be C++11 compliant)bunnei1-1/+1
2014-06-13Kernel: Updated several member functions to be constbunnei1-2/+2
2014-06-05service: added a error log messages for unimplemented WaitSynchronizationbunnei1-0/+1
2014-05-30service: cleaned up log messagesbunnei1-2/+2
2014-05-30service: added additional hack to return success on unimplemented service callsbunnei1-2/+10
2014-05-29service: changed interface to return 0 (no error) when a service method is unimplemented - hack to make apps boot furtherbunnei1-2/+2
2014-05-27kernel: added WaitSynchronization method to Kernel::Objectbunnei1-0/+10
2014-05-27kernel: updated SyncRequest to take boolean thread wait result as a parameterbunnei1-3/+4
2014-05-27service: Renamed Sync to SyncRequestbunnei1-1/+1
2014-05-23service: fixed typo that MSVC did not catch as an errorbunnei1-1/+1
2014-05-21service: removed redundant include of common_types.hbunnei1-1/+0
2014-05-21renamed "syscall" module to "svc" (more accurate naming)bunnei1-1/+1
2014-05-21- created a Kernel namespacebunnei1-6/+6
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles
2014-05-19- renamed NewHandle to CreateHandlebunnei1-5/+7
- updated CreateHandle/DeleteHandle to use KernelObject's
2014-05-19- updated service(s) to be KernelObject'sbunnei1-36/+15
- various cleanups
2014-05-19renamed "UID" to "Handle" where appropriatebunnei1-12/+10
2014-05-19- moved Handle/Result definitions to kernel.hbunnei1-5/+7
- added ResetType enum
2014-05-08- removed HLE mem "hack" and replaced with kernel mem regionbunnei1-1/+11
- 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)
2014-04-28fixed weird spacingbunnei1-1/+1
2014-04-25- refactored how service functions are calledbunnei1-8/+32
- added option to create/delete service handles
2014-04-16- added stubbed out GSP::Gpu service interfacebunnei1-4/+6
- various cleanups/refactors to HLE services
2014-04-16restructured hle:services completely to use function lookup tablesbunnei1-2/+26
2014-04-16- extracted srv: calls from service.cpp and put in its own modulebunnei1-8/+11
- added function tables for service calls - lots of refactoring
2014-04-13added framework for APT service (application and title launching service)bunnei1-0/+1
2014-04-13cleanups to service HLEbunnei1-2/+2
2014-04-13- added HLE to connect to "srv:" servicebunnei1-2/+55
- added a manager for keeping track of services/ports - added a memory mapped region for memory accessed by HLE - added HLE for GetThreadCommandBuffer function
2014-04-12- renamed hle_syscall to just syscallbunnei1-0/+60
- added service.h as an initial service interface