aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.h
AgeCommit message (Collapse)Author
2018-12-18kernel/thread: Make thread_id a 64-bit valueLioncash
The kernel uses a 64-bit value for the thread ID, so we shouldn't be using a 32-bit value.
2018-12-18kernel/process: Make process_id a 64-bit valueLioncash
In the actual kernel, this is a 64-bit value, so we shouldn't be using a 32-bit type to handle it.
2018-11-19kernel/resource_limit: Clean up interfaceLioncash
Cleans out the citra/3DS-specific implementation details that don't apply to the Switch. Sets the stage for implementing ResourceLimit instances properly. While we're at it, remove the erroneous checks within CreateThread() and SetThreadPriority(). While these are indeed checked in some capacity, they are not checked via a ResourceLimit instance. In the process of moving out Citra-specifics, this also replaces the system ResourceLimit instance's values with ones from the Switch.
2018-10-20kernel/process: Make the handle table per-processLioncash
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.
2018-10-10kernel/thread: Use a regular pointer for the owner/current processLioncash
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).
2018-09-06core: Migrate current_process pointer to the kernelLioncash
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.
2018-09-02service: Migrate global named port map to the KernelCore classLioncash
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-28kernel: Eliminate kernel global stateLioncash
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-03core/memory: Get rid of 3DS leftoversLioncash
Removes leftover code from citra that isn't needed.
2018-08-01kernel: Move object class to its own source filesLioncash
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-04-20Qt: Update the WaitTree widget to show info about the current mutex of each ↵Subv
thread.
2018-03-16kernel: Move stack region outside of application heap.bunnei
2018-01-24hle: Remove Domain and SyncObject kernel objects.bunnei
2018-01-16clang-formatMerryMage
2018-01-14kernel: Increase default stack size to 64K.bunnei
2018-01-08kernel: Rename Semaphore to ConditionVariable.bunnei
2017-12-28kernel: Add basic support for Domain object.bunnei
2017-08-23Merge pull request #2839 from Subv/global_kernel_lockJames Rowe
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).
2017-08-22Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state ↵Subv
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.
2017-08-21Warnings: Add UNREACHABLE macros to switches that contemplate all possible ↵Subv
values.
2017-05-29Kernel: Move HandleTable to a separate fileYuri Kunde Schlesner
2017-05-29Kernel: Move WaitObject to a separate fileYuri Kunde Schlesner
Now that HandleTable doesn't directly depend on WaitObject anymore, this can be separated from the main kernel.h header.
2017-05-29Kernel: Removed HandleTable::GetWaitObjectYuri Kunde Schlesner
This isn't necessary anymore since plain Get works correctly for WaitObjects.
2017-05-29Kernel: Extract dynamic Object pointer cast into its own functionYuri Kunde Schlesner
2017-05-24Kernel: Centralize error definitions in errors.hYuri Kunde Schlesner
2017-01-10Merge pull request #2397 from Subv/pulsebunnei
Kernel: Implemented Pulse event and timers.
2017-01-05Kernel: Implemented Pulse event and timers.Subv
Closes #1904
2017-01-04Kernel/Mutex: Update a mutex priority when a thread stops waiting on it.Subv
2017-01-04Kernel/Mutex: Implemented priority inheritance.Subv
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.
2017-01-04Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.Subv
This will be useful when implementing mutex priority inheritance.
2016-12-21core: Remove HLE module, consolidate code & various cleanups.bunnei
2016-12-16Merge pull request #2260 from Subv/schedulingbunnei
Threading: Reworked the way our scheduler works.
2016-12-09WaitSynch: Removed unused variables and reduced SharedPtr copies.Subv
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.
2016-12-05Kernel: Remove the Redirection handle type.Subv
2016-12-03Threading: Reworked the way our scheduler works.Subv
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.
2016-11-30Fixed the rebase mistakes.Subv
2016-11-30fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block ↵Subv
of Inter Process Communication.
2016-11-30 Kernel/IPC: Use Ports and Sessions as the fundamental building block of ↵Subv
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.
2016-11-19Kernel/Loader: Grab the system mode from the NCCH ExHeader.Subv
3dsx and elf files default to system mode 2 (96MB allocated to the application). This allows Home Menu to boot without modifications. Closes #1849
2016-09-22move ResetType to kernel.hwwylele
2016-09-22implement wait tree widgetwwylele
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot
2016-06-11Kernel/SVC: Implemented svcCreatePort.Subv
2016-06-05Kernel: Added ClientPort and ServerPort classes.Subv
This is part of an ongoing effort to implement support for multiple processes.
2015-07-12Kernel: Add CodeSet case to Object::IsWaitableYuri Kunde Schlesner
2015-07-11Core: Properly configure address space when loading a binaryYuri Kunde Schlesner
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.
2015-06-28Common: Cleanup key_map includes.Emmanuel Gil Peyrot
2015-06-16kernel: Fix svcWaitSynch to always acquire requested wait objects.bunnei