summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/server_session.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* kernel/thread: Make all instance variables privateLioncash2018-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
* core/core: Replace includes with forward declarations where applicableLioncash2018-08-311-3/+3
| | | | | | | | | | | The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
* kernel: Eliminate kernel global stateLioncash2018-08-291-8/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* kernel/server_session: Add IsSession() member functionLioncash2018-08-151-1/+1
| | | | | | Allows querying the inverse of IsDomain() to make things more readable. This will likely also be usable in the event of implementing ConvertDomainToSession().
* server_session: Provide more useful information and don't crash on bad IPC request.bunnei2018-08-121-0/+8
|
* client_port: Make all data members privateLioncash2018-08-071-1/+1
| | | | | | | | These members don't need to be entirely exposed, we can instead expose an API to operate on them without directly needing to mutate them We can also guard against overflow/API misuse this way as well, given active_sessions is an unsigned value.
* kernel: Remove unnecessary includesLioncash2018-07-311-0/+2
| | | | | Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
* thread: Convert ThreadStatus into an enum classLioncash2018-07-201-2/+2
| | | | | Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
* core/memory, core/hle/kernel: Use std::move where applicableLioncash2018-07-191-1/+2
| | | | Avoids pointless copies
* Update clang formatJames Rowe2018-07-031-1/+1
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-2/+2
|
* Merge pull request #431 from lioncash/fmtbunnei2018-05-021-1/+1
|\ | | | | general: Make formatting of logged hex values more straightforward
| * general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-1/+1
| | | | | | | | | | | | 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).
* | ipc: Add support for PopIpcInterface() method.bunnei2018-05-021-0/+3
|/ | | | - This can be used for domain objects as inputs to service functions.
* kernel: Migrate logging macros to fmt-compatible onesLioncash2018-04-261-3/+3
|
* Clang FixesN00byKing2018-03-191-1/+2
|
* Clean Warnings (?)N00byKing2018-03-191-1/+1
|
* core: Move process creation out of global state.bunnei2018-03-141-1/+2
|
* Fix: change check for domain order and existance of domain message headermailwl2018-02-201-1/+1
|
* IPC: add domain header to response if only it exists in requestmailwl2018-02-201-1/+1
|
* Kernel/IPC: Add a small delay after each SyncRequest to prevent thread starvation.Subv2018-02-181-41/+56
| | | | | | | | Ported from citra PR #3091 The delay specified here is from a Nintendo 3DS, and should be measured in a Nintendo Switch. This change is enough to prevent Puyo Puyo Tetris's main thread starvation.
* server_session: Fix scenario where all domain handlers are closed.bunnei2018-01-251-3/+3
|
* hle: Rename RequestBuilder to ResponseBuilder.bunnei2018-01-251-1/+1
|
* hle: Integrate Domain handling into ServerSession.bunnei2018-01-251-5/+42
|
* kernel: Fix implementation of ConvertSessionToDomain.bunnei2017-12-291-2/+9
|
* service: Return proper result code for IPC::CommandType::Close.bunnei2017-11-011-5/+6
|
* Merge pull request #2793 from Subv/replyandreceiveSebastian Valle2017-06-301-6/+16
|\ | | | | Kernel/SVC: Partially implemented svcReplyAndReceive
| * Kernel/ServerSession: Keep track of which threads have issued sync requests.Subv2017-06-251-6/+16
| |
* | ResultVal: Remove MoveFrom()Yuri Kunde Schlesner2017-06-191-1/+1
|/ | | | | Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in case you already have an rvalue.
* Kernel: Add a dedicated SetHleHandler method to ServerPort/ServerSessionYuri Kunde Schlesner2017-06-061-11/+5
| | | | | | This allows attaching a HLE handle to a ServerPort at any point after it is created, allowing port/session creation to be generic between HLE and regular services.
* HLE: Move SessionRequestHandler from Service:: to Kernel::Yuri Kunde Schlesner2017-06-061-2/+5
| | | | | 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.
* Kernel/Sessions: Remove the ClientSession::Create function.Subv2017-05-221-1/+3
| | | | It is not meant to be used by anything other than CreateSessionPair.
* Kernel: Use a Session object to keep track of the status of a Client/Server session pair.Subv2017-05-151-7/+22
| | | | Reduce the associated port's connection count when a ServerSession is destroyed.
* Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.Subv2017-01-041-3/+3
| | | | This will be useful when implementing mutex priority inheritance.
* Fixed the codestyle to match our clang-format rules.Subv2016-12-141-10/+15
|
* Moved the HLE command buffer translation task to ServerSession instead of the HLE handler superclass.Subv2016-12-091-2/+13
|
* Added a framework for partially handling Session disconnections.Subv2016-12-081-2/+8
| | | | | | Further implementation will happen in a future commit. Fixes a regression.
* Use std::move where appropriate.Subv2016-12-081-3/+4
|
* KServerPorts now have an HLE handler "template", which is inherited by all ServerSessions created from it.Subv2016-12-051-3/+3
|
* Declare empty ServerSession and ClientSession constructors as default.Subv2016-12-031-2/+2
|
* Fixed the rebase mistakes.Subv2016-12-011-1/+0
|
* A bit of a redesign.Subv2016-12-011-13/+12
| | | | | | | 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.
* fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.Subv2016-12-011-1/+1
|
* Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.Subv2016-12-011-0/+58
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.