aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_thread.cpp
AgeCommit message (Collapse)Author
2024-01-27kernel: clear pinned waiter list on unpinLiam
2024-01-02KThread: Send termination interrupt to all cores a thread has affinity toMerry
KThread::RequestTerminate may run from a thread which is not the CurrentCore, and thus masking this out is erroneous.
2023-12-22general: properly support multiple memory instancesLiam
2023-12-04core: refactor emulated cpu core activationLiam
2023-10-21kernel: signal thread on termination completedLiam
2023-10-21kernel: add missing TLR clearLiam
2023-10-21kernel: update KProcessLiam
2023-07-26Merge pull request #10990 from comex/ubsanliamwhite
Fixes and workarounds to make UBSan happier on macOS
2023-07-18general: Silence -Wshadow{,-uncaptured-local} warningslat9nq
These occur in the latest commits in LLVM Clang.
2023-07-15Fixes and workarounds to make UBSan happier on macOScomex
There are still some other issues not addressed here, but it's a start. Workarounds for false-positive reports: - `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`, because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp) of how big it thinks objects can be, specifically when dealing with offset-to-top values used with multiple inheritance. Hopefully this doesn't have a performance impact. - `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks is UB even though it at least arguably isn't. See the link in the comment for more information. Fixes for correct reports: - `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to avoid UB from pointer overflow (when pointer arithmetic wraps around the address space). - `KScheduler::Reload`: `thread->GetOwnerProcess()` can be `nullptr`; avoid calling methods on it in this case. (The existing code returns a garbage reference to a field, which is then passed into `LoadWatchpointArray`, and apparently it's never used, so it's harmless in practice but still triggers UBSan.) - `KAutoObject::Close`: This function calls `this->Destroy()`, which overwrites the beginning of the object with junk (specifically a free list pointer). Then it calls `this->UnregisterWithKernel()`. UBSan complains about a type mismatch because the vtable has been overwritten, and I believe this is indeed UB. `UnregisterWithKernel` also loads `m_kernel` from the 'freed' object, which seems to be technically safe (the overwriting doesn't extend as far as that field), but seems dubious. Switch to a `static` method and load `m_kernel` in advance.
2023-06-22Remove memory allocations in some hot pathsKelebek1
2023-06-17k_thread: Use a mutex and cond_var to sync boollat9nq
std::atomic<bool> is broken on MinGW and causes deadlocks there. Use a normal cond var in its stead.
2023-03-23memory: rename global memory references to application memoryLiam
2023-03-22kernel: use KTypedAddress for addressesLiam
2023-03-12kernel: additional style fixes to KThread, KProcessLiam
2023-03-12kernel: convert KThread to new styleLiam
2023-03-12kernel: prefer std::addressofLiam
2023-03-12kernel: remove kernel_Liam
2023-03-10Merge pull request #9923 from liamwhite/khtliamwhite
kernel: add timer pointer to KThreadQueue
2023-03-07kernel: add timer pointer to KThreadQueueLiam
2023-03-07kernel: clone fpu status on CreateThreadLiam
2023-03-01kernel: be more careful about kernel address keysLiam
2023-03-01kernel: refactor priority inheritance to represent locks as C++ objectsLiam
2023-02-21service: refactor server architectureLiam
Converts services to have their own processes
2023-02-13kernel: use GetCurrentProcessLiam
2023-01-23kernel: split SetAddressKey into user and kernel variantsLiam
2023-01-23kernel: fix incorrect locking order in suspensionLiam
2022-11-09kernel/svc_types: refreshLiam
2022-11-04service_thread: register service threads to the logical owner processLiam
2022-10-30k_thread: fix single coreLiam
2022-10-24kernel: refactor dummy thread wakeupsLiam
2022-10-18core: hle: kernel: Use result macros for new/changed code.bunnei
2022-10-18core: hle: kernel: k_thread: Implement thread termination DPC.bunnei
2022-07-14kernel: Ensure all uses of disable_count are balancedLiam
2022-07-14kernel: be more careful about initialization path for HLE threadsLiam
2022-07-14kernel: fix single-core preemption pointsLiam
2022-07-14kernel: fix issues with single core modeLiam
2022-07-14kernel: use KScheduler from mesosphereLiam
2022-07-09kernel: fix usage of waiter_list in FinalizeLiam
2022-07-07Merge pull request #8502 from liamwhite/end-waitliamwhite
kernel: clean up waiting implementation
2022-07-02common/fiber: make fibers easier to useLiam
2022-06-26core: Replace all instances of ResultCode with Resultgerman77
2022-06-25kernel: clean up waiting implementationLiam
2022-06-23kernel: make current thread pointer thread localLiam
2022-06-22Merge pull request #8483 from liamwhite/fire-emblem-three-semaphoresbunnei
kernel: wait for threads to stop on pause
2022-06-18kernel: wait for threads to stop on pauseLiam
2022-06-15kernel: fix some uses of disable_countLiam
2022-06-14kernel: implement KProcess suspensionLiam
2022-06-13common: Change semantics of UNREACHABLE to unconditionally crashLiam
2022-06-01core/debugger: Support reading guest thread namesLiam