Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2018-09-07 | core: Migrate current_process pointer to the kernel | Lioncash | 1 | -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. | |||||
2018-09-02 | service: Migrate global named port map to the KernelCore class | Lioncash | 1 | -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. | |||||
2018-08-29 | kernel: Eliminate kernel global state | Lioncash | 1 | -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. | |||||
2018-08-03 | core/memory: Get rid of 3DS leftovers | Lioncash | 1 | -1/+1 | |
Removes leftover code from citra that isn't needed. | |||||
2018-08-02 | kernel: Move object class to its own source files | Lioncash | 1 | -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. | |||||
2018-04-21 | Qt: Update the WaitTree widget to show info about the current mutex of each thread. | Subv | 1 | -4/+0 | |
2018-03-16 | kernel: Move stack region outside of application heap. | bunnei | 1 | -4/+0 | |
2018-01-25 | hle: Remove Domain and SyncObject kernel objects. | bunnei | 1 | -16/+0 | |
2018-01-16 | clang-format | MerryMage | 1 | -1/+0 | |
2018-01-14 | kernel: Increase default stack size to 64K. | bunnei | 1 | -1/+1 | |
2018-01-09 | kernel: Rename Semaphore to ConditionVariable. | bunnei | 1 | -2/+2 | |
2017-12-29 | kernel: Add basic support for Domain object. | bunnei | 1 | -0/+17 | |
2017-08-22 | 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). | Subv | 1 | -1/+1 | |
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-21 | Warnings: Add UNREACHABLE macros to switches that contemplate all possible values. | Subv | 1 | -0/+3 | |
2017-05-30 | Kernel: Move HandleTable to a separate file | Yuri Kunde Schlesner | 1 | -115/+1 | |
2017-05-30 | Kernel: Move WaitObject to a separate file | Yuri Kunde Schlesner | 1 | -53/+0 | |
Now that HandleTable doesn't directly depend on WaitObject anymore, this can be separated from the main kernel.h header. | |||||
2017-05-30 | Kernel: Removed HandleTable::GetWaitObject | Yuri Kunde Schlesner | 1 | -9/+0 | |
This isn't necessary anymore since plain Get works correctly for WaitObjects. | |||||
2017-05-29 | Kernel: Extract dynamic Object pointer cast into its own function | Yuri Kunde Schlesner | 1 | -11/+24 | |
2017-05-25 | Kernel: Centralize error definitions in errors.h | Yuri Kunde Schlesner | 1 | -7/+0 | |
2017-01-05 | Kernel: Implemented Pulse event and timers. | Subv | 1 | -1/+1 | |
Closes #1904 | |||||
2017-01-04 | Kernel/Mutex: Update a mutex priority when a thread stops waiting on it. | Subv | 1 | -1/+1 | |
2017-01-04 | Kernel/Mutex: Implemented priority inheritance. | Subv | 1 | -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. | |||||
2017-01-04 | Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter. | Subv | 1 | -4/+5 | |
This will be useful when implementing mutex priority inheritance. | |||||
2016-12-22 | core: Remove HLE module, consolidate code & various cleanups. | bunnei | 1 | -1/+2 | |
2016-12-09 | WaitSynch: Removed unused variables and reduced SharedPtr copies. | Subv | 1 | -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. | |||||
2016-12-05 | Kernel: Remove the Redirection handle type. | Subv | 1 | -2/+0 | |
2016-12-04 | Threading: Reworked the way our scheduler works. | Subv | 1 | -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. | |||||
2016-12-01 | Fixed the rebase mistakes. | Subv | 1 | -18/+16 | |
2016-12-01 | fixup! Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication. | Subv | 1 | -2/+3 | |
2016-12-01 | Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication. | Subv | 1 | -17/+19 | |
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-20 | Kernel/Loader: Grab the system mode from the NCCH ExHeader. | Subv | 1 | -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 | |||||
2016-09-22 | move ResetType to kernel.h | wwylele | 1 | -0/+6 | |
2016-09-22 | implement wait tree widget | wwylele | 1 | -0/+3 | |
2016-09-21 | Remove empty newlines in #include blocks. | Emmanuel Gil Peyrot | 1 | -4/+1 | |
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. | |||||
2016-09-19 | Manually tweak source formatting and then re-run clang-format | Yuri Kunde Schlesner | 1 | -2/+1 | |
2016-09-18 | Sources: Run clang-format on everything. | Emmanuel Gil Peyrot | 1 | -28/+38 | |
2016-06-11 | Kernel/SVC: Implemented svcCreatePort. | Subv | 1 | -1/+2 | |
2016-06-05 | Kernel: Added ClientPort and ServerPort classes. | Subv | 1 | -2/+4 | |
This is part of an ongoing effort to implement support for multiple processes. | |||||
2015-07-12 | Kernel: Add CodeSet case to Object::IsWaitable | Yuri Kunde Schlesner | 1 | -0/+1 | |
2015-07-12 | Core: Properly configure address space when loading a binary | Yuri Kunde Schlesner | 1 | -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. | |||||
2015-06-28 | Common: Cleanup key_map includes. | Emmanuel Gil Peyrot | 1 | -4/+3 | |
2015-06-17 | kernel: Fix svcWaitSynch to always acquire requested wait objects. | bunnei | 1 | -6/+0 | |
2015-05-21 | Kernel: Fix a warning introduced with ResourceLimit, and remove the fallback code to prevent it from happening again. | Emmanuel Gil Peyrot | 1 | -2/+1 | |
2015-05-15 | Core/ResourceLimits: Implemented the basic structure of ResourceLimits. | Subv | 1 | -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. | |||||
2015-05-09 | Kernel: Remove g_program_id | Yuri Kunde Schlesner | 1 | -6/+0 | |
This has been obsoleted by the field in Process. | |||||
2015-05-09 | Kernel: Introduce skeleton Process class to hold process data | Yuri Kunde Schlesner | 1 | -7/+3 | |
2015-05-07 | Common: Remove common.h | Yuri Kunde Schlesner | 1 | -1/+2 | |
2015-05-07 | Move typedefs from kernel.h to more appropriate places | Yuri Kunde Schlesner | 1 | -10/+1 | |
2015-05-02 | Kernel: Properly initialize and shutdown all modules. | bunnei | 1 | -2/+3 | |
2015-02-12 | Build: Fixed some warnings | Subv | 1 | -1/+1 | |
2015-02-02 | Kernel: Make WaitObjects share ownership of Threads waiting on them | Yuri Kunde Schlesner | 1 | -5/+5 | |
During normal operation, a thread waiting on an WaitObject and the object hold mutual references to each other for the duration of the wait. If a process is forcefully terminated (The CTR kernel has a SVC to do this, TerminateProcess, though no equivalent exists for threads.) its threads would also be stopped and destroyed, leaving dangling pointers in the WaitObjects. The solution is to simply have the Thread remove itself from WaitObjects when it is stopped. The vector of Threads in WaitObject has also been changed to hold SharedPtrs, just in case. (Better to have a reference cycle than a crash.) | |||||
2015-02-02 | Kernel: Remove Object::GetHandle (it's not used anymore :D) | Yuri Kunde Schlesner | 1 | -5/+0 | |
2015-02-02 | Kernel: Introduce unique Object ids for debugging | Yuri Kunde Schlesner | 1 | -0/+6 | |
2015-01-30 | Remove result.h InvalidHandle | Yuri Kunde Schlesner | 1 | -1/+2 | |
It was only being used in two places, where it was replaced by a local constant. | |||||
2015-01-30 | Move VAddr/PAddr typedefs to kernel.h | Yuri Kunde Schlesner | 1 | -0/+5 | |
2015-01-22 | Kernel: Renamed some functions for clarity. | bunnei | 1 | -4/+4 | |
- ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads. | |||||
2015-01-22 | Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void. | bunnei | 1 | -6/+3 | |
2015-01-22 | WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual. | bunnei | 1 | -10/+4 | |
2015-01-22 | Session: Change to a WaitObject. | bunnei | 1 | -0/+1 | |
2015-01-22 | Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a WaitObject safely. | bunnei | 1 | -16/+55 | |
2015-01-22 | Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks. | bunnei | 1 | -3/+2 | |
2015-01-22 | WaitSynchronizationN: Refactor to fix several bugs | bunnei | 1 | -6/+6 | |
- Separate wait checking from waiting the current thread - Resume thread when wait_all=true only if all objects are available at once - Set output to correct wait object index when there are duplicate handles | |||||
2015-01-22 | Kernel: Separate WaitSynchronization into Wait and Acquire methods. | bunnei | 1 | -2/+11 | |
2015-01-22 | WaitSynchronizationN: Implement return values | bunnei | 1 | -3/+4 | |
2015-01-22 | WaitObject: Added RemoveWaitingThread, fixed a bug, and cleanup. | bunnei | 1 | -1/+7 | |
2015-01-22 | Kernel: Added WaitObject and changed "waitable" objects inherit from it. | bunnei | 1 | -0/+25 | |
2015-01-09 | Kernel: Start using boost::intrusive_ptr for lifetime management | Yuri Kunde Schlesner | 1 | -8/+13 | |
2015-01-09 | Kernel: Don't re-assign object's handle when duplicating one | Yuri Kunde Schlesner | 1 | -1/+1 | |
2015-01-09 | Thread: Reduce use of Handles and move some funcs to inside the class. | Yuri Kunde Schlesner | 1 | -1/+3 | |
2015-01-09 | SVC: Implemented the Timer service calls. | Subv | 1 | -0/+1 | |
2014-12-28 | Kernel: New handle manager | Yuri Kunde Schlesner | 1 | -81/+109 | |
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-28 | Kernel: Replace GetStaticHandleType by HANDLE_TYPE constants | Yuri Kunde Schlesner | 1 | -1/+1 | |
2014-12-28 | Rename ObjectPool to HandleTable | Yuri Kunde Schlesner | 1 | -6/+6 | |
2014-12-21 | License change | purpasmart96 | 1 | -1/+1 | |
2014-12-20 | Kernel: Implement support for current thread pseudo-handle | Yuri Kunde Schlesner | 1 | -0/+12 | |
This boots a few (mostly Nintendo 1st party) games further. | |||||
2014-12-18 | Filesystem/Archives: Implemented the SaveData archive | Subv | 1 | -0/+6 | |
The savedata for each game is stored in /savedata/<ProgramID> for NCCH files. ELF files and 3DSX files use the folder 0 because they have no ID information Got rid of the code duplication in File and Directory Files that deal with the host machine's file system now live in DiskFile, similarly for directories and DiskDirectory and archives with DiskArchive. FS_U: Use the correct error code when a file wasn't found | |||||
2014-12-15 | Remove SyncRequest from K::Object and create a new K::Session type | Yuri Kunde Schlesner | 1 | -14/+2 | |
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-13 | kernel: Remove unused log arguments | Lioncash | 1 | -3/+3 | |
2014-12-13 | Convert old logging calls to new logging macros | Yuri Kunde Schlesner | 1 | -7/+10 | |
2014-12-04 | kernel: Make some functions const | Lioncash | 1 | -2/+2 | |
2014-11-24 | HLE: Revamp error handling throrough the HLE code | Yuri Kunde Schlesner | 1 | -27/+17 | |
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-19 | Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated | Emmanuel Gil Peyrot | 1 | -5/+5 | |
2014-11-18 | Remove extraneous semicolons | Lioncash | 1 | -1/+1 | |
2014-09-17 | Kernel: Add a Directory object and a getter for it from an Archive object. | Emmanuel Gil Peyrot | 1 | -0/+1 | |
2014-08-19 | Core: Use std::array for managing kernel object space | Lioncash | 1 | -3/+4 | |
These avoid relying on memset for clearing the arrays. | |||||
2014-08-18 | Core: Alter the kernel string functions to use std::string instead of const char*. | Lioncash | 1 | -3/+3 | |
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names. | |||||
2014-07-09 | Kernel: Added preliminary support for address arbiters. | bunnei | 1 | -1/+1 | |
AddressArbiter: Added documentation comment, fixed whitespace issue. AddressArbiter: Fixed incorrect comment, reordered if-statement to be more clear. SVC: Removed trailing whitespace. | |||||
2014-06-27 | Kernel: Added stubbed code to support creation of kernel Archive objects. | bunnei | 1 | -0/+1 | |
2014-06-13 | Kernel: Added freeing of kernel objects on emulator shutdown. | bunnei | 1 | -0/+6 | |
2014-06-13 | Kernel: Updated several member functions to be const | bunnei | 1 | -2/+2 | |
2014-06-13 | Kernel: Made SyncRequest not pure virtual, with a default implementation of error (as this is not required for all kernel objects) | bunnei | 1 | -2/+4 | |
2014-06-03 | kernel: moved position of * for GetTypeName and GetName | bunnei | 1 | -2/+2 | |
2014-06-02 | kernel: changed main thread priority to default, updated Kernel::Reschedule to use PrepareReschedule | bunnei | 1 | -0/+1 | |
2014-05-27 | kernel: added WaitSynchronization method to Kernel::Object | bunnei | 1 | -0/+7 | |
2014-05-27 | kernel: updated SyncRequest to take boolean thread wait result as a parameter | bunnei | 1 | -1/+8 | |
2014-05-27 | kernel: added enum for known CurrentThread and CurrentProcess handles | bunnei | 1 | -0/+5 | |
2014-05-27 | kernel: add a SyncRequest method to KernelObject for use with svcSendSyncRequest | bunnei | 1 | -0/+1 | |
2014-05-23 | kernel: refactored function naming to remove "__" prefix | bunnei | 1 | -2/+7 | |
2014-05-21 | kernel: fixed include, in general include "common.h" not "common_types.h" | bunnei | 1 | -1/+1 | |
2014-05-21 | - created a Kernel namespace | bunnei | 1 | -31/+44 | |
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles | |||||
2014-05-19 | - updated service(s) to be KernelObject's | bunnei | 1 | -4/+5 | |
- various cleanups | |||||
2014-05-19 | - moved Handle/Result definitions to kernel.h | bunnei | 1 | -1/+2 | |
- added ResetType enum | |||||
2014-05-17 | - replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTH | bunnei | 1 | -3/+2 | |
- added KERNEL_DEFAULT_STACK_SIZE definition (0x4000) | |||||
2014-05-16 | changed "UID" to "Handle" to be a little more consistent with CTR naming | bunnei | 1 | -13/+16 | |
2014-05-14 | - added __KernelLoadExec function | bunnei | 1 | -13/+24 | |
- fixed some logging | |||||
2014-05-10 | added initial kernel/thread modules | bunnei | 1 | -0/+121 | |