Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2021-12-31 | core: hle: kernel: Implement thread pinning. | bunnei | 1 | -1/+5 | |
- We largely had the mechanics in place for thread pinning, this change hooks these up. - Validated with tests https://github.com/Atmosphere-NX/Atmosphere/blob/master/tests/TestSvc/source/test_thread_pinning.cpp. | |||||
2021-12-07 | hle: kernel: k_thread: Rename sleeping_queue -> wait_queue. | bunnei | 1 | -6/+2 | |
2021-12-07 | hle: kernel: k_thread: Treat dummy threads as a special type. | bunnei | 1 | -0/+1 | |
2021-12-07 | hle: kernel: Add a flag for indicating that the kernel is currently shutting down. | bunnei | 1 | -0/+4 | |
2021-12-07 | hle: kernel: Cleanup to match coding style. | bunnei | 1 | -2/+2 | |
2021-12-07 | hle: kernel: KThread: Migrate to updated KThreadQueue (part 1). | bunnei | 1 | -2/+2 | |
2021-12-07 | hle: kernel: KThread: Remove tracking of sync object from threads. | bunnei | 1 | -12/+0 | |
2021-12-07 | hle: kernel: Update KThreadQueue and migrate KSynchronizationObject. | bunnei | 1 | -0/+27 | |
2021-12-07 | core: hle: kernel: Disable dispatch count tracking on single core. | bunnei | 1 | -3/+8 | |
- This would have limited value, and would be a mess to handle properly. | |||||
2021-12-07 | core: hle: kernel: k_thread: Mark KScopedDisableDispatch as nodiscard. | bunnei | 1 | -1/+1 | |
2021-12-07 | core: hle: kernel: k_thread: Add KScopedDisableDispatch. | bunnei | 1 | -0/+31 | |
2021-08-26 | Revert "kernel: Various improvements to scheduler" | bunnei | 1 | -36/+0 | |
2021-08-14 | core: hle: kernel: Disable dispatch count tracking on single core. | bunnei | 1 | -3/+8 | |
- This would have limited value, and would be a mess to handle properly. | |||||
2021-08-07 | core: hle: kernel: k_thread: Mark KScopedDisableDispatch as nodiscard. | bunnei | 1 | -1/+1 | |
2021-08-07 | core: hle: kernel: k_thread: Add KScopedDisableDispatch. | bunnei | 1 | -0/+31 | |
2021-06-02 | general: Replace RESULT_SUCCESS with ResultSuccess | Morph | 1 | -1/+1 | |
Transition to PascalCase for result names. | |||||
2021-05-29 | kernel: Add missing override specifiers | Lioncash | 1 | -5/+5 | |
Over the course of the kernel refactoring a tiny bit of missing overrides slipped through review, so we can add these. While we're at it, we can remove redundant virtual keywords where applicable as well. | |||||
2021-05-08 | kernel: Eliminate variable shadowing | Lioncash | 1 | -3/+3 | |
Now that the large kernel refactor is merged, we can eliminate the remaining variable shadowing cases. | |||||
2021-05-06 | hle: kernel: Rename Process to KProcess. | bunnei | 1 | -8/+8 | |
2021-05-06 | hle: kernel: Remove deprecated Object class. | bunnei | 1 | -15/+0 | |
2021-05-06 | hle: kernel: Migrate KThread to KAutoObject. | bunnei | 1 | -57/+43 | |
2021-04-12 | k_thread: Remove [[nodiscard]] attribute from ClearWaitCancelled() | Lioncash | 1 | -1/+1 | |
This function has a void return value, so this attribute doesn't apply to it. | |||||
2021-03-21 | hle: kernel: Migrate some code from Common::SpinLock to KSpinLock. | bunnei | 1 | -2/+2 | |
2021-03-06 | hle: kernel: KThread: Rework dummy threads & fix memory leak. | bunnei | 1 | -4/+20 | |
- Dummy threads are created on thread local storage for all host threads. - Fixes a leak by removing creation of fibers, which are not applicable here. | |||||
2021-03-06 | Revert "core: Switch to unique_ptr for usage of Common::Fiber." | bunnei | 1 | -8/+2 | |
2021-02-27 | core: Switch to unique_ptr for usage of Common::Fiber. | bunnei | 1 | -2/+8 | |
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer. | |||||
2021-01-29 | yuzu: debugger: Ignore HLE threads. | bunnei | 1 | -0/+5 | |
2021-01-29 | hle: kernel: KScheduler: Introduce thread context_guard. | bunnei | 1 | -0/+1 | |
2021-01-29 | hle: kernel: Recode implementation of KThread to be more accurate. | bunnei | 1 | -282/+308 | |
2021-01-29 | hle: kernel: KThread: Clean up thread priorities. | bunnei | 1 | -22/+0 | |
2021-01-29 | hle: kernel: KThread: Reorganize thread priority defaults. | bunnei | 1 | -9/+3 | |
2021-01-29 | hle: kernel: KThread: Fix ThreadType definition. | bunnei | 1 | -4/+7 | |
2021-01-29 | hle: kernel: Move single core "phantom mode" out of KThread. | bunnei | 1 | -9/+0 | |
- This is a workaround that does not belong in a kernel primitive. | |||||
2021-01-29 | hle: kernel: KThread: Remove thread types that do not exist. | bunnei | 1 | -13/+2 | |
2021-01-29 | core: hle: kernel: Rename Thread to KThread. | bunnei | 1 | -33/+32 | |
2021-01-11 | hle: kernel: thread: Preserve thread wait reason for debugging only. | bunnei | 1 | -0/+21 | |
- This is decoupled from core functionality and used for debugging only. | |||||
2021-01-11 | core: hle: Integrate new KConditionVariable and KAddressArbiter implementations. | bunnei | 1 | -121/+197 | |
2021-01-11 | hle: kernel: thread: Replace ThreadStatus/ThreadSchedStatus with a single ThreadState. | bunnei | 1 | -41/+34 | |
- This is how the real kernel works, and is more accurate and simpler. | |||||
2021-01-11 | core: hle: kernel: Update KSynchronizationObject. | bunnei | 1 | -85/+46 | |
2020-12-06 | hle: kernel: Thread: Various style fixes based on code review feedback. | bunnei | 1 | -22/+25 | |
2020-12-06 | hle: kernel: Rewrite scheduler implementation based on Mesopshere. | bunnei | 1 | -27/+80 | |
2020-12-06 | hle: kernel: Port KAffinityMask from Mesosphere. | bunnei | 1 | -3/+3 | |
2020-11-29 | hle: kernel: thread: Remove unused "Running" state. | bunnei | 1 | -1/+0 | |
2020-11-29 | hle: kernel: multicore: Replace n-JITs impl. with 4 JITs. | bunnei | 1 | -5/+0 | |
2020-10-21 | Revert "core: Fix clang build" | bunnei | 1 | -3/+3 | |
2020-10-18 | core: Fix clang build | Lioncash | 1 | -3/+3 | |
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795 | |||||
2020-07-16 | kernel/thread: Remove unimplemented function prototype | Lioncash | 1 | -2/+0 | |
This isn't used, so it can be removed. | |||||
2020-07-15 | kernel/thread: Remove global GetCurrentThread() | Lioncash | 1 | -5/+0 | |
This is only used in one place, so we can fold it into the calling code, eliminating a place for the global system instance to be used. | |||||
2020-06-27 | Kernel: Correct Host Context on Threads and Scheduler. | Fernando Sahmkow | 1 | -1/+1 | |
2020-06-27 | General: Cleanup legacy code. | Fernando Sahmkow | 1 | -55/+1 | |
2020-06-27 | HLE_IPC: Correct HLE Event behavior on timeout. | Fernando Sahmkow | 1 | -0/+9 | |
2020-06-27 | Thread: Release the ARM Interface on exitting. | Fernando Sahmkow | 1 | -0/+5 | |
2020-06-27 | General: Move ARM_Interface into Threads. | Fernando Sahmkow | 1 | -1/+7 | |
2020-06-27 | SingleCore: Move Host Timing from a sepparate thread to main cpu thread. | Fernando Sahmkow | 1 | -0/+9 | |
2020-06-27 | General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running. | Fernando Sahmkow | 1 | -0/+18 | |
2020-06-27 | Kernel: Rewind on SVC change. | Fernando Sahmkow | 1 | -0/+10 | |
2020-06-27 | Kernel: Preempt Single core on redudant yields. | Fernando Sahmkow | 1 | -4/+5 | |
2020-06-27 | Scheduler: Correct yields. | Fernando Sahmkow | 1 | -0/+4 | |
2020-06-27 | SVC: Correct SetThreadActivity. | Fernando Sahmkow | 1 | -8/+14 | |
2020-06-27 | SCC: Small corrections to CancelSynchronization | Fernando Sahmkow | 1 | -0/+9 | |
2020-06-27 | SVC: Correct svcWaitForAddress and svcSignalToAddress. | Fernando Sahmkow | 1 | -0/+9 | |
2020-06-27 | Kernel: Correct Signal on Thread Death and Setup Sync Objects on Thread for Debugging | Fernando Sahmkow | 1 | -7/+7 | |
2020-06-27 | Core: Correct HLE Event Callbacks and other issues. | Fernando Sahmkow | 1 | -7/+9 | |
2020-06-27 | SVC: Correct SendSyncRequest. | Fernando Sahmkow | 1 | -29/+53 | |
2020-06-27 | SVC: Correct SignalEvent, ClearEvent, ResetSignal, WaitSynchronization, CancelSynchronization, ArbitrateLock | Fernando Sahmkow | 1 | -2/+15 | |
2020-06-27 | SVC: Correct GetThreadPriority, SetThreadPriority, GetThreadCoreMask, SetThreadCoreMask, GetCurrentProcessorNumber | Fernando Sahmkow | 1 | -2/+1 | |
2020-06-27 | SVC: Correct CreateThread, StartThread, ExitThread, SleepThread. | Fernando Sahmkow | 1 | -4/+8 | |
2020-06-27 | General: Recover Prometheus project from harddrive failure | Fernando Sahmkow | 1 | -14/+67 | |
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system. | |||||
2020-03-03 | core: Implement separate A32/A64 ARM interfaces. | bunnei | 1 | -6/+16 | |
2020-02-22 | Kernel: Rename ThreadCallbackHandleTable and Setup Thread Ids on Kernel. | Fernando Sahmkow | 1 | -1/+5 | |
2020-02-11 | Kernel: Refactor synchronization to better match RE | Fernando Sahmkow | 1 | -0/+1 | |
2020-02-11 | Kernel: Change WaitObject to Synchronization object. In order to better reflect RE. | Fernando Sahmkow | 1 | -11/+11 | |
2019-11-25 | kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154) | bunnei | 1 | -19/+20 | |
* 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-11-16 | Kernel: Correct Cancel Synchronization. | Fernando Sahmkow | 1 | -0/+9 | |
This commit corrects the behavior of cancel synchronization when the thread is running/ready and ensures the next wait is cancelled as it's suppose to. | |||||
2019-10-15 | Kernel Thread: Cleanup THREADPROCESSORID_DONT_UPDATE. | Fernando Sahmkow | 1 | -3/+0 | |
2019-10-15 | Kernel: Address Feedback 2 | Fernando Sahmkow | 1 | -6/+3 | |
2019-10-15 | Kernel: Address Feedback. | Fernando Sahmkow | 1 | -4/+12 | |
2019-10-15 | Kernel: Corrections to Wait Objects clearing in which a thread could still be signalled after a timeout or a cancel. | Fernando Sahmkow | 1 | -0/+3 | |
2019-10-15 | Kernel: Clang Format | Fernando Sahmkow | 1 | -1/+1 | |
2019-10-15 | Scheduler: Implement Yield Count and Core migration on Thread Preemption. | Fernando Sahmkow | 1 | -0/+9 | |
2019-10-15 | Scheduler: Add protections for Yield bombing | Fernando Sahmkow | 1 | -3/+3 | |
In case of redundant yields, the scheduler will now idle the core for it's timeslice, in order to avoid continuously yielding the same thing over and over. | |||||
2019-10-15 | Kernel: Style and Corrections | Fernando Sahmkow | 1 | -5/+10 | |
2019-10-15 | Addapt thread class to the new Scheduler | Fernando Sahmkow | 1 | -1/+54 | |
2019-07-04 | kernel/process: Decouple TLS handling from threads | Lioncash | 1 | -15/+1 | |
Extracts out all of the thread local storage management from thread instances themselves and makes the owning process handle the management of the memory. This brings the memory management slightly more in line with how the kernel handles these allocations. Furthermore, this also makes the TLS page management a little more readable compared to the lingering implementation that was carried over from Citra. | |||||
2019-04-29 | kernel/thread: Update thread processor ID flags | Lioncash | 1 | -6/+15 | |
Adds the missing flags to the enum and documents them. | |||||
2019-04-17 | kernel/thread: Unify wait synchronization types | Lioncash | 1 | -15/+13 | |
This is a holdover from Citra, where the 3DS has both WaitSynchronization1 and WaitSynchronizationN. The switch only has one form of wait synchronizing (literally WaitSynchonization). This allows us to throw out code that doesn't apply at all to the Switch kernel. Because of this unnecessary dichotomy within the wait synchronization utilities, we were also neglecting to properly handle waiting on multiple objects. While we're at it, we can also scrub out any lingering references to WaitSynchronization1/WaitSynchronizationN in comments, and change them to WaitSynchronization (or remove them if the mention no longer applies). | |||||
2019-04-17 | kernel/svc: Migrate svcCancelSynchronization behavior to a thread function | Lioncash | 1 | -3/+9 | |
The actual behavior of this function is slightly more complex than what we're currently doing within the supervisor call. To avoid dumping most of this behavior in the supervisor call itself, we can migrate this to another function. | |||||
2019-04-15 | svc: Specify handle value in thread's name | Lioncash | 1 | -0/+5 | |
Allows the handle to be seen alongside the entry point. | |||||
2019-04-15 | kernel/thread: Remove BoostPriority() | Lioncash | 1 | -6/+0 | |
This is a holdover from Citra that currently remains unused, so it can be removed from the Thread interface. | |||||
2019-04-14 | kernel/thread: Remove unused guest_handle member variable | Lioncash | 1 | -7/+0 | |
This member variable is entirely unused. It was only set but never actually utilized. Given that, we can remove it to get rid of noise in the thread interface. | |||||
2019-04-11 | kernel: Make handle type declarations constexpr | Lioncash | 1 | -1/+1 | |
Some objects declare their handle type as const, while others declare it as constexpr. This makes the const ones constexpr for consistency, and prevent unexpected compilation errors if these happen to be attempted to be used within a constexpr context. | |||||
2019-04-02 | kernel/thread: Make AllWaitObjectsReady() a const qualified member function | Lioncash | 1 | -1/+1 | |
Now that ShouldWait() is a const qualified member function, this one can be made const qualified as well, since it can handle passing a const qualified this pointer to ShouldWait(). | |||||
2019-04-02 | kernel/wait_object: Make ShouldWait() take thread members by pointer-to-const | Lioncash | 1 | -1/+1 | |
Given this is intended as a querying function, it doesn't make sense to allow the implementer to modify the state of the given thread. | |||||
2019-04-01 | kernel/thread: Make parameter of GetWaitObjectIndex() const qualified | Lioncash | 1 | -1/+1 | |
The pointed to member is never actually modified, so it can be made const. | |||||
2019-03-20 | Add CondVar Thread State. | Fernando Sahmkow | 1 | -1/+2 | |
2019-03-16 | kernel/thread: Move thread exiting logic from ExitCurrentThread to svcExitThread | Lioncash | 1 | -5/+0 | |
Puts the operation on global state in the same places as the rest of the svc calls. | |||||
2019-03-16 | kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interface | Lioncash | 1 | -5/+3 | |
Rather than make a global accessor for this sort of thing. We can make it a part of the thread interface itself. This allows getting rid of a hidden global accessor in the kernel code. | |||||
2019-03-16 | kernel/thread: Expand documentation of nominal_priority and current_priority | Lioncash | 1 | -2/+8 | |
Aims to disambiguate why each priority instance exists a little bit. While we're at it, also add an explanatory comment to UpdatePriority(). | |||||
2018-12-28 | kernel: Rename 'default' CPU core to 'ideal' core | Lioncash | 1 | -6/+6 | |
This makes the naming more closely match its meaning. It's just a preferred core, not a required default core. This also makes the usages of this term consistent across the thread and process implementations. | |||||
2018-12-28 | kernel/thread: Move process thread initialization into process.cpp | Lioncash | 1 | -11/+0 | |
This function isn't a general purpose function that should be exposed to everything, given it's specific to initializing the main thread for a Process instance. Given that, it's a tad bit more sensible to place this within process.cpp, which keeps it visible only to the code that actually needs it. | |||||
2018-12-19 | kernel/thread: Make thread_id a 64-bit value | Lioncash | 1 | -2/+2 | |
The kernel uses a 64-bit value for the thread ID, so we shouldn't be using a 32-bit value. | |||||
2018-12-19 | Moved backtrace to ArmInterface | David Marcec | 1 | -5/+0 | |
2018-12-04 | svc: Implement SetThreadActivity (thread suspension) | Luke Street | 1 | -0/+14 | |
2018-12-03 | Print backtrace on svcBreak | David Marcec | 1 | -0/+5 | |
When we get an svcBreak we get a backtrace now | |||||
2018-11-22 | scheduler: Add explanations for YieldWith and WithoutLoadBalancing | Zach Hilman | 1 | -4/+0 | |
2018-11-19 | svc: Implement yield types 0 and -1 | Zach Hilman | 1 | -0/+5 | |
2018-11-14 | kernel/thread: Deduplicate scheduler switching code | Lioncash | 1 | -0/+2 | |
The code in both places was the same verbatim, so we can extract it to a function to deduplicate the logic. | |||||
2018-10-26 | svc: Implement svcGetInfo command 0xF0000002 | Lioncash | 1 | -1/+10 | |
This retrieves: if (curr_thread == handle_thread) { result = total_thread_ticks + (hardware_tick_count - last_context_switch_ticks); } else if (curr_thread == handle_thread && sub_id == current_core_index) { result = hardware_tick_count - last_context_switch_ticks; } | |||||
2018-10-10 | kernel/thread: Use a regular pointer for the owner/current process | Lioncash | 1 | -4/+4 | |
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-10-05 | thread: Make the scheduler pointer a regular pointer | balika011 | 1 | -1/+1 | |
Conceptually, it doesn't make sense for a thread to be able to persist the lifetime of a scheduler. A scheduler should be taking care of the threads; the threads should not be taking care of the scheduler. If the threads outlive the scheduler (or we simply don't actually terminate/shutdown the threads), then it should be considered a bug that we need to fix. Attributing this to balika011, as they opened #1317 to attempt to fix this in a similar way, but my refactoring of the kernel code caused quite a few conflicts. | |||||
2018-10-04 | kernel/thread: Make all instance variables private | Lioncash | 1 | -35/+181 | |
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. | |||||
2018-09-21 | thread/process: Move TLS slot marking/freeing to the process class | Lioncash | 1 | -1/+12 | |
Allows making several members of the process class private, it also avoids going through Core::CurrentProcess() just to retrieve the owning process. | |||||
2018-09-21 | kernel/thread: Use owner_process when setting the page table in SetupMainThread() | Lioncash | 1 | -1/+1 | |
The owning process of a thread is required to exist before the thread, so we can enforce this API-wise by using a reference. We can also avoid the reliance on the system instance by using that parameter to access the page table that needs to be set. | |||||
2018-09-15 | Port #4182 from Citra: "Prefix all size_t with std::" | fearlessTobi | 1 | -1/+1 | |
2018-09-13 | kernel/thread: Include thread-related enums within the kernel namespace | Lioncash | 1 | -6/+6 | |
Previously, these were sitting outside of the Kernel namespace, which doesn't really make sense, given they're related to the Thread class which is within the Kernel namespace. | |||||
2018-08-29 | kernel: Eliminate kernel global state | Lioncash | 1 | -14/+8 | |
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-25 | core: Namespace all code in the arm subdirectory under the Core namespace | Lioncash | 1 | -1/+1 | |
Gets all of these types and interfaces out of the global namespace. | |||||
2018-08-04 | kernel/thread: Fix potential crashes introduced in 26de4bb521b1ace7af76eff4f6956cb23ac0d58c | Lioncash | 1 | -0/+2 | |
This amends cases where crashes can occur that were missed due to the odd way the previous code was set up (using 3DS memory regions that don't exist). | |||||
2018-08-02 | kernel: Move object class to its own source files | Lioncash | 1 | -1/+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-08-01 | kernel/thread: Remove unimplemented function prototype | Lioncash | 1 | -6/+0 | |
Given there's no implementation, we may as well remove the code entirely. | |||||
2018-07-31 | kernel: Remove unnecessary includes | Lioncash | 1 | -3/+2 | |
Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included. | |||||
2018-07-21 | CPU: Save and restore the TPIDR_EL0 system register on every context switch. | Subv | 1 | -0/+9 | |
Note that there's currently a dynarmic bug preventing this register from being written. | |||||
2018-07-20 | thread: Convert ThreadStatus into an enum class | Lioncash | 1 | -14/+14 | |
Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time. | |||||
2018-06-22 | Run clang-format on PR. | Michael Scire | 1 | -2/+2 | |
2018-06-22 | Kernel/Arbiters: HLE is atomic, adjust code to reflect that. | Michael Scire | 1 | -1/+0 | |
2018-06-21 | Kernel/Arbiters: Initialize arb_wait_address in thread struct. | Michael Scire | 1 | -1/+1 | |
2018-06-21 | Kernel/Arbiters: Mostly implement SignalToAddress | Michael Scire | 1 | -2/+4 | |
2018-06-21 | Kernel/Arbiters: Implement WaitForAddress | Michael Scire | 1 | -2/+4 | |
2018-06-21 | Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs. | Michael Scire | 1 | -0/+1 | |
2018-05-11 | thread: Rename mask to affinity_masks. | bunnei | 1 | -1/+1 | |
2018-05-11 | thread: Implement ChangeCore function. | bunnei | 1 | -0/+6 | |
2018-05-11 | core: Implement multicore support. | bunnei | 1 | -0/+4 | |
2018-04-23 | Kernel: Implemented mutex priority inheritance. | Subv | 1 | -0/+15 | |
Verified with a hwtest and implemented based on reverse engineering. Thread A's priority will get bumped to the highest priority among all the threads that are waiting for a mutex that A holds. Once A releases the mutex and ownership is transferred to B, A's priority will return to normal and B's priority will be bumped. | |||||
2018-04-21 | Kernel: Use 0x2C as default main thread priority for homebrew and lone NRO/NSOs | Subv | 1 | -1/+1 | |
2018-04-21 | Kernel: Remove unused ConditionVariable class. | Subv | 1 | -6/+0 | |
2018-04-21 | Kernel: Remove old and unused Mutex code. | Subv | 1 | -7/+0 | |
2018-04-21 | Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock. | Subv | 1 | -1/+5 | |
Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case. Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock. TODO: * Fix svcWaitProcessWideKey * Fix svcSignalProcessWideKey * Remove the Mutex class. | |||||
2018-03-19 | thread: Add THREADSTATUS_WAIT_HLE_EVENT, remove THREADSTATUS_WAIT_ARB. | bunnei | 1 | -1/+1 | |
2018-02-18 | kernel: Use Scheduler class for threading. | bunnei | 1 | -15/+0 | |
2018-02-18 | kernel: Remove unused address_arbiter code. | bunnei | 1 | -12/+0 | |
2018-02-18 | Kernel/IPC: Add a small delay after each SyncRequest to prevent thread starvation. | Subv | 1 | -0/+1 | |
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. | |||||
2018-01-10 | Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask) | Subv | 1 | -4/+9 | |
2018-01-09 | Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback. | Subv | 1 | -3/+7 | |
2017-12-31 | thread: Keep track of the initially created handle. | bunnei | 1 | -0/+3 | |
This is kinda crufty, but we need it for now to update guest state variables. | |||||
2017-12-29 | kernel: Various 64-bit fixes in memory/process/thread | bunnei | 1 | -2/+2 | |
2017-10-01 | Kernel/Thread: Added a helper function to get a thread's command buffer VAddr. | Subv | 1 | -0/+6 | |
2017-09-30 | kernel: Various threading fixes to support 64-bit addressing. | bunnei | 1 | -5/+5 | |
2017-09-30 | Fixed type conversion ambiguity | Huw Pascoe | 1 | -7/+7 | |
2017-09-28 | Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken. | Subv | 1 | -3/+12 | |
This change makes for a clearer (less confusing) path of execution in the scheduler, now the code to execute when a thread awakes is closer to the code that puts the thread to sleep (WaitSynch1, WaitSynchN). It also allows us to implement the special wake up behavior of ReplyAndReceive without hacking up WaitObject::WakeupAllWaitingThreads. If savestates are desired in the future, we can change this implementation to one similar to the CoreTiming event system, where we first register the callback functions at startup and assign their identifiers to the Thread callback variable instead of directly assigning a lambda to the wake up callback variable. | |||||
2017-09-27 | Kernel/Thread: Allow specifying which process a thread belongs to when creating it. | Subv | 1 | -6/+9 | |
Don't automatically assume that Thread::Create will only be called when the parent process is currently scheduled. This assumption will be broken when applets or system modules are loaded. | |||||
2017-05-30 | Kernel: Move WaitObject to a separate file | Yuri Kunde Schlesner | 1 | -0/+1 | |
Now that HandleTable doesn't directly depend on WaitObject anymore, this can be separated from the main kernel.h header. | |||||
2017-05-25 | Kernel: Centralize error definitions in errors.h | Yuri Kunde Schlesner | 1 | -1/+1 | |
2017-02-27 | Core: Remove unnecessary include in thread.h | Yuri Kunde Schlesner | 1 | -1/+0 | |
2017-01-06 | Kernel: Don't attempt to yield execution in SleepThread(0) if there are no available threads to run. | Subv | 1 | -0/+5 | |
With this we avoid an useless temporary deschedule of the current thread. | |||||
2017-01-05 | Kernel: Remove some unused functions. | Subv | 1 | -9/+0 | |
2017-01-05 | Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on. | Subv | 1 | -9/+7 | |
2017-01-04 | Kernel: Use different thread statuses when a thread calls WaitSynchronization1 and WaitSynchronizationN with wait_all = true. | Subv | 1 | -9/+10 | |
This commit removes the overly general THREADSTATUS_WAIT_SYNCH and replaces it with two more granular statuses: THREADSTATUS_WAIT_SYNCH_ANY when a thread waits on objects via WaitSynchronization1 or WaitSynchronizationN with wait_all = false. THREADSTATUS_WAIT_SYNCH_ALL when a thread waits on objects via WaitSynchronizationN with wait_all = true. | |||||
2017-01-04 | Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes | Subv | 1 | -0/+9 | |
2017-01-04 | Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter. | Subv | 1 | -2/+2 | |
This will be useful when implementing mutex priority inheritance. | |||||
2016-12-22 | ThreadContext: Move from "core" to "arm_interface". | bunnei | 1 | -1/+2 | |
2016-12-22 | core: Remove HLE module, consolidate code & various cleanups. | bunnei | 1 | -1/+0 | |
2016-12-17 | Thread: remove the thread from the thread list when exiting | wwylele | 1 | -0/+5 | |
2016-12-14 | Fixed the codestyle to match our clang-format rules. | Subv | 1 | -4/+6 | |
2016-12-09 | WaitSynch: Removed unused variables and reduced SharedPtr copies. | Subv | 1 | -2/+3 | |
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-04 | Threading: Added some utility functions and const correctness. | Subv | 1 | -3/+16 | |
2016-12-04 | Threading: Reworked the way our scheduler works. | Subv | 1 | -6/+16 | |
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-09-22 | implement wait tree widget | wwylele | 1 | -0/+5 | |
2016-09-21 | Remove empty newlines in #include blocks. | Emmanuel Gil Peyrot | 1 | -4/+0 | |
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. | |||||
2016-09-18 | Sources: Run clang-format on everything. | Emmanuel Gil Peyrot | 1 | -32/+46 | |
2016-05-07 | Kernel/Threads: Dynamically allocate the TLS region for threads in the BASE region of the linear heap. | Subv | 1 | -2/+2 | |
Each thread gets a 0x200-byte area from the 0x1000-sized page, when all 8 thread slots in a single page are used up, the kernel allocates a new page to hold another 8 entries. This is consistent with what the real kernel does. | |||||
2015-09-10 | General: Fix up doxygen comments | Lioncash | 1 | -1/+0 | |
2015-06-28 | Common: Cleanup key_map includes. | Emmanuel Gil Peyrot | 1 | -0/+1 | |
2015-06-17 | kernel: Fix svcWaitSynch to always acquire requested wait objects. | bunnei | 1 | -9/+5 | |
2015-05-29 | Remove every trailing whitespace from the project (but externals). | Emmanuel Gil Peyrot | 1 | -1/+1 | |
2015-05-15 | Memmap: Re-organize memory function in two files | Yuri Kunde Schlesner | 1 | -1/+0 | |
memory.cpp/h contains definitions related to acessing memory and configuring the address space mem_map.cpp/h contains higher-level definitions related to configuring the address space accoording to the kernel and allocating memory. | |||||
2015-05-12 | Thread: Remove the idle thread | Yuri Kunde Schlesner | 1 | -17/+0 | |
Instead just use nullptr to represent no thread is active. | |||||
2015-05-12 | Core/Memory: Add TLS support for creating up to 300 threads | Subv | 1 | -1/+1 | |
2015-05-11 | Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThread | Subv | 1 | -0/+2 | |
2015-05-11 | Thread: Correctly set main thread initial stack position | Yuri Kunde Schlesner | 1 | -2/+1 | |
2015-05-11 | fixup! Set the TLS address in the scheduler | Subv | 1 | -0/+2 | |
2015-05-11 | Core/Memory: Give every emulated thread it's own TLS area. | Subv | 1 | -0/+6 | |
The TLS area for thread T with id Ti is located at TLS_AREA_VADDR + (Ti - 1) * 0x200. This allows some games like Mario Kart 7 to continue further. | |||||
2015-05-09 | Kernel: Remove unused g_main_thread variable | Yuri Kunde Schlesner | 1 | -2/+0 | |
2015-04-10 | Kernel: Implemented priority inheritance for mutexes. | bunnei | 1 | -0/+6 | |
2015-04-10 | Thread: Implement priority boost for starved threads. | bunnei | 1 | -10/+15 | |
SVC: Return correct error code on invalid CreateThread processor ID. SVC: Assert when creating a thread with an invalid userland priority. | |||||
2015-04-10 | Kernel: Fixed default thread priority. | bunnei | 1 | -4/+3 | |
2015-02-10 | Scheduler refactor Pt. 1 | Kevin Hartman | 1 | -33/+82 | |
* Simplifies scheduling logic, specifically regarding thread status. It should be much clearer which statuses are valid for a thread at any given point in the system. * Removes dead code from thread.cpp. * Moves the implementation of resetting a ThreadContext to the corresponding core's implementation. Other changes: * Fixed comments in arm interfaces. * Updated comments in thread.cpp * Removed confusing, useless, functions like MakeReady() and ChangeStatus() from thread.cpp. * Removed stack_size from Thread. In the CTR kernel, the thread's stack would be allocated before thread creation. | |||||
2015-02-02 | Kernel: Make WaitObjects share ownership of Threads waiting on them | Yuri Kunde Schlesner | 1 | -0/+2 | |
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 | Explicitly instantiate constructors/destructors for Kernel objects | Yuri Kunde Schlesner | 1 | -0/+1 | |
This should speed up compile times a bit, as well as enable more liberal use of forward declarations. (Due to SharedPtr not trying to emit the destructor anymore.) | |||||
2015-02-02 | Mutex: Replace g_mutex_held_locks with a set inside Thread | Yuri Kunde Schlesner | 1 | -2/+8 | |
2015-02-02 | Kernel: Use separate Handle tables for CoreTiming userdata | Yuri Kunde Schlesner | 1 | -0/+3 | |
This is to support the removal of GetHandle soon | |||||
2015-02-02 | Thread: Modernize two functions that slipped through previous rebases | Yuri Kunde Schlesner | 1 | -8/+7 | |
2015-01-30 | Kernel: Mark all appropriate kernel objects as "final" | Yuri Kunde Schlesner | 1 | -2/+1 | |
2015-01-22 | Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup. | bunnei | 1 | -7/+14 | |
2015-01-22 | Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void. | bunnei | 1 | -2/+2 | |
2015-01-22 | WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual. | bunnei | 1 | -1/+1 | |
2015-01-22 | Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a WaitObject safely. | bunnei | 1 | -1/+1 | |
2015-01-22 | AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that made no sense. | bunnei | 1 | -9/+8 | |
2015-01-22 | Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks. | bunnei | 1 | -31/+10 | |
2015-01-22 | WaitSynchronizationN: Refactor to fix several bugs | bunnei | 1 | -2/+2 | |
- 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 | -1/+2 | |
2015-01-22 | WaitSynchronizationN: Implement return values | bunnei | 1 | -16/+42 | |
2015-01-22 | Thread: Keep track of multiple wait objects. | bunnei | 1 | -3/+3 | |
2015-01-22 | Kernel: Added WaitObject and changed "waitable" objects inherit from it. | bunnei | 1 | -3/+1 | |
2015-01-20 | core: Fix a few docstrings | Lioncash | 1 | -1/+1 | |
2015-01-09 | Kernel: Start using boost::intrusive_ptr for lifetime management | Yuri Kunde Schlesner | 1 | -4/+4 | |
2015-01-09 | Thread: Reduce use of Handles and move some funcs to inside the class. | Yuri Kunde Schlesner | 1 | -46/+22 | |
2015-01-09 | Kernel: Move Thread's definition to the header file | Yuri Kunde Schlesner | 1 | -0/+57 | |
2015-01-09 | SVC: Implemented the Timer service calls. | Subv | 1 | -0/+1 | |
2015-01-09 | SVC: Fixed SleepThread. | Subv | 1 | -0/+7 | |
It will now properly wait the specified number of nanoseconds and then wake up the thread. | |||||
2015-01-08 | Threads: Use a dummy idle thread when no other are ready. | Subv | 1 | -0/+11 | |
This thread will not actually execute instructions, it will only advance the timing/events and try to yield immediately to the next ready thread, if there aren't any ready threads then it will be rescheduled and start its job again. | |||||
2014-12-28 | Kernel: New handle manager | Yuri Kunde Schlesner | 1 | -3/+0 | |
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-21 | License change | purpasmart96 | 1 | -1/+1 | |
2014-12-21 | Thread: Wait current thread on svc_SleepThread | bunnei | 1 | -1/+0 | |
- Removed unused VBLANK sleep mode - Added error log for bad context switch - Renamed VerifyWait to CheckWaitType to be more clear | |||||
2014-12-20 | Kernel: Implement support for current thread pseudo-handle | Yuri Kunde Schlesner | 1 | -0/+3 | |
This boots a few (mostly Nintendo 1st party) games further. | |||||
2014-12-09 | Thread: Fixed to wait on address when in arbitration. | bunnei | 1 | -0/+11 | |
2014-12-04 | Threads: Implemented a sequential thread id | Subv | 1 | -1/+6 | |
2014-12-04 | SVC: Implemented GetThreadId. | Subv | 1 | -0/+3 | |
For now threads are using their Handle value as their Id, it should not really cause any problems because Handle values are unique in Citra, but it should be changed. I left a ToDo there because this is not correct behavior as per hardware. | |||||
2014-11-24 | HLE: Revamp error handling throrough the HLE code | Yuri Kunde Schlesner | 1 | -3/+4 | |
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 | -1/+1 | |
2014-08-07 | Thread: Added more descriptive comment to WaitCurrentThread. | bunnei | 1 | -1/+5 | |
2014-07-09 | Thread: Added functions to resume threads from address arbitration. | bunnei | 1 | -0/+7 | |
Thread: Cleaned up arbitrate address functions. Thread: Cleaned up ArbitrateAllThreads function. | |||||
2014-06-13 | Kernel: Added real support for thread and event blocking | bunnei | 1 | -3/+6 | |
- SVC: Added ExitThread support - SVC: Added SignalEvent support - Thread: Added WAITTYPE_EVENT for waiting threads for event signals - Thread: Added support for blocking on other threads to finish (e.g. Thread::Join) - Thread: Added debug function for printing current threads ready for execution - Thread: Removed hack/broken thread ready state code from Kernel::Reschedule - Mutex: Moved WaitCurrentThread from SVC to Mutex::WaitSynchronization - Event: Added support for blocking threads on event signalling Kernel: Added missing algorithm #include for use of std::find on non-Windows platforms. | |||||
2014-06-02 | svc: added GetThreadPriority and SetThreadPriority, added (incomplete) DuplicateHandle support | bunnei | 1 | -0/+6 | |
2014-05-23 | thread: renamed "WaitCurThread" to "WaitCurrentThread", removed unused "reason" argument | bunnei | 1 | -2/+2 | |
2014-05-23 | thread: removed unused SwitchContext/Reschedule reason field, added missing arg parameter to SVC CreateThread | bunnei | 1 | -1/+1 | |
2014-05-23 | kernel: refactored function naming to remove "__" prefix | bunnei | 1 | -2/+2 | |
2014-05-23 | thread: moved ThreadStatus/WaitType to header, added support for arg on CreateThread, added correct CPSR reset | bunnei | 1 | -1/+25 | |
2014-05-21 | thread: added correct lowest thread priority, added a thread priority check, and added some comments | bunnei | 1 | -6/+7 | |
2014-05-21 | thread: exposed ResumeThreadFromWait function for use in other kernel modules | bunnei | 1 | -0/+3 | |
2014-05-21 | thread: moved threading calls to the Kernel namespace | bunnei | 1 | -9/+17 | |
2014-05-21 | thread: whitespace change - fixed * and & placement | bunnei | 1 | -2/+2 | |
2014-05-21 | - created a Kernel namespace | bunnei | 1 | -2/+2 | |
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles | |||||
2014-05-20 | thread: added declaration for __KernelReschedule to be used by syscall module | bunnei | 1 | -0/+3 | |
2014-05-17 | changed a comment | bunnei | 1 | -1/+1 | |
2014-05-17 | - added enum ThreadProcessorId | bunnei | 1 | -2/+17 | |
- reorganized some kernel thread functions - added placeholder __KernelWaitThread_Synchronization function | |||||
2014-05-17 | - replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTH | bunnei | 1 | -1/+5 | |
- added KERNEL_DEFAULT_STACK_SIZE definition (0x4000) | |||||
2014-05-16 | completely gutted/refactored threading code to be simpler | bunnei | 1 | -42/+2 | |
2014-05-15 | - added helper function for __KernelCreateThread | bunnei | 1 | -0/+6 | |
- added __KernelSwitchToThread for enabling a thread - added __KernelRotateThreadReadyQueue | |||||
2014-05-14 | various cleanups / remove unused code | bunnei | 1 | -0/+1 | |
2014-05-14 | added a bunch of threading code, recycled from PPSSPP, with lots of hacks in for 3DS... doesn't really do much yet. Just a jumping off point | bunnei | 1 | -6/+19 | |
2014-05-10 | added initial kernel/thread modules | bunnei | 1 | -0/+36 | |