Liam
1484a6536d
kernel: clone fpu status on CreateThread
3 years ago
Liam
63414faea4
kernel: be more careful about kernel address keys
3 years ago
Liam
f4e795193b
kernel: refactor priority inheritance to represent locks as C++ objects
3 years ago
Liam
1c3a93e7c4
service: refactor server architecture
Converts services to have their own processes
3 years ago
Liam
832e1e2ca4
kernel: use GetCurrentProcess
3 years ago
Liam
b85a155abd
kernel: split SetAddressKey into user and kernel variants
3 years ago
Liam
31945a6e8b
kernel: fix incorrect locking order in suspension
3 years ago
Liam
affd5c32f9
kernel/svc_types: refresh
3 years ago
Liam
c835c254a3
service_thread: register service threads to the logical owner process
3 years ago
Liam
e9589c859d
k_thread: fix single core
3 years ago
Liam
3980952ab8
kernel: refactor dummy thread wakeups
3 years ago
bunnei
4c2274b2c1
core: hle: kernel: Use result macros for new/changed code.
3 years ago
bunnei
97e4cd1c8f
core: hle: kernel: k_thread: Implement thread termination DPC.
3 years ago
Liam
dbb1312876
kernel: Ensure all uses of disable_count are balanced
4 years ago
Liam
e2be660909
kernel: be more careful about initialization path for HLE threads
4 years ago
Liam
21e2063d7d
kernel: fix single-core preemption points
4 years ago
Liam
61b26b386d
kernel: fix issues with single core mode
4 years ago
Liam
e47bced65d
kernel: use KScheduler from mesosphere
4 years ago
Liam
12948cf615
kernel: fix usage of waiter_list in Finalize
4 years ago
Liam
e551960935
common/fiber: make fibers easier to use
4 years ago
german77
c7890ebccc
core: Replace all instances of ResultCode with Result
4 years ago
Liam
f70a3ada00
kernel: clean up waiting implementation
4 years ago
Liam
83f1ecb73b
kernel: make current thread pointer thread local
4 years ago
Liam
808ad9eb9f
kernel: wait for threads to stop on pause
4 years ago
Liam
6d5cc6b2a2
kernel: fix some uses of disable_count
4 years ago
Liam
59a6d88625
kernel: implement KProcess suspension
4 years ago
Liam
c1771c98f3
common: Change semantics of UNREACHABLE to unconditionally crash
4 years ago
Liam
b3dce90004
core/debugger: Support reading guest thread names
4 years ago
Morph
2b87305d31
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.
4 years ago
bunnei
03f8a16869
core: hle: kernel: k_thread: Rework dummy thread waiting.
4 years ago
lat9nq
831f022536
k_thread: Fix data race
TSan reports a data race between writing at cpp:1162 and reading at
h:262. Make the thread_state atomic to prevent this.
4 years ago
ameerj
22e01068e1
core: Reduce unused includes
4 years ago
bunnei
2b881f4ccc
core: hle: kernel: k_process: Implement thread local storage accurately.
4 years ago
bunnei
84ced13966
core: hle: kernel: k_thread: Ensure host Fiber is freed.
4 years ago
bunnei
a2731424a6
hle: kernel: KThread: Improve Increment/Decrement RunningThreadCount.
- Previously implementation was incorrect, and would occasionally underflow.
4 years ago
bunnei
b3f8d2491d
hle: kernel: KThread: Ensure host (dummy) threads block on locking.
- But do not enter the priority queue, as otherwise they will be scheduled.
- Allows dummy threads to use guest synchronization primitives.
4 years ago
bunnei
f2e870d6b6
hle: kernel: KThread: DummyThread can be waited, ensure wait_queue is not nullptr.
4 years ago
bunnei
668af26696
hle: kernel: KThread: Decrease DummyThread priority to ensure it is never scheduled.
4 years ago
bunnei
247a7e2205
hle: kernel: KThread: Ensure dummy threads never call EndWait.
- These are only used by host threads for locking and will never have a wait_queue.
4 years ago
bunnei
cc4cbff1ca
hle: kernel: KThread: Rename thread_type_for_debugging -> thread_type.
- This will be used to ensure that we do not schedule dummy threads.
4 years ago
bunnei
b52516263d
core: hle: kernel: KThread: Integrate with KWorkerTask and implement DoWorkerTaskImpl.
- This is used to terminate a thread asynchronously after it has been exited.
- This fixes a crash that can occur in Pokemon Sword/Shield because a thread is incorrectly closed on svcExitThread, then, the thread is destroyed on svcCloseHandle while it is still scheduled.
- Instead, we now wait for the thread to no longer be scheduled on all cores before destroying it from KWorkerTaskManager, which is accurate to HOS behavior.
4 years ago
bunnei
914431487b
core: hle: kernel: KThread: Replace Suspend with UpdateState & various updates.
- This makes our implementations of these more closely match HOS.
4 years ago
bunnei
b12695ddc4
core: hle: kernel: Implement thread pinning.
- We largely had the mechanics in place for thread pinning, this change hooks these up.
- Validated with tests https://github.com/Atmosphere-NX/Atmosphere/blob/master/tests/TestSvc/source/test_thread_pinning.cpp .
4 years ago
bunnei
bc45d0fc1a
core: hle: kernel: KThread: X18 should be a cryptographically random number.
- This was added with firmware 11.0.0 (https://switchbrew.org/wiki/11.0.0 ).
- X18 is OR'd by kernel with 1, to make sure it is odd.
4 years ago
bunnei
4b2aa52da9
hle: kernel: Remove unnecessary virtual specifier on CancelWait.
4 years ago
bunnei
b5970145a5
hle: kernel: k_thread: Skip reschedule on DisableDispatch with SC.
4 years ago
bunnei
6d2bf18df9
hle: kernel: k_thread: Rename sleeping_queue -> wait_queue.
4 years ago
bunnei
826b07162a
hle: kernel: k_thread: Treat dummy threads as a special type.
4 years ago
bunnei
58da4d5a6e
hle: kernel: Add a flag for indicating that the kernel is currently shutting down.
4 years ago
bunnei
eb34276885
hle: kernel: Cleanup to match coding style.
4 years ago