bunnei
7240568f00
Merge pull request #7737 from bunnei/fix-dummy-thread-leak
...
Various fixes to HLE service thread management
2022-01-21 22:34:47 -08:00
bunnei
606e643378
Merge pull request #7752 from Morph1984/SetCpuOverclockEnabled
...
service: apm: Stub ISession SetCpuOverclockEnabled
2022-01-21 17:13:52 -08:00
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.
2022-01-21 17:12:06 -08:00
Lioncash
46d9dc557c
service/wlan: Update function tables
2022-01-21 16:35:51 -05:00
Lioncash
3599c5f7c8
service/usb: Update function tables
2022-01-21 16:31:57 -05:00
Lioncash
50af00640b
service/set: Update function tables
2022-01-21 16:26:12 -05:00
Lioncash
114ce2ae13
service/ns: Update function tables
2022-01-21 16:21:35 -05:00
Lioncash
41f1cceefe
service/nim: Update unknown function table entries
2022-01-21 16:17:40 -05:00
Lioncash
cc5f02e0a5
service/friend: Update unknown function table entries
2022-01-21 16:08:46 -05:00
Lioncash
ee4adcada2
service/filsystem: Update fsp-srv function table
2022-01-21 16:07:01 -05:00
Lioncash
2495e8d6e1
service/btm: Update function tables
2022-01-21 15:59:41 -05:00
Lioncash
74a98a01de
service/audio: Update audctl unknown function names
2022-01-21 15:50:38 -05:00
Lioncash
aa0d0e91a0
service/am: Update omm function tables
2022-01-21 15:40:08 -05:00
Lioncash
1a50cb9468
service/acc: Update unknown function names
...
Switchbrew has the function names now.
2022-01-21 15:33:22 -05:00
Morph
00dc684fb0
service: apm: Stub ISession SetCpuOverclockEnabled
...
Since we don't currently support CPU overclocking within the emulated system, this can be stubbed for now, like APM IsCpuOverclockEnabled.
- Used by Gravity Rider Zero
2022-01-20 21:07:26 -05:00
bunnei
8f2630de0a
hle: kernel: Remove redundant tracking of dummy threads.
...
- These are already tracked by kernel's registered_objects member.
2022-01-20 17:08:00 -08:00
bunnei
f2e870d6b6
hle: kernel: KThread: DummyThread can be waited, ensure wait_queue is not nullptr.
2022-01-20 17:08:00 -08:00
bunnei
668af26696
hle: kernel: KThread: Decrease DummyThread priority to ensure it is never scheduled.
2022-01-20 17:08:00 -08:00
bunnei
db3c11506b
hle: kernel: service_thread: Ensure dummy thread is closed & destroyed on thread exit.
2022-01-20 17:08:00 -08:00
bunnei
e885b0ab0d
hle: kernel: KServerSession: Remove hack for CompleteSyncRequest.
...
- This does not appear to be necessary anymore.
2022-01-20 17:08:00 -08:00
bunnei
af11abed3f
hle: kernel: KServerSession: Simplify CompleteSyncRequest EndWait.
...
- Considering is_thread_waiting is never set, so we can remove IsThreadWaiting.
- KThread::EndWait will take the scheduler lock, so we can remove the redundant lock.
2022-01-20 17:08:00 -08:00
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.
2022-01-20 17:08:00 -08:00
bunnei
f1e06f984d
hle: kernel: KScheduler: Ensure dummy threads are never scheduled.
...
- These are only used by host threads for locking.
2022-01-20 17:08:00 -08:00
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.
2022-01-20 17:08:00 -08:00
bunnei
015c2dbd68
Merge pull request #7710 from german77/just-shake-it
...
core/hid: Increment shake force
2022-01-20 16:53:22 -08:00
Morph
ac59980bd0
Merge pull request #7726 from german77/clamp
...
service/hid: Initialize applet_resource on SetNpadAnalogStickUseCenterClamp
2022-01-19 14:31:15 -08:00
german77
d678dfda6e
service/hid: Initialize applet_resource on SetNpadAnalogStickUseCenterClamp
2022-01-19 14:20:31 -06:00
bunnei
70b2b91f71
Merge pull request #7701 from bunnei/clear-mem-pages
...
Kernel Memory Updates (Part 3): Clear KMemoryManager pages & other fixes
2022-01-18 21:20:42 -08:00
bunnei
74407b1348
Merge pull request #7712 from bunnei/fix-thread-exit
...
Accurately implement thread exit
2022-01-17 18:08:24 -08:00
bunnei
4e3c9cdde6
Merge pull request #7732 from v1993/patch-7
...
kernel: remove no-op code
2022-01-17 15:37:16 -08:00
Mai M
2567283d86
Merge pull request #7728 from v1993/patch-4
...
hid: fix std::transform call
2022-01-17 13:43:11 -05:00
Valeri
01852ee857
hle: remove no-op code
...
Found by static analysis with PVS-Studio. Nobody seems to really know what was it doing there.
2022-01-17 13:51:12 +03:00
Valeri
8b3ea1258c
hid: fix std::transform call
...
Found by static analysis with PVS-Studio.
2022-01-17 10:47:38 +03:00
Valeri
347574b398
Correct assignment source for rotations
...
Found by static analysis with PVS-Studio
2022-01-17 10:40:41 +03:00
bunnei
d3702fe297
Merge pull request #7711 from bunnei/fix-service-thread-race-v2
...
hle: kernel: Fix service_threads access to be thread safe V2.
2022-01-14 22:22:39 -08:00
bunnei
4148fde355
hle: kernel: k_memory_manager: Clear pages on allocation & free.
...
- Heap pages should be zero'd.
- Also explicitly passed along heap allocation option.
2022-01-14 21:16:33 -08:00
bunnei
d87fc832f4
Merge pull request #7707 from german77/slow-update
...
service/hid: Decrease motion update rate
2022-01-14 17:13:30 -08:00
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.
2022-01-14 16:44:14 -08:00
bunnei
18969b5d8e
core: hle: kernel: KProcess: Integrate with KWorkerTask and add unimplemented DoWorkerTaskImpl.
2022-01-14 16:44:14 -08:00
bunnei
914431487b
core: hle: kernel: KThread: Replace Suspend with UpdateState & various updates.
...
- This makes our implementations of these more closely match HOS.
2022-01-14 16:44:14 -08:00
bunnei
b6bf119a43
core: hle: kernel: Instantiate a kernel instance of KWorkerTaskManager.
2022-01-14 16:44:14 -08:00
bunnei
b722faaf7a
core: hle: kernel: Add KWorkerTask and KWorkerTaskManager.
...
- These primitives are used to dispatch asynchronous kernel tasks from KThread and KProcess.
2022-01-14 16:43:59 -08:00
bunnei
fbab3dc017
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.
2022-01-14 16:02:57 -08:00
Narr the Reg
f217849d21
core/hid: Increment shake force
...
With the current settings 2p mode in pokemon let's go wasn't showing up. By making the shake more violent we can make it appear without any effort using the keyboard
2022-01-14 11:11:20 -06:00
Mai M
8fb335ff3f
Merge pull request #7699 from bunnei/fix-service-thread-race
...
hle: kernel: Fix service_threads access to be thread safe.
2022-01-14 00:46:16 -05:00
Mai M
0872f9ff89
Merge pull request #7698 from bunnei/mem-code-memory-updates
...
Kernel Memory Updates (Part 2): SetProcessMemoryPermission, update permissions, and other minor changes.
2022-01-14 00:41:17 -05:00
bunnei
ef9186172f
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.
2022-01-13 21:26:10 -08:00
bunnei
c8933c02cc
Merge pull request #7700 from german77/no-gyro
...
core/hid: Reduce gyro threshold even more
2022-01-13 21:24:41 -08:00
Narr the Reg
01d886a3ba
service/hid: Decrease motion update rate
...
Motion stops working in Mario Tennis in swing mode if the update rate is too fast even when HW it updates at the same speed. 10ms it's the minimum period that the game needs to start working again.
2022-01-12 22:55:33 -06:00
Narr the Reg
56ac40bfc4
core/hid: Reduce gyro threshold even more
2022-01-11 23:15:39 -06:00