aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.h
Commit message (Collapse)AuthorAgeFilesLines
* kernel/process: Make the handle table per-processLioncash2018-10-201-6/+0
| | | | | | | | In the kernel, there isn't a singular handle table that everything gets tossed into or used, rather, each process gets its own handle table that it uses. This currently isn't an issue for us, since we only execute one process at the moment, but we may as well get this out of the way so it's not a headache later on.
* kernel/thread: Use a regular pointer for the owner/current processLioncash2018-10-101-5/+5
| | | | | | | | | | | There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
* core: Migrate current_process pointer to the kernelLioncash2018-09-061-0/+9
| | | | | | | | | | Given we now have the kernel as a class, it doesn't make sense to keep the current process pointer within the System class, as processes are related to the kernel. This also gets rid of a subtle case where memory wouldn't be freed on core shutdown, as the current_process pointer would never be reset, causing the pointed to contents to continue to live.
* service: Migrate global named port map to the KernelCore classLioncash2018-09-021-0/+18
| | | | | | 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.
* kernel: Eliminate kernel global stateLioncash2018-08-281-5/+84
| | | | | | | | | | | | | | | | | | | | | | 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.
* core/memory: Get rid of 3DS leftoversLioncash2018-08-031-1/+1
| | | | Removes leftover code from citra that isn't needed.
* kernel: Move object class to its own source filesLioncash2018-08-011-110/+0
| | | | | | 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.
* Qt: Update the WaitTree widget to show info about the current mutex of each ↵Subv2018-04-201-4/+0
| | | | thread.
* kernel: Move stack region outside of application heap.bunnei2018-03-161-4/+0
|
* hle: Remove Domain and SyncObject kernel objects.bunnei2018-01-241-16/+0
|
* clang-formatMerryMage2018-01-161-1/+0
|
* kernel: Increase default stack size to 64K.bunnei2018-01-141-1/+1
|
* kernel: Rename Semaphore to ConditionVariable.bunnei2018-01-081-2/+2
|
* kernel: Add basic support for Domain object.bunnei2017-12-281-0/+17
|
* Merge pull request #2839 from Subv/global_kernel_lockJames Rowe2017-08-231-1/+1
|\ | | | | Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state between the cpu thread and any other possible threads that might touch the kernel (network thread, etc).
| * Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state ↵Subv2017-08-221-1/+1
| | | | | | | | | | | | between the cpu thread and any other possible threads that might touch the kernel (network thread, etc). This mutex is acquired in SVC::CallSVC, ie, as soon as the guest application enters the HLE kernel, and should be acquired by the aforementioned threads before modifying kernel structures.
* | Warnings: Add UNREACHABLE macros to switches that contemplate all possible ↵Subv2017-08-211-0/+3
|/ | | | values.
* Kernel: Move HandleTable to a separate fileYuri Kunde Schlesner2017-05-291-115/+1
|
* Kernel: Move WaitObject to a separate fileYuri Kunde Schlesner2017-05-291-53/+0
| | | | | Now that HandleTable doesn't directly depend on WaitObject anymore, this can be separated from the main kernel.h header.
* Kernel: Removed HandleTable::GetWaitObjectYuri Kunde Schlesner2017-05-291-9/+0
| | | | | This isn't necessary anymore since plain Get works correctly for WaitObjects.
* Kernel: Extract dynamic Object pointer cast into its own functionYuri Kunde Schlesner2017-05-291-11/+24
|
* Kernel: Centralize error definitions in errors.hYuri Kunde Schlesner2017-05-241-7/+0
|
* Merge pull request #2397 from Subv/pulsebunnei2017-01-101-1/+1
|\ | | | | Kernel: Implemented Pulse event and timers.
| * Kernel: Implemented Pulse event and timers.Subv2017-01-051-1/+1
| | | | | | | | Closes #1904
* | Kernel/Mutex: Update a mutex priority when a thread stops waiting on it.Subv2017-01-041-1/+1
| |
* | Kernel/Mutex: Implemented priority inheritance.Subv2017-01-041-1/+1
| | | | | | | | | | | | | | The implementation is based on reverse engineering of the 3DS's kernel. A mutex holder's priority will be temporarily boosted to the best priority among any threads that want to acquire any of its held mutexes. When the holder releases the mutex, it's priority will be boosted to the best priority among the threads that want to acquire any of its remaining held mutexes.
* | Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.Subv2017-01-041-4/+5
|/ | | | This will be useful when implementing mutex priority inheritance.
* core: Remove HLE module, consolidate code & various cleanups.bunnei2016-12-211-1/+2
|
* Merge pull request #2260 from Subv/schedulingbunnei2016-12-161-1/+7
|\ | | | | Threading: Reworked the way our scheduler works.
| * WaitSynch: Removed unused variables and reduced SharedPtr copies.Subv2016-12-091-1/+4
| | | | | | | | | | | | Define a variable with the value of the sync timeout error code. Use a boost::flat_map instead of an unordered_map to hold the equivalence of objects and wait indices in a WaitSynchN call.
| * Threading: Reworked the way our scheduler works.Subv2016-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | Threads will now be awakened when the objects they're waiting on are signaled, instead of repeating the WaitSynchronization call every now and then. The scheduler is now called once after every SVC call, and once after a thread is awakened from sleep by its timeout callback. This new implementation is based off reverse-engineering of the real kernel. See https://gist.github.com/Subv/02f29bd9f1e5deb7aceea1e8f019c8f4 for a more detailed description of how the real kernel handles rescheduling.
* | Kernel: Remove the Redirection handle type.Subv2016-12-051-2/+0
| |
* | Fixed the rebase mistakes.Subv2016-11-301-18/+16
| |
* | fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block ↵Subv2016-11-301-2/+3
| | | | | | | | of Inter Process Communication.
* | Kernel/IPC: Use Ports and Sessions as the fundamental building block of ↵Subv2016-11-301-17/+19
|/ | | | | | | | | Inter Process Communication. 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.
* Kernel/Loader: Grab the system mode from the NCCH ExHeader.Subv2016-11-191-2/+2
| | | | | | | 3dsx and elf files default to system mode 2 (96MB allocated to the application). This allows Home Menu to boot without modifications. Closes #1849
* move ResetType to kernel.hwwylele2016-09-221-0/+6
|
* implement wait tree widgetwwylele2016-09-221-0/+3
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-4/+1
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner2016-09-181-2/+1
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-28/+38
|
* Kernel/SVC: Implemented svcCreatePort.Subv2016-06-111-1/+2
|
* Kernel: Added ClientPort and ServerPort classes.Subv2016-06-051-2/+4
| | | | This is part of an ongoing effort to implement support for multiple processes.
* Kernel: Add CodeSet case to Object::IsWaitableYuri Kunde Schlesner2015-07-121-0/+1
|
* Core: Properly configure address space when loading a binaryYuri Kunde Schlesner2015-07-111-0/+1
| | | | | | The code now properly configures the process image to match the loaded binary segments (code, rodata, data) instead of just blindly allocating a large chunk of dummy memory.
* Common: Cleanup key_map includes.Emmanuel Gil Peyrot2015-06-281-4/+3
|
* kernel: Fix svcWaitSynch to always acquire requested wait objects.bunnei2015-06-161-6/+0
|
* Kernel: Fix a warning introduced with ResourceLimit, and remove the fallback ↵Emmanuel Gil Peyrot2015-05-211-2/+1
| | | | code to prevent it from happening again.
* Core/ResourceLimits: Implemented the basic structure of ResourceLimits.Subv2015-05-141-1/+2
| | | | | | Implemented svcs GetResourceLimit, GetResourceLimitCurrentValues and GetResourceLimitLimitValues. Note that the resource limits do not currently keep track of used objects, since we have no way to distinguish between an object created by the application, and an object created by some HLE module once we're inside Kernel::T::Create.
* Kernel: Remove g_program_idYuri Kunde Schlesner2015-05-081-6/+0
| | | | This has been obsoleted by the field in Process.