aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
AgeCommit message (Collapse)Author
2015-12-27SVC: Fixed ArbitrateAddress to behave as it does on hardware.Subv
This was verified with hwtests that i plan to upload later on.
2015-11-30Kernel: Implement svcGetSystemInfoYuri Kunde Schlesner
This makes smealum/ctrulib@b96dd51d3349961189d4ab1bc2a5c45deff21c09 work with Citra.
2015-10-06Silence -Wsign-compare warnings.Rohit Nirmal
2015-08-16Kernel: Implement svcGetProcessInfo in a basic wayYuri Kunde Schlesner
This also adds some basic memory usage accounting. These two types are used by Super Smash Bros. during startup.
2015-07-25dyncom: Rename armdefs.h to armstate.hLioncash
2015-07-20Kernel/Scheduling: Clean up a thread's wait_objects when its scheduled.Subv
They'll be reset if needed during the next svcWaitSynchronization call (if there's any pending)
2015-07-17Ensure all kernel objects are released during shutdownYuri Kunde Schlesner
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.
2015-06-16kernel: Fix svcWaitSynch to always acquire requested wait objects.bunnei
2015-05-29Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot
2015-05-20Kernel: Move reschedules from SVCs to actual mechanisms that reschedule.bunnei
2015-05-15Memmap: Re-organize memory function in two filesYuri Kunde Schlesner
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-14thread: Fix a conditional check in RescheduleLioncash
2015-05-11Merge pull request #748 from Subv/tls_maxbunnei
Core/Memory: Add TLS support for creating up to 300 threads
2015-05-11Merge pull request #751 from yuriks/idle-threadbunnei
Thread: Remove the idle thread
2015-05-11Merge pull request #757 from Subv/schedulingbunnei
Core/Scheduling: Prepare the new priority in the thread queue when svcSetPriority is called
2015-05-11Thread: Remove the idle threadYuri Kunde Schlesner
Instead just use nullptr to represent no thread is active.
2015-05-11Core/Memory: Add TLS support for creating up to 300 threadsSubv
2015-05-11Merge pull request #750 from Subv/process_svcYuri Kunde Schlesner
Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThread
2015-05-11Core/Scheduling: Prepare the new priority in the thread queue when ↵Subv
svcSetPriority is called
2015-05-11Core/HLE: Implemented the SVCs GetProcessId and GetProcessIdOfThreadSubv
2015-05-11Thread: Correctly set main thread initial stack positionYuri Kunde Schlesner
2015-05-10fixup! Set the TLS address in the schedulerSubv
2015-05-10Core/Memory: Give every emulated thread it's own TLS area.Subv
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-09Memory: Re-organize and rename memory area address constantsYuri Kunde Schlesner
2015-05-07Common: Remove common.hYuri Kunde Schlesner
2015-05-01Kernel: Properly initialize and shutdown all modules.bunnei
2015-04-09Kernel: Implemented priority inheritance for mutexes.bunnei
2015-04-09Thread: Implement priority boost for starved threads.bunnei
SVC: Return correct error code on invalid CreateThread processor ID. SVC: Assert when creating a thread with an invalid userland priority.
2015-02-19Misc cleanup of common and related functionsarchshift
2015-02-10Asserts: break/crash program, fit to style guide; log.h->assert.harchshift
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.
2015-02-09Scheduler refactor Pt. 1Kevin Hartman
* 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-02Kernel: Stop creating useless Handles during object creationYuri Kunde Schlesner
They're finally unnecessary, and will stop cluttering the application's handle table.
2015-02-02Kernel: Make WaitObjects share ownership of Threads waiting on themYuri Kunde Schlesner
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-02Explicitly instantiate constructors/destructors for Kernel objectsYuri Kunde Schlesner
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-02Mutex: Replace g_mutex_held_locks with a set inside ThreadYuri Kunde Schlesner
2015-02-02Kernel: Introduce unique Object ids for debuggingYuri Kunde Schlesner
2015-02-02Kernel: Use separate Handle tables for CoreTiming userdataYuri Kunde Schlesner
This is to support the removal of GetHandle soon
2015-02-02Thread: Modernize two functions that slipped through previous rebasesYuri Kunde Schlesner
2015-01-31arm: Clean up ARMul_StateLioncash
Remove unnecessary/unused struct variables.
2015-01-21Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup.bunnei
2015-01-21Thread: Use std::find in CheckWait_WaitObject.bunnei
2015-01-21Mutex: Cleanup and remove redundant code.bunnei
2015-01-21Kernel: Renamed some functions for clarity.bunnei
- ReleaseNextThread->WakeupNextThread - ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
2015-01-21Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.bunnei
2015-01-21WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" ↵bunnei
pure virtual.
2015-01-21Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a ↵bunnei
WaitObject safely.
2015-01-21AddressArbiter: Changed to Kernel::Object, big cleanup, removed code that ↵bunnei
made no sense.
2015-01-21Kernel: Get rid of WaitTypes and simplify lots of code, removing hacks.bunnei
2015-01-21WaitSynchronizationN: Refactor to fix several bugsbunnei
- 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-21Kernel: Separate WaitSynchronization into Wait and Acquire methods.bunnei