Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #1849 from encounter/svcSetThreadActivity | bunnei | 2018-12-26 | 1 | -1/+23 |
|\ | | | | | svc: Implement SetThreadActivity (thread suspension) | ||||
| * | svc: Implement SetThreadActivity (thread suspension) | Luke Street | 2018-12-04 | 1 | -1/+23 |
| | | |||||
* | | kernel/thread: Set default fpcr | MerryMage | 2018-12-18 | 1 | -0/+3 |
|/ | |||||
* | kernel/thread: Deduplicate scheduler switching code | Lioncash | 2018-11-14 | 1 | -37/+11 |
| | | | | | The code in both places was the same verbatim, so we can extract it to a function to deduplicate the logic. | ||||
* | global: Use std::optional instead of boost::optional (#1578) | Frederic L | 2018-10-30 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build | ||||
* | kernel/process: Make the handle table per-process | Lioncash | 2018-10-20 | 1 | -1/+1 |
| | | | | | | | | 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. | ||||
* | core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs | Lioncash | 2018-10-15 | 1 | -8/+8 |
| | |||||
* | thread: Remove unnecessary memset from ResetThreadContext() | Lioncash | 2018-10-12 | 1 | -4/+1 |
| | | | | | | Regular value initialization is adequate here for zeroing out data. It also has the benefit of not invoking undefined behavior if a non-trivial type is ever added to the struct for whatever reason. | ||||
* | kernel/thread: Use a regular pointer for the owner/current process | Lioncash | 2018-10-10 | 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). | ||||
* | thread: Make the scheduler pointer a regular pointer | balika011 | 2018-10-05 | 1 | -3/+3 |
| | | | | | | | | | | | | | | 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. | ||||
* | kernel/thread: Make all instance variables private | Lioncash | 2018-10-04 | 1 | -4/+28 |
| | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | kernel/process: Make data member variables private | Lioncash | 2018-09-30 | 1 | -2/+2 |
| | | | | | | | Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code. | ||||
* | memory: Dehardcode the use of fixed memory range constants | Lioncash | 2018-09-25 | 1 | -1/+2 |
| | | | | | | | | The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state. | ||||
* | thread/process: Move TLS slot marking/freeing to the process class | Lioncash | 2018-09-21 | 1 | -56/+2 |
| | | | | | | Allows making several members of the process class private, it also avoids going through Core::CurrentProcess() just to retrieve the owning process. | ||||
* | kernel/thread: Use owner_process when setting the page table in SetupMainThread() | Lioncash | 2018-09-21 | 1 | -3/+3 |
| | | | | | | | 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. | ||||
* | arm_interface: Remove ARM11-isms from the CPU interface | Lioncash | 2018-09-18 | 1 | -2/+2 |
| | | | | | | | | | This modifies the CPU interface to more accurately match an AArch64-supporting CPU as opposed to an ARM11 one. Two of the methods don't even make sense to keep around for this interface, as Adv Simd is used, rather than the VFP in the primary execution state. This is essentially a modernization change that should have occurred from the get-go. | ||||
* | Port #4182 from Citra: "Prefix all size_t with std::" | fearlessTobi | 2018-09-15 | 1 | -1/+1 |
| | |||||
* | kernel/errors: Correct error codes for invalid thread priority and invalid processor ID | Lioncash | 2018-09-12 | 1 | -2/+2 |
| | |||||
* | core/core: Replace includes with forward declarations where applicable | Lioncash | 2018-08-31 | 1 | -1/+2 |
| | | | | | | | | | | | 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 state | Lioncash | 2018-08-29 | 1 | -101/+18 |
| | | | | | | | | | | | | | | | | | | | | | | 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: Namespace all code in the arm subdirectory under the Core namespace | Lioncash | 2018-08-25 | 1 | -2/+2 |
| | | | | Gets all of these types and interfaces out of the global namespace. | ||||
* | Core::CoreTiming: add UnscheduleEventThreadsafe | B3n30 | 2018-08-13 | 1 | -1/+1 |
| | |||||
* | Merge pull request #1042 from Subv/races | bunnei | 2018-08-13 | 1 | -2/+9 |
|\ | | | | | Fixed a bunch of race conditions when running in multicore mode. | ||||
| * | Kernel/Threads: Lock the HLE mutex when executing the wakeup callback. | Subv | 2018-08-13 | 1 | -0/+5 |
| | | | | | | | | Another thread might be in the middle of a reschedule, thus altering the state of the schedulers. | ||||
| * | Kernel/Thread: Always use the threadsafe option when scheduling wakeups. | Subv | 2018-08-13 | 1 | -2/+4 |
| | | | | | | | | | | | | WakeAfterDelay might be called from any host thread, so err on the side of caution and use the thread-safe CoreTiming::ScheduleEventThreadsafe. Note that CoreTiming is still far from thread-safe, there may be more things we have to work on for it to be up to par with what we want. | ||||
* | | Kernel/Mutex: Don't duplicate threads in the mutex waiter list. | Subv | 2018-08-12 | 1 | -0/+21 |
|/ | | | | | | | | | | Exit from AddMutexWaiter early if the thread is already waiting for a mutex owned by the owner thread. This accounts for the possibility of a thread that is waiting on a condition variable being awakened twice in a row. Also added more validation asserts. This should fix one of the random crashes in Breath Of The Wild. | ||||
* | kernel/thread: Fix potential crashes introduced in 26de4bb521b1ace7af76eff4f6956cb23ac0d58c | Lioncash | 2018-08-04 | 1 | -0/+11 |
| | | | | | | 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). | ||||
* | core/memory: Get rid of 3DS leftovers | Lioncash | 2018-08-03 | 1 | -31/+2 |
| | | | | Removes leftover code from citra that isn't needed. | ||||
* | Merge pull request #894 from lioncash/object | bunnei | 2018-08-03 | 1 | -1/+1 |
|\ | | | | | kernel: Move object class to its own source files | ||||
| * | kernel: Move object class to its own source files | Lioncash | 2018-08-02 | 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. | ||||
* | | kernel/thread: Make GetFreeThreadLocalSlot()'s loop indices size_t | Lioncash | 2018-08-02 | 1 | -8/+5 |
| | | | | | | | | | | | | Avoids using a u32 to compare against a range of size_t, which can be a source of warnings. While we're at it, compress a std::tie into a structured binding. | ||||
* | | kernel/thread: Make GetFreeThreadLocalSlot() reference parameter a const reference | Lioncash | 2018-08-02 | 1 | -1/+2 |
| | | | | | | | | | | This function only reads the data being referenced, it doesn't modify it, so we can turn the reference into a const reference. | ||||
* | | kernel/thread: Make GetFreeThreadLocalSlot() internally linked | Lioncash | 2018-08-02 | 1 | -1/+1 |
|/ | | | | | This function isn't used outside of this translation unit, so we can make it internally linked. | ||||
* | kernel: Remove unnecessary includes | Lioncash | 2018-07-31 | 1 | -2/+4 |
| | | | | | Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included. | ||||
* | core_timing: Split off utility functions into core_timing_util | MerryMage | 2018-07-24 | 1 | -0/+1 |
| | |||||
* | Merge pull request #751 from Subv/tpidr_el0 | bunnei | 2018-07-21 | 1 | -0/+1 |
|\ | | | | | CPU: Save and restore the TPIDR_EL0 system register on every context switch | ||||
| * | CPU: Save and restore the TPIDR_EL0 system register on every context switch. | Subv | 2018-07-21 | 1 | -0/+1 |
| | | | | | | | | Note that there's currently a dynarmic bug preventing this register from being written. | ||||
* | | thread: Convert ThreadStatus into an enum class | Lioncash | 2018-07-20 | 1 | -24/+23 |
|/ | | | | | Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time. | ||||
* | Merge pull request #690 from lioncash/move | bunnei | 2018-07-19 | 1 | -1/+1 |
|\ | | | | | core/memory, core/hle/kernel: Use std::move where applicable | ||||
| * | core/memory, core/hle/kernel: Use std::move where applicable | Lioncash | 2018-07-19 | 1 | -1/+1 |
| | | | | | | | | Avoids pointless copies | ||||
* | | core: Don't construct instance of Core::System, just to access its live instance | Lioncash | 2018-07-19 | 1 | -6/+6 |
|/ | | | | | | | | | This would result in a lot of allocations and related object construction, just to toss it all away immediately after the call. These are definitely not intentional, and it was intended that all of these should have been accessing the static function GetInstance() through the name itself, not constructed instances. | ||||
* | Update clang format | James Rowe | 2018-07-03 | 1 | -1/+1 |
| | |||||
* | Rename logging macro back to LOG_* | James Rowe | 2018-07-03 | 1 | -5/+5 |
| | |||||
* | Kernel/Arbiters: Implement WaitForAddress | Michael Scire | 2018-06-21 | 1 | -0/+6 |
| | |||||
* | Kernel/Threads: A thread waking up by timeout from a WaitProcessWideKey may already have an assigned lock owner. | Subv | 2018-06-02 | 1 | -2/+5 |
| | | | | | | | | | | This situation may happen like so: Thread 1 with low priority calls WaitProcessWideKey with timeout. Thread 2 with high priority calls WaitProcessWideKey without timeout. Thread 3 calls SignalProcessWideKey - Thread 2 acquires the lock and awakens. - Thread 1 can't acquire the lock and is put to sleep with the lock owner being Thread 2. Thread 1's timeout expires, with the lock owner still being set to Thread 2. | ||||
* | Kernel/Thread: Corrected a typo that caused the affinity mask to never be changed. | Subv | 2018-05-31 | 1 | -2/+2 |
| | |||||
* | Kernel/Thread: Corrected a typo in an assert about the processor id. | Subv | 2018-05-30 | 1 | -1/+1 |
| | |||||
* | thread: Rename mask to affinity_masks. | bunnei | 2018-05-11 | 1 | -2/+2 |
| | |||||
* | thread: Support core change on ResumeFromWait and improve ChangeCore. | bunnei | 2018-05-11 | 1 | -37/+68 |
| | |||||
* | thread: Initialize ideal_core and mask members. | bunnei | 2018-05-11 | 1 | -0/+2 |
| | |||||
* | threading: Reschedule only on cores that are necessary. | bunnei | 2018-05-11 | 1 | -1/+1 |
| | |||||
* | thread: Implement ChangeCore function. | bunnei | 2018-05-11 | 1 | -1/+52 |
| | |||||
* | core: Implement multicore support. | bunnei | 2018-05-11 | 1 | -8/+8 |
| | |||||
* | core_timing: Namespace all functions and constants in core_timing's header | Lioncash | 2018-04-30 | 1 | -1/+2 |
| | | | | All of these variables and functions are related to timings and should be within the namespace. | ||||
* | general: Convert assertion macros over to be fmt-compatible | Lioncash | 2018-04-27 | 1 | -2/+2 |
| | |||||
* | kernel: Migrate logging macros to fmt-compatible ones | Lioncash | 2018-04-26 | 1 | -7/+8 |
| | |||||
* | Kernel: Implemented mutex priority inheritance. | Subv | 2018-04-23 | 1 | -2/+39 |
| | | | | | | | 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. | ||||
* | Kernel: Remove unused ConditionVariable class. | Subv | 2018-04-21 | 1 | -9/+0 |
| | |||||
* | Kernel: Remove old and unused Mutex code. | Subv | 2018-04-21 | 1 | -3/+0 |
| | |||||
* | Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock. | Subv | 2018-04-21 | 1 | -1/+12 |
| | | | | | | | | | | 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. | ||||
* | memory: Fix stack region. | bunnei | 2018-03-31 | 1 | -1/+1 |
| | |||||
* | thread: Add THREADSTATUS_WAIT_HLE_EVENT, remove THREADSTATUS_WAIT_ARB. | bunnei | 2018-03-19 | 1 | -18/+3 |
| | |||||
* | kernel: Move stack region outside of application heap. | bunnei | 2018-03-16 | 1 | -1/+1 |
| | |||||
* | MemoryState: Add additional memory states and improve naming. | bunnei | 2018-03-16 | 1 | -1/+1 |
| | |||||
* | core: Move process creation out of global state. | bunnei | 2018-03-14 | 1 | -2/+2 |
| | |||||
* | thread: Clear the process list on shutdown. | Jules Blok | 2018-02-27 | 1 | -1/+3 |
| | |||||
* | kernel: Use Scheduler class for threading. | bunnei | 2018-02-18 | 1 | -155/+14 |
| | |||||
* | kernel: Remove unused address_arbiter code. | bunnei | 2018-02-18 | 1 | -34/+0 |
| | |||||
* | Kernel/IPC: Add a small delay after each SyncRequest to prevent thread starvation. | Subv | 2018-02-18 | 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. | ||||
* | thread: Silence formatting specifier warnings | Lioncash | 2018-02-14 | 1 | -2/+3 |
| | |||||
* | Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback. | Subv | 2018-01-09 | 1 | -8/+17 |
| | |||||
* | CoreTiming: Reworked CoreTiming (cherry-picked from Citra #3119) | B3n30 | 2018-01-09 | 1 | -3/+2 |
| | | | | * CoreTiming: New CoreTiming; Add Test for CoreTiming | ||||
* | arm: Remove SkyEye/Dyncom code that is ARMv6-only. | bunnei | 2018-01-03 | 1 | -4/+2 |
| | |||||
* | thread: Keep track of the initially created handle. | bunnei | 2017-12-31 | 1 | -1/+2 |
| | | | | This is kinda crufty, but we need it for now to update guest state variables. | ||||
* | thread: Main thread should set thread handle to reg 1. | bunnei | 2017-12-30 | 1 | -1/+4 |
| | |||||
* | thread: Remove THUMB mode flag. | bunnei | 2017-12-30 | 1 | -1/+1 |
| | |||||
* | thread: Main thread should be ready by default, all others dormant. | bunnei | 2017-12-30 | 1 | -4/+3 |
| | |||||
* | kernel: Various 64-bit fixes in memory/process/thread | bunnei | 2017-12-29 | 1 | -5/+5 |
| | |||||
* | hle: Use Switch formatted result codes. | bunnei | 2017-11-01 | 1 | -3/+2 |
| | |||||
* | hle: Fix QueryMemory response for MemoryInfo. | bunnei | 2017-10-20 | 1 | -1/+1 |
| | |||||
* | Merge remote-tracking branch 'upstream/master' into nx | bunnei | 2017-10-10 | 1 | -23/+45 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # src/core/CMakeLists.txt # src/core/arm/dynarmic/arm_dynarmic.cpp # src/core/arm/dyncom/arm_dyncom.cpp # src/core/hle/kernel/process.cpp # src/core/hle/kernel/thread.cpp # src/core/hle/kernel/thread.h # src/core/hle/kernel/vm_manager.cpp # src/core/loader/3dsx.cpp # src/core/loader/elf.cpp # src/core/loader/ncch.cpp # src/core/memory.cpp # src/core/memory.h # src/core/memory_setup.h | ||||
| * | Merge pull request #2971 from Subv/per_process_memops | Sebastian Valle | 2017-10-01 | 1 | -0/+6 |
| |\ | | | | | | | Memory: Add overloads for ReadBlock and WriteBlock that operate on a specific process. | ||||
| | * | Kernel/Thread: Added a helper function to get a thread's command buffer VAddr. | Subv | 2017-10-01 | 1 | -0/+6 |
| | | | |||||
| * | | Merge pull request #2967 from Subv/thread_wakeup_callbacks | Sebastian Valle | 2017-09-30 | 1 | -3/+10 |
| |\ \ | | |/ | |/| | Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken | ||||
| | * | Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken. | Subv | 2017-09-28 | 1 | -3/+10 |
| | | | | | | | | | | | | | | | | | | 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. | ||||
| * | | Fixed type conversion ambiguity | Huw Pascoe | 2017-09-30 | 1 | -9/+9 |
| | | | |||||
| * | | Kernel/Thread: Allow specifying which process a thread belongs to when creating it. | Subv | 2017-09-27 | 1 | -8/+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. | ||||
| * | memory: Add GetCurrentPageTable/SetCurrentPageTable | MerryMage | 2017-09-24 | 1 | -7/+4 |
| | | | | | | | | Don't expose Memory::current_page_table as a global. | ||||
| * | Merge pull request #2842 from Subv/switchable_page_table | B3n30 | 2017-09-15 | 1 | -0/+12 |
| |\ | | | | | | | Kernel/Memory: Give each process its own page table and allow switching the current page table upon reschedule | ||||
| | * | Kernel/Threads: Don't clear the CPU instruction cache when performing a context switch from an idle thread into a thread in the same process. | Subv | 2017-09-15 | 1 | -1/+3 |
| | | | | | | | | | | | | We were unnecessarily clearing the cache when going from Process A -> Idle -> Process A, this caused extreme performance regressions. | ||||
| | * | Kernel/Memory: Switch the current page table when a new process is scheduled. | Subv | 2017-09-10 | 1 | -0/+10 |
| | | | |||||
| * | | Kernel/Threads: Don't immediately switch to the new main thread when loading a new process. | Subv | 2017-08-22 | 1 | -5/+1 |
| |/ | | | | | | | | | This is necessary for loading multiple processes at the same time. The main thread will be automatically scheduled when necessary once the scheduler runs. | ||||
* | | loader: Various improvements for NSO/NRO loaders. | bunnei | 2017-10-10 | 1 | -1/+1 |
| | | |||||
* | | kernel: Various threading fixes to support 64-bit addressing. | bunnei | 2017-09-30 | 1 | -3/+3 |
|/ | |||||
* | ResultVal: Remove MoveFrom() | Yuri Kunde Schlesner | 2017-06-19 | 1 | -2/+2 |
| | | | | | Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in case you already have an rvalue. | ||||
* | Kernel: Move HandleTable to a separate file | Yuri Kunde Schlesner | 2017-05-30 | 1 | -0/+1 |
| | |||||
* | Kernel: Centralize error definitions in errors.h | Yuri Kunde Schlesner | 2017-05-25 | 1 | -8/+16 |
| | |||||
* | Threads: Check the process' resource limit for the max allowed priority when creating a thread and remove the priority clamping code. | Subv | 2017-01-11 | 1 | -8/+2 |
| | |||||
* | Thread: Added priority range checking to svcSetThreadPriority and removed priority clamping code from Thread::SetPriority. | Subv | 2017-01-11 | 1 | -18/+2 |
| | |||||
* | Merge pull request #2410 from Subv/sleepthread | bunnei | 2017-01-07 | 1 | -0/+4 |
|\ | | | | | Don't yield execution in SleepThread(0) if there are no available threads to run | ||||
| * | Kernel: Don't attempt to yield execution in SleepThread(0) if there are no available threads to run. | Subv | 2017-01-06 | 1 | -0/+4 |
| | | | | | | | | With this we avoid an useless temporary deschedule of the current thread. | ||||
* | | Merge pull request #2408 from Subv/priority_boosting | bunnei | 2017-01-06 | 1 | -27/+0 |
|\ \ | | | | | | | Kernel: Removed the priority boost code for starved threads. | ||||
| * | | Kernel: Removed the priority boost code for starved threads. | Subv | 2017-01-05 | 1 | -27/+0 |
| |/ | | | | | | | | | | | After hwtesting and reverse engineering the kernel, it was found that the CTROS scheduler performs no priority boosting for threads like this, although some other forms of scheduling priority-starved threads might take place. For example, it was found that hardware interrupts might cause low-priority threads to run if the CPU is preempted in the middle of an SVC handler that deschedules the current (high priority) thread before scheduling it again. | ||||
* / | Kernel: Remove some unused functions. | Subv | 2017-01-05 | 1 | -23/+0 |
|/ | |||||
* | Kernel: Add some asserts to enforce the invariants in the scheduler. | Subv | 2017-01-05 | 1 | -2/+5 |
| | |||||
* | Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on. | Subv | 2017-01-05 | 1 | -0/+5 |
| | |||||
* | Kernel: Use different thread statuses when a thread calls WaitSynchronization1 and WaitSynchronizationN with wait_all = true. | Subv | 2017-01-04 | 1 | -4/+7 |
| | | | | | | | | 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. | ||||
* | Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes | Subv | 2017-01-04 | 1 | -4/+17 |
| | |||||
* | Kernel/Mutex: Implemented priority inheritance. | Subv | 2017-01-04 | 1 | -3/+3 |
| | | | | | | | 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. | Subv | 2017-01-04 | 1 | -3/+3 |
| | | | | This will be useful when implementing mutex priority inheritance. | ||||
* | ThreadContext: Move from "core" to "arm_interface". | bunnei | 2016-12-22 | 1 | -3/+3 |
| | |||||
* | core: Replace "AppCore" nomenclature with just "CPU". | bunnei | 2016-12-22 | 1 | -3/+3 |
| | |||||
* | core: Remove HLE module, consolidate code & various cleanups. | bunnei | 2016-12-22 | 1 | -4/+1 |
| | |||||
* | core: Consolidate core and system state, remove system module & cleanups. | bunnei | 2016-12-22 | 1 | -3/+3 |
| | |||||
* | Thread: remove the thread from the thread list when exiting | wwylele | 2016-12-17 | 1 | -2/+9 |
| | |||||
* | Properly remove a thread from its wait_objects' waitlist when it is awoken by a timeout. | Subv | 2016-12-10 | 1 | -0/+4 |
| | |||||
* | Threading: Reworked the way our scheduler works. | Subv | 2016-12-04 | 1 | -94/+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. | ||||
* | Fix typos | Ricardo de Almeida Gonzaga | 2016-10-20 | 1 | -1/+1 |
| | |||||
* | implement wait tree widget | wwylele | 2016-09-22 | 1 | -0/+4 |
| | |||||
* | Use negative priorities to avoid special-casing the self-include | Yuri Kunde Schlesner | 2016-09-21 | 1 | -1/+1 |
| | |||||
* | Remove empty newlines in #include blocks. | Emmanuel Gil Peyrot | 2016-09-21 | 1 | -3/+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-format | Yuri Kunde Schlesner | 2016-09-19 | 1 | -4/+2 |
| | |||||
* | Sources: Run clang-format on everything. | Emmanuel Gil Peyrot | 2016-09-18 | 1 | -49/+65 |
| | |||||
* | arm: ResetContext shouldn't be part of ARM_Interface. | bunnei | 2016-09-15 | 1 | -1/+17 |
| | |||||
* | Merge pull request #1869 from wwylele/dont-be-lazy | Yuri Kunde Schlesner | 2016-06-29 | 1 | -2/+6 |
|\ | | | | | Switch context to the same thread if necessary | ||||
| * | Switch context on the same thread if necessary | wwylele | 2016-05-30 | 1 | -2/+6 |
| | | |||||
* | | Thread: update timeout when rerunning WaitSynch | wwylele | 2016-06-04 | 1 | -0/+49 |
|/ | |||||
* | Kernel/Thread: Remove use of Memory::GetPointer | MerryMage | 2016-05-21 | 1 | -1/+1 |
| | |||||
* | Set fpscr for new threads | Jannik Vogel | 2016-05-17 | 1 | -0/+2 |
| | |||||
* | Merge pull request #1695 from Subv/tls_alloc | bunnei | 2016-05-13 | 1 | -17/+67 |
|\ | | | | | Kernel/Threads: Dynamically allocate the TLS region for threads. | ||||
| * | Kernel/Threads: Dynamically allocate the TLS region for threads in the BASE region of the linear heap. | Subv | 2016-05-07 | 1 | -17/+67 |
| | | | | | | | | | | | | 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. | ||||
* | | hle: Get rid of global access to g_reschedule | Lioncash | 2016-03-21 | 1 | -1/+2 |
|/ | | | | | This shouldn't be directly exposed if there's already a partial API that operates on it. We can just provide the rest of that API. | ||||
* | SVC: Fixed ArbitrateAddress to behave as it does on hardware. | Subv | 2015-12-28 | 1 | -1/+1 |
| | | | | This was verified with hwtests that i plan to upload later on. | ||||
* | Kernel: Implement svcGetSystemInfo | Yuri Kunde Schlesner | 2015-12-01 | 1 | -0/+3 |
| | | | | | This makes smealum/ctrulib@b96dd51d3349961189d4ab1bc2a5c45deff21c09 work with Citra. | ||||
* | Silence -Wsign-compare warnings. | Rohit Nirmal | 2015-10-07 | 1 | -1/+1 |
| | |||||
* | Kernel: Implement svcGetProcessInfo in a basic way | Yuri Kunde Schlesner | 2015-08-16 | 1 | -1/+3 |
| | | | | | This also adds some basic memory usage accounting. These two types are used by Super Smash Bros. during startup. | ||||
* | dyncom: Rename armdefs.h to armstate.h | Lioncash | 2015-07-26 | 1 | -1/+1 |
| | |||||
* | Kernel/Scheduling: Clean up a thread's wait_objects when its scheduled. | Subv | 2015-07-21 | 1 | -0/+8 |
| | | | | They'll be reset if needed during the next svcWaitSynchronization call (if there's any pending) | ||||
* | Ensure all kernel objects are released during shutdown | Yuri Kunde Schlesner | 2015-07-17 | 1 | -7/+14 |
| | | | | | | | | This commit fixes several kernel object leaks. The most severe of them was threads not being removed from the private handle table used for CoreTiming events. This resulted in Threads never being released, which in turn held references to Process, causing CodeSets to never be freed when loading other applications. | ||||
* | kernel: Fix svcWaitSynch to always acquire requested wait objects. | bunnei | 2015-06-17 | 1 | -50/+26 |
| | |||||
* | Remove every trailing whitespace from the project (but externals). | Emmanuel Gil Peyrot | 2015-05-29 | 1 | -4/+4 |
| | |||||
* | Kernel: Move reschedules from SVCs to actual mechanisms that reschedule. | bunnei | 2015-05-21 | 1 | -0/+6 |
| | |||||
* | Memmap: Re-organize memory function in two files | Yuri Kunde Schlesner | 2015-05-15 | 1 | -1/+1 |
| | | | | | | | 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. | ||||
* | thread: Fix a conditional check in Reschedule | Lioncash | 2015-05-14 | 1 | -1/+1 |
| | |||||
* | Merge pull request #748 from Subv/tls_max | bunnei | 2015-05-12 | 1 | -6/+15 |
|\ | | | | | Core/Memory: Add TLS support for creating up to 300 threads | ||||
| * | Core/Memory: Add TLS support for creating up to 300 threads | Subv | 2015-05-12 | 1 | -6/+15 |
| | | |||||
* | | Merge pull request #751 from yuriks/idle-thread | bunnei | 2015-05-12 | 1 | -27/+19 |
|\ \ | | | | | | | Thread: Remove the idle thread | ||||
| * | | Thread: Remove the idle thread | Yuri Kunde Schlesner | 2015-05-12 | 1 | -27/+19 |
| | | | | | | | | | | | | Instead just use nullptr to represent no thread is active. | ||||
* | | | Merge pull request #757 from Subv/scheduling | bunnei | 2015-05-12 | 1 | -0/+2 |
|\ \ \ | |_|/ |/| | | Core/Scheduling: Prepare the new priority in the thread queue when svcSetPriority is called | ||||
| * | | Core/Scheduling: Prepare the new priority in the thread queue when svcSetPriority is called | Subv | 2015-05-12 | 1 | -0/+2 |
| |/ | |||||
* | | Merge pull request #750 from Subv/process_svc | Yuri Kunde Schlesner | 2015-05-12 | 1 | -0/+2 |
|\ \ | |/ |/| | Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThread | ||||
| * | Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThread | Subv | 2015-05-11 | 1 | -0/+2 |
| | | |||||
* | | Thread: Correctly set main thread initial stack position | Yuri Kunde Schlesner | 2015-05-11 | 1 | -2/+2 |
|/ | |||||
* | fixup! Set the TLS address in the scheduler | Subv | 2015-05-11 | 1 | -2/+5 |
| | |||||
* | Core/Memory: Give every emulated thread it's own TLS area. | Subv | 2015-05-11 | 1 | -1/+9 |
| | | | | | 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. | ||||
* | Memory: Re-organize and rename memory area address constants | Yuri Kunde Schlesner | 2015-05-09 | 1 | -2/+3 |
| | |||||
* | Common: Remove common.h | Yuri Kunde Schlesner | 2015-05-07 | 1 | -1/+3 |
| | |||||
* | Kernel: Properly initialize and shutdown all modules. | bunnei | 2015-05-02 | 1 | -2/+8 |
| | |||||
* | Kernel: Implemented priority inheritance for mutexes. | bunnei | 2015-04-10 | 1 | -3/+7 |
| | |||||
* | Thread: Implement priority boost for starved threads. | bunnei | 2015-04-10 | 1 | -12/+36 |
| | | | | | | SVC: Return correct error code on invalid CreateThread processor ID. SVC: Assert when creating a thread with an invalid userland priority. | ||||
* | Misc cleanup of common and related functions | archshift | 2015-02-20 | 1 | -2/+3 |
| | |||||
* | Asserts: break/crash program, fit to style guide; log.h->assert.h | archshift | 2015-02-11 | 1 | -8/+6 |
| | | | | | | | Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time) As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing) Also removed some GEKKO cruft. | ||||
* | Scheduler refactor Pt. 1 | Kevin Hartman | 2015-02-10 | 1 | -185/+175 |
| | | | | | | | | | | | | | * 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. | ||||
* | Kernel: Stop creating useless Handles during object creation | Yuri Kunde Schlesner | 2015-02-02 | 1 | -8/+0 |
| | | | | | They're finally unnecessary, and will stop cluttering the application's handle table. | ||||
* | Kernel: Make WaitObjects share ownership of Threads waiting on them | Yuri Kunde Schlesner | 2015-02-02 | 1 | -0/+3 |
| | | | | | | | | | | | | | | | | 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.) | ||||
* | Explicitly instantiate constructors/destructors for Kernel objects | Yuri Kunde Schlesner | 2015-02-02 | 1 | -2/+2 |
| | | | | | | 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.) | ||||
* | Mutex: Replace g_mutex_held_locks with a set inside Thread | Yuri Kunde Schlesner | 2015-02-02 | 1 | -0/+3 |
| | |||||
* | Kernel: Introduce unique Object ids for debugging | Yuri Kunde Schlesner | 2015-02-02 | 1 | -5/+5 |
| | |||||
* | Kernel: Use separate Handle tables for CoreTiming userdata | Yuri Kunde Schlesner | 2015-02-02 | 1 | -11/+11 |
| | | | | This is to support the removal of GetHandle soon | ||||
* | Thread: Modernize two functions that slipped through previous rebases | Yuri Kunde Schlesner | 2015-02-02 | 1 | -5/+4 |
| | |||||
* | arm: Clean up ARMul_State | Lioncash | 2015-02-01 | 1 | -1/+1 |
| | | | | Remove unnecessary/unused struct variables. | ||||
* | Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup. | bunnei | 2015-01-22 | 1 | -15/+28 |
| | |||||
* | Thread: Use std::find in CheckWait_WaitObject. | bunnei | 2015-01-22 | 1 | -4/+5 |
| | |||||
* | Mutex: Cleanup and remove redundant code. | bunnei | 2015-01-22 | 1 | -1/+1 |
| | |||||
* | Kernel: Renamed some functions for clarity. | bunnei | 2015-01-22 | 1 | -1/+1 |
| | | | | | - ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads. | ||||
* | Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void. | bunnei | 2015-01-22 | 1 | -7/+5 |
| | |||||
* | WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual. | bunnei | 2015-01-22 | 1 | -2/+2 |
| | |||||
* | Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a WaitObject safely. | bunnei | 2015-01-22 | 1 | -1/+1 |
| | |||||
* | AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that made no sense. | bunnei | 2015-01-22 | 1 | -17/+25 |
| | |||||
* | Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks. | bunnei | 2015-01-22 | 1 | -46/+19 |
| | |||||
* | WaitSynchronizationN: Refactor to fix several bugs | bunnei | 2015-01-22 | 1 | -33/+28 |
| | | | | | | - 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 | ||||
* | Kernel: Separate WaitSynchronization into Wait and Acquire methods. | bunnei | 2015-01-22 | 1 | -1/+5 |
| | |||||
* | WaitSynchronizationN: Implement return values | bunnei | 2015-01-22 | 1 | -19/+75 |
| | |||||
* | Thread: Keep track of multiple wait objects. | bunnei | 2015-01-22 | 1 | -11/+24 |
| | |||||
* | Kernel: Added WaitObject and changed "waitable" objects inherit from it. | bunnei | 2015-01-22 | 1 | -9/+2 |
| | |||||
* | Merge pull request #466 from Subv/wake | bunnei | 2015-01-11 | 1 | -0/+3 |
|\ | | | | | Thread: Prevent waking a thread multiple times. | ||||
| * | Thread: Prevent waking a thread multiple times. | Subv | 2015-01-11 | 1 | -0/+3 |
| | | | | | | | | If a thread was woken up by something, cancel the wakeup timeout. | ||||
* | | Kernel: Start using boost::intrusive_ptr for lifetime management | Yuri Kunde Schlesner | 2015-01-09 | 1 | -33/+30 |
|/ | |||||
* | Thread: Fix nullptr access in a logging function | Yuri Kunde Schlesner | 2015-01-09 | 1 | -1/+2 |
| | |||||
* | Thread: Rename thread_queue => thread_list | Yuri Kunde Schlesner | 2015-01-09 | 1 | -6/+6 |
| | |||||
* | Thread: Reduce use of Handles and move some funcs to inside the class. | Yuri Kunde Schlesner | 2015-01-09 | 1 | -213/+127 |
| | |||||
* | Kernel: Move Thread's definition to the header file | Yuri Kunde Schlesner | 2015-01-09 | 1 | -51/+9 |
| | |||||
* | Move ThreadContext to core/core.h and deal with the fallout | Yuri Kunde Schlesner | 2015-01-09 | 1 | -4/+5 |
| | |||||
* | SVC: Fixed SleepThread. | Subv | 2015-01-09 | 1 | -8/+32 |
| | | | | It will now properly wait the specified number of nanoseconds and then wake up the thread. | ||||
* | Threads: Use a dummy idle thread when no other are ready. | Subv | 2015-01-08 | 1 | -1/+22 |
| | | | | 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. | ||||
* | Common: Clean up ThreadQueueList | Yuri Kunde Schlesner | 2015-01-07 | 1 | -1/+1 |
| | | | | | | | | Replace all the C-style complicated buffer management with a std::deque. In addition to making the code easier to understand it also adds support for non-POD IdTypes. Also clean the rest of the code to follow our code style. | ||||
* | Kernel: New handle manager | Yuri Kunde Schlesner | 2014-12-28 | 1 | -1/+2 |
| | | | | | | | | | | | 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. | ||||
* | Kernel: Replace GetStaticHandleType by HANDLE_TYPE constants | Yuri Kunde Schlesner | 2014-12-28 | 1 | -2/+2 |
| | |||||
* | Rename ObjectPool to HandleTable | Yuri Kunde Schlesner | 2014-12-28 | 1 | -11/+11 |
| | |||||
* | Merge pull request #291 from purpasmart96/license | bunnei | 2014-12-21 | 1 | -1/+1 |
|\ | | | | | License change | ||||
| * | License change | purpasmart96 | 2014-12-21 | 1 | -1/+1 |
| | | |||||
* | | Thread: Wait current thread on svc_SleepThread | bunnei | 2014-12-21 | 1 | -20/+33 |
| | | | | | | | | | | | | - Removed unused VBLANK sleep mode - Added error log for bad context switch - Renamed VerifyWait to CheckWaitType to be more clear | ||||
* | | Kernel: Implement support for current thread pseudo-handle | Yuri Kunde Schlesner | 2014-12-20 | 1 | -2/+1 |
|/ | | | | This boots a few (mostly Nintendo 1st party) games further. | ||||
* | Convert old logging calls to new logging macros | Yuri Kunde Schlesner | 2014-12-13 | 1 | -12/+12 |
| | |||||
* | Merge pull request #256 from Subv/mutex | bunnei | 2014-12-11 | 1 | -0/+4 |
|\ | | | | | Kernel/Mutex: Properly lock the mutex when a thread enters it | ||||
| * | Mutex: Release all held mutexes when a thread exits. | Subv | 2014-12-07 | 1 | -0/+4 |
| | | |||||
* | | Thread: Fixed to wait on address when in arbitration. | bunnei | 2014-12-09 | 1 | -10/+19 |
|/ | |||||
* | Threads: Remove a redundant function. | Subv | 2014-12-04 | 1 | -9/+1 |
| | | | | Use the next_thread_id variable directly. | ||||
* | Threads: Implemented a sequential thread id | Subv | 2014-12-04 | 1 | -3/+13 |
| | |||||
* | SVC: Implemented GetThreadId. | Subv | 2014-12-04 | 1 | -0/+16 |
| | | | | 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. | ||||
* | Thread: Check that thread is actually in "wait state" when verifying wait. | bunnei | 2014-11-26 | 1 | -1/+1 |
| | |||||
* | Use pointers instead of passing handles around in some functions. | Yuri Kunde Schlesner | 2014-11-24 | 1 | -19/+15 |
| | |||||
* | Remove duplicated docs/update them for changed parameters. | Yuri Kunde Schlesner | 2014-11-24 | 1 | -5/+0 |
| | |||||
* | HLE: Revamp error handling throrough the HLE code | Yuri Kunde Schlesner | 2014-11-24 | 1 | -21/+30 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | Merge pull request #211 from linkmauve/master | bunnei | 2014-11-19 | 1 | -19/+19 |
|\ | | | | | Remove trailing spaces from the entire project | ||||
| * | Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated | Emmanuel Gil Peyrot | 2014-11-19 | 1 | -19/+19 |
| | | |||||
* | | Add static to some variables | Lioncash | 2014-11-19 | 1 | -22/+22 |
|/ | |||||
* | Add `override` keyword through the code. | Yuri Kunde Schlesner | 2014-10-26 | 1 | -4/+4 |
| | | | | This was automated using `clang-modernize`. | ||||
* | core: Prune redundant includes | archshift | 2014-09-09 | 1 | -3/+0 |
| | |||||
* | Threading: Fix thread starting to execute first instruction correctly. | bunnei | 2014-08-28 | 1 | -0/+5 |
| | |||||
* | Core: Alter the kernel string functions to use std::string instead of const char*. | Lioncash | 2014-08-18 | 1 | -10/+7 |
| | | | | Most functions already operate on std::strings. This also removes the need to manually null terminate thread names. | ||||
* | Thread: Added more descriptive comment to WaitCurrentThread. | bunnei | 2014-08-07 | 1 | -1/+5 |
| | |||||
* | Thread: Added functions to resume threads from address arbitration. | bunnei | 2014-07-09 | 1 | -0/+37 |
| | | | | | | Thread: Cleaned up arbitrate address functions. Thread: Cleaned up ArbitrateAllThreads function. | ||||
* | Thread: Renamed occurrences of "t" to "thread" to improve readability. | bunnei | 2014-06-13 | 1 | -48/+45 |
| | |||||
* | Thread: Cleaned up VerifyWait, fixed issue where nullptr msg could unnecessarily be logged. | bunnei | 2014-06-13 | 1 | -9/+7 |
| | |||||
* | HLE: Removed usnused EatCycles function. | bunnei | 2014-06-13 | 1 | -9/+0 |
| | |||||
* | Thread: Moved position of * in arguments. | bunnei | 2014-06-13 | 1 | -2/+2 |
| | |||||
* | Thread: Updated VerifyWait to be more readable (but functionally the same). | bunnei | 2014-06-13 | 1 | -4/+3 |
| | |||||
* | HLE: Updated all uses of NULL to nullptr (to be C++11 compliant) | bunnei | 2014-06-13 | 1 | -7/+7 |
| | |||||
* | HLE: Updated various handle debug assertions to be more clear. | bunnei | 2014-06-13 | 1 | -2/+2 |
| | |||||
* | Kernel: Updated several member functions to be const | bunnei | 2014-06-13 | 1 | -3/+3 |
| | |||||
* | Thread: Fixed bug with ResetThread where cpu_registers[15] was being incorrectly set | bunnei | 2014-06-13 | 1 | -1/+1 |
| | |||||
* | Kernel: Made SyncRequest not pure virtual, with a default implementation of error (as this is not required for all kernel objects) | bunnei | 2014-06-13 | 1 | -10/+0 |
| | |||||
* | Kernel: Added real support for thread and event blocking | bunnei | 2014-06-13 | 1 | -33/+88 |
| | | | | | | | | | | | | | - 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. | ||||
* | svc: added GetThreadPriority and SetThreadPriority, added (incomplete) DuplicateHandle support | bunnei | 2014-06-02 | 1 | -0/+45 |
| | |||||
* | kernel: changed main thread priority to default, updated Kernel::Reschedule to use PrepareReschedule | bunnei | 2014-06-02 | 1 | -3/+3 |
| | |||||
* | thread: updated Reschedule to sit at a synchronization barrier when no other threads are ready for execution | bunnei | 2014-06-01 | 1 | -0/+18 |
| | |||||
* | kernel: added WaitSynchronization method to Kernel::Object | bunnei | 2014-05-27 | 1 | -0/+11 |
| | |||||
* | kernel: updated SyncRequest to take boolean thread wait result as a parameter | bunnei | 2014-05-27 | 1 | -2/+6 |
| | |||||
* | kernel: add a SyncRequest method to KernelObject for use with svcSendSyncRequest | bunnei | 2014-05-27 | 1 | -0/+5 |
| | |||||
* | thread: renamed "WaitCurThread" to "WaitCurrentThread", removed unused "reason" argument | bunnei | 2014-05-23 | 1 | -2/+2 |
| | |||||
* | thread: removed unused SwitchContext/Reschedule reason field, added missing arg parameter to SVC CreateThread | bunnei | 2014-05-23 | 1 | -3/+3 |
| | |||||
* | kernel: refactored function naming to remove "__" prefix | bunnei | 2014-05-23 | 1 | -39/+39 |
| | |||||
* | thread: moved ThreadStatus/WaitType to header, added support for arg on CreateThread, added correct CPSR reset | bunnei | 2014-05-23 | 1 | -34/+15 |
| | |||||
* | thread: fixed bug where result of __NextThread was not being properly checked when NULL | bunnei | 2014-05-22 | 1 | -1/+1 |
| | |||||
* | thread: added correct lowest thread priority, added a thread priority check, and added some comments | bunnei | 2014-05-21 | 1 | -0/+3 |
| | |||||
* | thread: exposed ResumeThreadFromWait function for use in other kernel modules | bunnei | 2014-05-21 | 1 | -8/+8 |
| | |||||
* | thread: moved threading calls to the Kernel namespace | bunnei | 2014-05-21 | 1 | -89/+95 |
| | |||||
* | ARM_Interface: added SaveContext and LoadContext functions for HLE thread switching | bunnei | 2014-05-21 | 1 | -36/+2 |
| | |||||
* | renamed "syscall" module to "svc" (more accurate naming) | bunnei | 2014-05-21 | 1 | -1/+1 |
| | |||||
* | thread: whitespace change - fixed * and & placement | bunnei | 2014-05-21 | 1 | -25/+25 |
| | |||||
* | - created a Kernel namespace | bunnei | 2014-05-21 | 1 | -9/+9 |
| | | | | | - cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles | ||||
* | - moved Handle/Result definitions to kernel.h | bunnei | 2014-05-19 | 1 | -2/+0 |
| | | | | - added ResetType enum | ||||
* | changed a comment | bunnei | 2014-05-17 | 1 | -1/+1 |
| | |||||
* | - added enum ThreadProcessorId | bunnei | 2014-05-17 | 1 | -51/+90 |
| | | | | | - reorganized some kernel thread functions - added placeholder __KernelWaitThread_Synchronization function | ||||
* | - replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTH | bunnei | 2014-05-17 | 1 | -4/+5 |
| | | | | - added KERNEL_DEFAULT_STACK_SIZE definition (0x4000) | ||||
* | completely gutted/refactored threading code to be simpler | bunnei | 2014-05-16 | 1 | -616/+228 |
| | |||||
* | - added helper function for __KernelCreateThread | bunnei | 2014-05-15 | 1 | -4/+70 |
| | | | | | - added __KernelSwitchToThread for enabling a thread - added __KernelRotateThreadReadyQueue | ||||
* | fixed thread reset to not set stack address | bunnei | 2014-05-14 | 1 | -1/+1 |
| | |||||
* | various cleanups / remove unused code | bunnei | 2014-05-14 | 1 | -65/+28 |
| | |||||
* | 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 | 2014-05-14 | 1 | -64/+524 |
| | |||||
* | added initial kernel/thread modules | bunnei | 2014-05-10 | 1 | -0/+228 |