aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
AgeCommit message (Collapse)Author
2018-08-03kernel/thread: Fix potential crashes introduced in ↵Lioncash
26de4bb521b1ace7af76eff4f6956cb23ac0d58c 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).
2018-08-01kernel: Move object class to its own source filesLioncash
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.
2018-07-31kernel/thread: Remove unimplemented function prototypeLioncash
Given there's no implementation, we may as well remove the code entirely.
2018-07-31kernel: Remove unnecessary includesLioncash
Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
2018-07-21Merge pull request #751 from Subv/tpidr_el0bunnei
CPU: Save and restore the TPIDR_EL0 system register on every context switch
2018-07-20CPU: Save and restore the TPIDR_EL0 system register on every context switch.Subv
Note that there's currently a dynarmic bug preventing this register from being written.
2018-07-19thread: Convert ThreadStatus into an enum classLioncash
Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
2018-06-21Run clang-format on PR.Michael Scire
2018-06-21Kernel/Arbiters: HLE is atomic, adjust code to reflect that.Michael Scire
2018-06-21Kernel/Arbiters: Initialize arb_wait_address in thread struct.Michael Scire
2018-06-21Kernel/Arbiters: Mostly implement SignalToAddressMichael Scire
2018-06-21Kernel/Arbiters: Implement WaitForAddressMichael Scire
2018-06-21Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs.Michael Scire
2018-05-10thread: Rename mask to affinity_masks.bunnei
2018-05-10thread: Implement ChangeCore function.bunnei
2018-05-10core: Implement multicore support.bunnei
2018-04-23Kernel: Implemented mutex priority inheritance.Subv
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.
2018-04-20Kernel: Use 0x2C as default main thread priority for homebrew and lone NRO/NSOsSubv
2018-04-20Kernel: Remove unused ConditionVariable class.Subv
2018-04-20Kernel: Remove old and unused Mutex code.Subv
2018-04-20Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock.Subv
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.
2018-03-18thread: Add THREADSTATUS_WAIT_HLE_EVENT, remove THREADSTATUS_WAIT_ARB.bunnei
2018-02-18kernel: Use Scheduler class for threading.bunnei
2018-02-18kernel: Remove unused address_arbiter code.bunnei
2018-02-18 Kernel/IPC: Add a small delay after each SyncRequest to prevent thread ↵Subv
starvation. 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.
2018-01-10Threads: Added enum values for the Switch's 4 cpu cores and implemented ↵Subv
svcGetInfo(AllowedCpuIdBitmask)
2018-01-08Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback.Subv
2017-12-31thread: Keep track of the initially created handle.bunnei
This is kinda crufty, but we need it for now to update guest state variables.
2017-12-29kernel: Various 64-bit fixes in memory/process/threadbunnei
2017-10-09Merge remote-tracking branch 'upstream/master' into nxbunnei
# 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
2017-10-01Merge pull request #2971 from Subv/per_process_memopsSebastian Valle
Memory: Add overloads for ReadBlock and WriteBlock that operate on a specific process.
2017-10-01Kernel/Thread: Added a helper function to get a thread's command buffer VAddr.Subv
2017-09-30kernel: Various threading fixes to support 64-bit addressing.bunnei
2017-09-30Merge pull request #2967 from Subv/thread_wakeup_callbacksSebastian Valle
Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken
2017-09-30Fixed type conversion ambiguityHuw Pascoe
2017-09-28Kernel/Threads: When putting a thread to wait, specify a function to execute ↵Subv
when it is awoken. 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.
2017-09-26Kernel/Thread: Allow specifying which process a thread belongs to when ↵Subv
creating it. 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.
2017-05-29Kernel: Move WaitObject to a separate fileYuri Kunde Schlesner
Now that HandleTable doesn't directly depend on WaitObject anymore, this can be separated from the main kernel.h header.
2017-05-24Kernel: Centralize error definitions in errors.hYuri Kunde Schlesner
2017-02-26Core: Remove unnecessary include in thread.hYuri Kunde Schlesner
2017-01-06Merge pull request #2410 from Subv/sleepthreadbunnei
Don't yield execution in SleepThread(0) if there are no available threads to run
2017-01-05Kernel: Don't attempt to yield execution in SleepThread(0) if there are no ↵Subv
available threads to run. With this we avoid an useless temporary deschedule of the current thread.
2017-01-05Kernel: Remove some unused functions.Subv
2017-01-05Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all ↵Subv
the objects that a thread is waiting on.
2017-01-04Kernel: Use different thread statuses when a thread calls ↵Subv
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.
2017-01-04Kernel/Mutex: Propagate thread priority changes to other threads inheriting ↵Subv
the priority via mutexes
2017-01-04Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.Subv
This will be useful when implementing mutex priority inheritance.
2016-12-22ThreadContext: Move from "core" to "arm_interface".bunnei
2016-12-21core: Remove HLE module, consolidate code & various cleanups.bunnei
2016-12-17Thread: remove the thread from the thread list when exitingwwylele