Commit Graph

302 Commits (2c56e94702e897c609711d82057d8267d8f4d0b3)

Author SHA1 Message Date
Liam 2c56e94702 kernel: make current thread pointer thread local 3 years ago
bunnei 9da4e62573
Merge pull request #8483 from liamwhite/fire-emblem-three-semaphores
kernel: wait for threads to stop on pause
3 years ago
Liam 24d7aaf43c kernel: wait for threads to stop on pause 3 years ago
Liam 744a208763 kernel: fix some uses of disable_count 3 years ago
Liam 888f499188 kernel: implement KProcess suspension 3 years ago
Liam bd38aefc57 kernel: fix passthrough of local captures in lambda 3 years ago
Liam af022294dd CpuManager: simplify pausing 3 years ago
Morph 99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
3 years ago
german77 b2359f1527 hidbus: Implement hidbus and ringcon 3 years ago
bunnei ca2accfb25
Merge pull request #8165 from bunnei/ensure-session-port-cleanup
Kernel: Track open references to KServerPort and KServerSession.
3 years ago
bunnei fd5e1e80da
Merge pull request #8157 from lat9nq/kernel-races
kernel: Fix some data races
3 years ago
bunnei a7f73d606f hle: kernel: Unify and integrate reference tracking for KServerPort/KServerSession.
- These are not managed elsewhere, and need to be tracked and closed on emulation shutdown.
3 years ago
Merry 1f275eb077 core/hle: Replace lock_guard with scoped_lock 3 years ago
lat9nq 5b5a1b7fa7 kernel: Fix current_process race
TSan reported a race at :258 and :803, so make current_process an atomic
pointer.
3 years ago
bunnei 864523327f hle: kernel: Create a default thread for services that do not need their own host thread. 3 years ago
ameerj ade596121b core: Reduce unused includes 3 years ago
bunnei 5f3e77d93e core: hle: kernel: Allocate dummy threads on host thread storage.
- Fixes a crash where on subsequent boots, long-lived host threads would have their dummy threads freed.
3 years ago
bunnei 82a2463062 core: hle: kernel: Downgrade dangling objects warning to debug.
- It is not impossible to leak kernel objects, so this is not really any issue anymore (albeit, still interesting).
3 years ago
bunnei f7d1929816 core: hle: kernel: Make object list container global and ensure it is reset on each emulation session. 3 years ago
bunnei 51589c5e21 core: hle: kernel: Remove server session tracking.
- These are now allocated/managed by emulated memory, so we do not need to track and free them on shutdown.
3 years ago
bunnei a25cd4bb4b core: hle: kernel: Update init_slab_heap, use device memory, and add KThreadLocalPage and KPageBuffer.
- Refreshes our slab initialization code to latest known behavior.
- Moves all guest kernel slabs into emulated device memory.
- Adds KThreadLocalPage and KPageBuffer, which we will use for accurate TLS management.
3 years ago
bunnei 14d28a043d hle: kernel: Re-create memory layout at initialization.
- As this can only be derived once.
3 years ago
bunnei 16e5954fcb hle: kernel: Remove unused pool locals. 3 years ago
bunnei f87f076162 hle: kernel: k_memory_manager: Rework for latest kernel behavior.
- Updates the KMemoryManager implementation against latest documentation.
- Reworks KMemoryLayout to be accessed throughout the kernel.
- Fixes an issue with pool sizes being incorrectly reported.
3 years ago
bunnei ca5e843bf6 core: hle: kernel: Remove resource limit hack for PhysicalMemory.
- With prior changes, we now report the correct amount of physical memory available to the emulated process.
3 years ago
bunnei f6815086a1 hle: kernel: Remove redundant tracking of dummy threads.
- These are already tracked by kernel's registered_objects member.
3 years ago
bunnei b5e83bcc7b
Merge pull request #7701 from bunnei/clear-mem-pages
Kernel Memory Updates (Part 3): Clear KMemoryManager pages & other fixes
3 years ago
bunnei 101d86897b
Merge pull request #7712 from bunnei/fix-thread-exit
Accurately implement thread exit
3 years ago
bunnei b54cbc985e hle: kernel: k_memory_manager: Clear pages on allocation & free.
- Heap pages should be zero'd.
- Also explicitly passed along heap allocation option.
3 years ago
bunnei c905044e1b core: hle: kernel: Instantiate a kernel instance of KWorkerTaskManager. 3 years ago
bunnei cc112f971e hle: kernel: Fix service_threads access to be thread safe V2.
- PR #7699 attempted to fix CreateServiceThread and ReleaseServiceThread to be thread safe, but inadvertently introduced a possible dead-lock.
- With this PR, we use a worker thread to manage the service thread list, allowing it only to be accessed by a single thread, and guaranteeing threads will not destroy themselves.
- Fixes a rare crash in Pokemon Sword/Shield, I've now run this game for ~12 hours non-stop and am quite confident this is a good solution for this issue.
3 years ago
bunnei 2147240e47 hle: kernel: Fix service_threads access to be thread safe.
- CreateServiceThread and ReleaseServiceThread can be accessed by different threads, uses a lock to make this thread safe.
- Fixes a rare crash in Pokemon Sword/Shield that can occur when a new service thread is being created while an old one is being destroyed.
3 years ago
ameerj 55650c5b75 kernel: Manually destroy the current process during shut down
Avoids a memory leak.
3 years ago
FernandoS27 894ed14ebc hle: kernel: fix timing on thread preemption 3 years ago
bunnei abbea575cf hle: kernel: Add a flag for indicating that the kernel is currently shutting down. 3 years ago
bunnei 3239442de6 core: hle: kernel: DisableDispatch on suspend threads. 3 years ago
bunnei 178584e56f core: hle: kernel: Use CurrentPhysicalCoreIndex as appropriate. 3 years ago
bunnei 3bd5d4b6f8 core: hle: kernel: Ensure idle threads are closed before destroying scheduler. 3 years ago
bunnei 669a2d2c67 core: hle: kernel: Reflect non-emulated threads as core 3. 3 years ago
Adam Heinermann d8a783a368 Fix crash on exit due to static scoped dummy threads 3 years ago
ameerj 7c4b6aab2e core: Remove unused includes 3 years ago
Feng Chen dd29285e35 Fix dangling kernel objects when exiting 3 years ago
Feng Chen 052017e189 Revert PR7009 3 years ago
Feng Chen a8b0104923 Fix memory leak 3 years ago
bunnei 0c8594b225
Revert "kernel: Various improvements to scheduler" 4 years ago
Ameer J bed0c3c92a
Merge pull request #6878 from BreadFish64/optimize-GetHostThreadID
kernel: Optimize GetHostThreadID
4 years ago
BreadFish64 14e93f133a kernel: Optimize GetHostThreadID 4 years ago
bunnei 5051d3c415 core: hle: kernel: DisableDispatch on suspend threads. 4 years ago
bunnei 2dfb07388a core: hle: kernel: Use CurrentPhysicalCoreIndex as appropriate. 4 years ago
bunnei 2b9560428b core: hle: kernel: Ensure idle threads are closed before destroying scheduler. 4 years ago