aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Common: Remove common.hYuri Kunde Schlesner2015-05-071-1/+3
|
* Kernel: Properly initialize and shutdown all modules.bunnei2015-05-011-2/+8
|
* Kernel: Implemented priority inheritance for mutexes.bunnei2015-04-091-3/+7
|
* Thread: Implement priority boost for starved threads.bunnei2015-04-091-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 functionsarchshift2015-02-191-2/+3
|
* Asserts: break/crash program, fit to style guide; log.h->assert.harchshift2015-02-101-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. 1Kevin Hartman2015-02-091-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 creationYuri Kunde Schlesner2015-02-021-8/+0
| | | | | They're finally unnecessary, and will stop cluttering the application's handle table.
* Kernel: Make WaitObjects share ownership of Threads waiting on themYuri Kunde Schlesner2015-02-021-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 objectsYuri Kunde Schlesner2015-02-021-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 ThreadYuri Kunde Schlesner2015-02-021-0/+3
|
* Kernel: Introduce unique Object ids for debuggingYuri Kunde Schlesner2015-02-021-5/+5
|
* Kernel: Use separate Handle tables for CoreTiming userdataYuri Kunde Schlesner2015-02-021-11/+11
| | | | This is to support the removal of GetHandle soon
* Thread: Modernize two functions that slipped through previous rebasesYuri Kunde Schlesner2015-02-021-5/+4
|
* arm: Clean up ARMul_StateLioncash2015-01-311-1/+1
| | | | Remove unnecessary/unused struct variables.
* Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup.bunnei2015-01-211-15/+28
|
* Thread: Use std::find in CheckWait_WaitObject.bunnei2015-01-211-4/+5
|
* Mutex: Cleanup and remove redundant code.bunnei2015-01-211-1/+1
|
* Kernel: Renamed some functions for clarity.bunnei2015-01-211-1/+1
| | | | | - ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
* Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.bunnei2015-01-211-7/+5
|
* WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" ↵bunnei2015-01-211-2/+2
| | | | pure virtual.
* Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a ↵bunnei2015-01-211-1/+1
| | | | WaitObject safely.
* AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that ↵bunnei2015-01-211-17/+25
| | | | made no sense.
* Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks.bunnei2015-01-211-46/+19
|
* WaitSynchronizationN: Refactor to fix several bugsbunnei2015-01-211-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.bunnei2015-01-211-1/+5
|
* WaitSynchronizationN: Implement return valuesbunnei2015-01-211-19/+75
|
* Thread: Keep track of multiple wait objects.bunnei2015-01-211-11/+24
|
* Kernel: Added WaitObject and changed "waitable" objects inherit from it.bunnei2015-01-211-9/+2
|