aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Kernel: Use different thread statuses when a thread calls ↵Subv2017-01-041-4/+7
| | | | | | | | | | WaitSynchronization1 and WaitSynchronizationN with wait_all = true. 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 ↵Subv2017-01-041-4/+17
| | | | the priority via mutexes
* Kernel/Mutex: Implemented priority inheritance.Subv2017-01-041-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.Subv2017-01-041-3/+3
| | | | This will be useful when implementing mutex priority inheritance.
* ThreadContext: Move from "core" to "arm_interface".bunnei2016-12-221-3/+3
|
* core: Replace "AppCore" nomenclature with just "CPU".bunnei2016-12-221-3/+3
|
* core: Remove HLE module, consolidate code & various cleanups.bunnei2016-12-211-4/+1
|
* core: Consolidate core and system state, remove system module & cleanups.bunnei2016-12-211-3/+3
|
* Thread: remove the thread from the thread list when exitingwwylele2016-12-171-2/+9
|
* Properly remove a thread from its wait_objects' waitlist when it is awoken ↵Subv2016-12-101-0/+4
| | | | by a timeout.
* Threading: Reworked the way our scheduler works.Subv2016-12-031-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 typosRicardo de Almeida Gonzaga2016-10-201-1/+1
|
* implement wait tree widgetwwylele2016-09-221-0/+4
|
* Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner2016-09-211-1/+1
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-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-formatYuri Kunde Schlesner2016-09-181-4/+2
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-49/+65
|
* arm: ResetContext shouldn't be part of ARM_Interface.bunnei2016-09-151-1/+17
|
* Merge pull request #1869 from wwylele/dont-be-lazyYuri Kunde Schlesner2016-06-281-2/+6
|\ | | | | Switch context to the same thread if necessary
| * Switch context on the same thread if necessarywwylele2016-05-301-2/+6
| |
* | Thread: update timeout when rerunning WaitSynchwwylele2016-06-041-0/+49
|/
* Kernel/Thread: Remove use of Memory::GetPointerMerryMage2016-05-211-1/+1
|
* Set fpscr for new threadsJannik Vogel2016-05-171-0/+2
|
* Merge pull request #1695 from Subv/tls_allocbunnei2016-05-121-17/+67
|\ | | | | Kernel/Threads: Dynamically allocate the TLS region for threads.
| * Kernel/Threads: Dynamically allocate the TLS region for threads in the BASE ↵Subv2016-05-071-17/+67
| | | | | | | | | | | | | | | | region of the linear heap. 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_rescheduleLioncash2016-03-211-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.Subv2015-12-271-1/+1
| | | | This was verified with hwtests that i plan to upload later on.
* Kernel: Implement svcGetSystemInfoYuri Kunde Schlesner2015-11-301-0/+3
| | | | | This makes smealum/ctrulib@b96dd51d3349961189d4ab1bc2a5c45deff21c09 work with Citra.
* Silence -Wsign-compare warnings.Rohit Nirmal2015-10-061-1/+1
|
* Kernel: Implement svcGetProcessInfo in a basic wayYuri Kunde Schlesner2015-08-161-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.hLioncash2015-07-251-1/+1
|
* Kernel/Scheduling: Clean up a thread's wait_objects when its scheduled.Subv2015-07-201-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 shutdownYuri Kunde Schlesner2015-07-171-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.bunnei2015-06-161-50/+26
|
* Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot2015-05-291-4/+4
|
* Kernel: Move reschedules from SVCs to actual mechanisms that reschedule.bunnei2015-05-201-0/+6
|
* Memmap: Re-organize memory function in two filesYuri Kunde Schlesner2015-05-151-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 RescheduleLioncash2015-05-141-1/+1
|
* Merge pull request #748 from Subv/tls_maxbunnei2015-05-111-6/+15
|\ | | | | Core/Memory: Add TLS support for creating up to 300 threads
| * Core/Memory: Add TLS support for creating up to 300 threadsSubv2015-05-111-6/+15
| |
* | Merge pull request #751 from yuriks/idle-threadbunnei2015-05-111-27/+19
|\ \ | | | | | | Thread: Remove the idle thread
| * | Thread: Remove the idle threadYuri Kunde Schlesner2015-05-111-27/+19
| | | | | | | | | | | | Instead just use nullptr to represent no thread is active.
* | | Merge pull request #757 from Subv/schedulingbunnei2015-05-111-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 ↵Subv2015-05-111-0/+2
| |/ | | | | | | svcSetPriority is called
* | Merge pull request #750 from Subv/process_svcYuri Kunde Schlesner2015-05-111-0/+2
|\ \ | |/ |/| Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThread
| * Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThreadSubv2015-05-111-0/+2
| |
* | Thread: Correctly set main thread initial stack positionYuri Kunde Schlesner2015-05-111-2/+2
|/
* fixup! Set the TLS address in the schedulerSubv2015-05-101-2/+5
|
* Core/Memory: Give every emulated thread it's own TLS area.Subv2015-05-101-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 constantsYuri Kunde Schlesner2015-05-091-2/+3
|