summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-01-22Thread: Keep track of multiple wait objects.bunnei1-11/+24
2015-01-22Kernel: Added WaitObject and changed "waitable" objects inherit from it.bunnei1-9/+2
2015-01-11Thread: Prevent waking a thread multiple times.Subv1-0/+3
If a thread was woken up by something, cancel the wakeup timeout.
2015-01-09Kernel: Start using boost::intrusive_ptr for lifetime managementYuri Kunde Schlesner1-33/+30
2015-01-09Thread: Fix nullptr access in a logging functionYuri Kunde Schlesner1-1/+2
2015-01-09Thread: Rename thread_queue => thread_listYuri Kunde Schlesner1-6/+6
2015-01-09Thread: Reduce use of Handles and move some funcs to inside the class.Yuri Kunde Schlesner1-213/+127
2015-01-09Kernel: Move Thread's definition to the header fileYuri Kunde Schlesner1-51/+9
2015-01-09Move ThreadContext to core/core.h and deal with the falloutYuri Kunde Schlesner1-4/+5
2015-01-09SVC: Fixed SleepThread.Subv1-8/+32
It will now properly wait the specified number of nanoseconds and then wake up the thread.
2015-01-08Threads: Use a dummy idle thread when no other are ready.Subv1-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.
2015-01-07Common: Clean up ThreadQueueListYuri Kunde Schlesner1-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.
2014-12-28Kernel: New handle managerYuri Kunde Schlesner1-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.
2014-12-28Kernel: Replace GetStaticHandleType by HANDLE_TYPE constantsYuri Kunde Schlesner1-2/+2
2014-12-28Rename ObjectPool to HandleTableYuri Kunde Schlesner1-11/+11
2014-12-21License changepurpasmart961-1/+1
2014-12-21Thread: Wait current thread on svc_SleepThreadbunnei1-20/+33
- Removed unused VBLANK sleep mode - Added error log for bad context switch - Renamed VerifyWait to CheckWaitType to be more clear
2014-12-20Kernel: Implement support for current thread pseudo-handleYuri Kunde Schlesner1-2/+1
This boots a few (mostly Nintendo 1st party) games further.
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner1-12/+12
2014-12-09Thread: Fixed to wait on address when in arbitration.bunnei1-10/+19
2014-12-07Mutex: Release all held mutexes when a thread exits.Subv1-0/+4
2014-12-04Threads: Remove a redundant function.Subv1-9/+1
Use the next_thread_id variable directly.
2014-12-04Threads: Implemented a sequential thread idSubv1-3/+13
2014-12-04SVC: Implemented GetThreadId.Subv1-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.
2014-11-26Thread: Check that thread is actually in "wait state" when verifying wait.bunnei1-1/+1
2014-11-24Use pointers instead of passing handles around in some functions.Yuri Kunde Schlesner1-19/+15
2014-11-24Remove duplicated docs/update them for changed parameters.Yuri Kunde Schlesner1-5/+0
2014-11-24HLE: Revamp error handling throrough the HLE codeYuri Kunde Schlesner1-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.
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generatedEmmanuel Gil Peyrot1-19/+19
2014-11-19Add static to some variablesLioncash1-22/+22
2014-10-26Add `override` keyword through the code.Yuri Kunde Schlesner1-4/+4
This was automated using `clang-modernize`.
2014-09-09core: Prune redundant includesarchshift1-3/+0
2014-08-31Threading: Fix thread starting to execute first instruction correctly.bunnei1-0/+5
2014-08-28Threading: Fix thread starting to execute first instruction correctly.bunnei1-0/+5
2014-08-18Core: Alter the kernel string functions to use std::string instead of const char*.Lioncash1-10/+7
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
2014-08-07Thread: Added more descriptive comment to WaitCurrentThread.bunnei1-1/+5
2014-07-09Thread: Added functions to resume threads from address arbitration.bunnei1-0/+37
Thread: Cleaned up arbitrate address functions. Thread: Cleaned up ArbitrateAllThreads function.
2014-06-13Thread: Renamed occurrences of "t" to "thread" to improve readability.bunnei1-48/+45
2014-06-13Thread: Cleaned up VerifyWait, fixed issue where nullptr msg could unnecessarily be logged.bunnei1-9/+7
2014-06-13HLE: Removed usnused EatCycles function.bunnei1-9/+0
2014-06-13Thread: Moved position of * in arguments.bunnei1-2/+2
2014-06-13Thread: Updated VerifyWait to be more readable (but functionally the same).bunnei1-4/+3
2014-06-13HLE: Updated all uses of NULL to nullptr (to be C++11 compliant)bunnei1-7/+7
2014-06-13HLE: Updated various handle debug assertions to be more clear.bunnei1-2/+2
2014-06-13Kernel: Updated several member functions to be constbunnei1-3/+3
2014-06-13Thread: Fixed bug with ResetThread where cpu_registers[15] was being incorrectly setbunnei1-1/+1
2014-06-13Kernel: Made SyncRequest not pure virtual, with a default implementation of error (as this is not required for all kernel objects)bunnei1-10/+0
2014-06-13Kernel: Added real support for thread and event blockingbunnei1-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.
2014-06-02svc: added GetThreadPriority and SetThreadPriority, added (incomplete) DuplicateHandle supportbunnei1-0/+45
2014-06-02kernel: changed main thread priority to default, updated Kernel::Reschedule to use PrepareReschedulebunnei1-3/+3
2014-06-01thread: updated Reschedule to sit at a synchronization barrier when no other threads are ready for executionbunnei1-0/+18
2014-05-27kernel: added WaitSynchronization method to Kernel::Objectbunnei1-0/+11
2014-05-27kernel: updated SyncRequest to take boolean thread wait result as a parameterbunnei1-2/+6
2014-05-27kernel: add a SyncRequest method to KernelObject for use with svcSendSyncRequestbunnei1-0/+5
2014-05-23thread: renamed "WaitCurThread" to "WaitCurrentThread", removed unused "reason" argumentbunnei1-2/+2
2014-05-23thread: removed unused SwitchContext/Reschedule reason field, added missing arg parameter to SVC CreateThreadbunnei1-3/+3
2014-05-23kernel: refactored function naming to remove "__" prefixbunnei1-39/+39
2014-05-23thread: moved ThreadStatus/WaitType to header, added support for arg on CreateThread, added correct CPSR resetbunnei1-34/+15
2014-05-22thread: fixed bug where result of __NextThread was not being properly checked when NULLbunnei1-1/+1
2014-05-21thread: added correct lowest thread priority, added a thread priority check, and added some commentsbunnei1-0/+3
2014-05-21thread: exposed ResumeThreadFromWait function for use in other kernel modulesbunnei1-8/+8
2014-05-21thread: moved threading calls to the Kernel namespacebunnei1-89/+95
2014-05-21ARM_Interface: added SaveContext and LoadContext functions for HLE thread switchingbunnei1-36/+2
2014-05-21renamed "syscall" module to "svc" (more accurate naming)bunnei1-1/+1
2014-05-21thread: whitespace change - fixed * and & placementbunnei1-25/+25
2014-05-21- created a Kernel namespacebunnei1-9/+9
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles
2014-05-19- moved Handle/Result definitions to kernel.hbunnei1-2/+0
- added ResetType enum
2014-05-17changed a commentbunnei1-1/+1
2014-05-17- added enum ThreadProcessorIdbunnei1-51/+90
- reorganized some kernel thread functions - added placeholder __KernelWaitThread_Synchronization function
2014-05-17- replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTHbunnei1-4/+5
- added KERNEL_DEFAULT_STACK_SIZE definition (0x4000)
2014-05-16completely gutted/refactored threading code to be simplerbunnei1-616/+228
2014-05-15- added helper function for __KernelCreateThreadbunnei1-4/+70
- added __KernelSwitchToThread for enabling a thread - added __KernelRotateThreadReadyQueue
2014-05-14fixed thread reset to not set stack addressbunnei1-1/+1
2014-05-14various cleanups / remove unused codebunnei1-65/+28
2014-05-14added 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 pointbunnei1-64/+524
2014-05-10added initial kernel/thread modulesbunnei1-0/+228