aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [video_core, hle] remove redundant parent references in system structs (#3908)lizzie2026-06-231-229/+209
| | | | | | | | | | reworked a bit to remove references of parent objects and instead pass as arguments to methods to prevent useless reloads Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3908 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
* [kernel, hle] Initial 22.0.0 kernel changes and cmd stubs (#3761)maufeat2026-05-051-18/+20
| | | | | | | | | | | | | - KProcess::Run() and CreateThread() SVC now write the current thread handle to TLS+0x110 - KPageTableBase::LockForMapDeviceAddressSpace now checks for a new KPageTableBase boolean, m_allowed_exec_device_mapping - Stub `am` + `acc` + `settings` cmd module that needs to work for qlaunch Thanks to: @alula and @yellows8 Source for changes: https://github.com/Atmosphere-NX/Atmosphere/pull/2744, https://switchbrew.org/, https://yls8.mtheall.com/ Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] unify std::random_device (#3801)lizzie2026-03-311-5/+4
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3801 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [hle, kernel] Add support for FW21 and kernel changes (#3004)lizzie2025-11-161-1069/+1087
| | | | | | | | | | | | | | | | | | | | | | | | - Adapts kernel changes from atmosphere for firmware 21.0.0. - Fixes launch error of firmware 21.0.0 applets. - Adds new commands for `prepo` (New `SaveSystemReport` & `SaveSystemReportWithUser`). - Adds new commands for `IReadOnlyApplicationControlDataInterface` (cmd 19; incomplete!) - Adds `{12010, nullptr, "SetButtonConfigLeft"},` undocumented IHidServer. - Adds new commands for `ngc:u` (`Mask2` and `Check2`) - Adds new commands for system settings server (GetHttpAuthConfig) for webapplet - Removes incompatible firmware popup warning. Signed-off-by: lizzie lizzie@eden-emu.dev Co-authored by: maufeat sahyno1996@gmail.com Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: JPikachu <jpikachu.eden@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3004 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [meta] fix license headers (#2547)lizzie2025-09-211-0/+3
| | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-1/+1
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* kernel: clear pinned waiter list on unpinLiam2024-01-271-1/+2
|
* KThread: Send termination interrupt to all cores a thread has affinity toMerry2024-01-021-4/+4
| | | | | KThread::RequestTerminate may run from a thread which is not the CurrentCore, and thus masking this out is erroneous.
* general: properly support multiple memory instancesLiam2023-12-221-2/+1
|
* core: refactor emulated cpu core activationLiam2023-12-041-46/+34
|
* kernel: signal thread on termination completedLiam2023-10-211-4/+7
|
* kernel: add missing TLR clearLiam2023-10-211-0/+1
|
* kernel: update KProcessLiam2023-10-211-7/+9
|
* Merge pull request #10990 from comex/ubsanliamwhite2023-07-261-1/+1
|\ | | | | Fixes and workarounds to make UBSan happier on macOS
| * Fixes and workarounds to make UBSan happier on macOScomex2023-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | general: Silence -Wshadow{,-uncaptured-local} warningslat9nq2023-07-181-2/+2
|/ | | | These occur in the latest commits in LLVM Clang.
* Remove memory allocations in some hot pathsKelebek12023-06-221-5/+3
|
* k_thread: Use a mutex and cond_var to sync boollat9nq2023-06-171-4/+11
| | | | | std::atomic<bool> is broken on MinGW and causes deadlocks there. Use a normal cond var in its stead.
* memory: rename global memory references to application memoryLiam2023-03-231-3/+8
|
* kernel: use KTypedAddress for addressesLiam2023-03-221-13/+15
|
* kernel: additional style fixes to KThread, KProcessLiam2023-03-121-17/+17
|
* kernel: convert KThread to new styleLiam2023-03-121-244/+239
|
* kernel: prefer std::addressofLiam2023-03-121-2/+2
|
* kernel: remove kernel_Liam2023-03-121-100/+100
|
* Merge pull request #9923 from liamwhite/khtliamwhite2023-03-101-1/+3
|\ | | | | kernel: add timer pointer to KThreadQueue
| * kernel: add timer pointer to KThreadQueueLiam2023-03-071-1/+3
| |
* | kernel: clone fpu status on CreateThreadLiam2023-03-071-1/+23
|/
* kernel: be more careful about kernel address keysLiam2023-03-011-5/+7
|
* kernel: refactor priority inheritance to represent locks as C++ objectsLiam2023-03-011-84/+185
|
* service: refactor server architectureLiam2023-02-211-0/+20
| | | | Converts services to have their own processes
* kernel: use GetCurrentProcessLiam2023-02-131-0/+8
|
* kernel: split SetAddressKey into user and kernel variantsLiam2023-01-231-4/+4
|
* kernel: fix incorrect locking order in suspensionLiam2023-01-231-13/+0
|
* kernel/svc_types: refreshLiam2022-11-091-2/+2
|
* service_thread: register service threads to the logical owner processLiam2022-11-041-2/+2
|
* k_thread: fix single coreLiam2022-10-301-2/+4
|
* kernel: refactor dummy thread wakeupsLiam2022-10-241-20/+18
|
* core: hle: kernel: Use result macros for new/changed code.bunnei2022-10-181-20/+21
|
* core: hle: kernel: k_thread: Implement thread termination DPC.bunnei2022-10-181-0/+76
|
* kernel: Ensure all uses of disable_count are balancedLiam2022-07-141-2/+6
|
* kernel: be more careful about initialization path for HLE threadsLiam2022-07-141-1/+7
|
* kernel: fix single-core preemption pointsLiam2022-07-141-6/+0
|
* kernel: fix issues with single core modeLiam2022-07-141-2/+3
|
* kernel: use KScheduler from mesosphereLiam2022-07-141-2/+9
|
* kernel: fix usage of waiter_list in FinalizeLiam2022-07-091-3/+9
|
* Merge pull request #8502 from liamwhite/end-waitliamwhite2022-07-071-3/+4
|\ | | | | kernel: clean up waiting implementation
| * kernel: clean up waiting implementationLiam2022-06-251-3/+4
| |
* | common/fiber: make fibers easier to useLiam2022-07-021-10/+5
| |
* | core: Replace all instances of ResultCode with Resultgerman772022-06-261-26/+24
| |