Commit graph

2238 commits

Author SHA1 Message Date
Liam
524737d29b kernel: fix KCodeMemory initialization 2022-06-09 12:33:28 -04:00
Liam
5772327b39 CpuManager: simplify pausing 2022-06-08 21:47:29 -04:00
Liam
b3dce90004 core/debugger: Support reading guest thread names 2022-06-01 21:25:32 -04:00
Liam
da50e98e3a core/debugger: Improved stepping mechanism and misc fixes 2022-06-01 02:15:15 -04:00
Liam
2ee161a0bf core/debugger: Implement new GDB stub debugger 2022-06-01 00:01:25 -04:00
Morph
88052d8c09 kernel: svc: Replace -1ULL with 0xFFFFFFFFFFFFFFFF
Resolves the C4146 compiler warning on MSVC.
2022-04-24 17:40:47 -04:00
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.
2022-04-23 05:55:32 -04:00
german77
0a05a333e2 hidbus: Implement hidbus and ringcon 2022-04-16 00:49:21 -05:00
Fernando S
4e0c4e9929 Merge pull request #8172 from bunnei/kernel-mutex
hle: kernel: Use std::mutex instead of spin locks for most kernel locking.
2022-04-16 00:05:04 +02:00
Liam
751903c633 service: jit: Implement the JIT service 2022-04-13 08:41:27 -04:00
bunnei
cd12d87e5b Merge pull request #8165 from bunnei/ensure-session-port-cleanup
Kernel: Track open references to KServerPort and KServerSession.
2022-04-12 14:01:40 -07:00
bunnei
4d4a17ef6f Merge pull request #8178 from tech-ticks/skyline-icache-fix
hle: kernel: Invalidate entire icache in UnmapProcessMemory and UnmapCodeMemory (fixes #8174)
2022-04-12 11:23:20 -07:00
bunnei
03f8a16869 core: hle: kernel: k_thread: Rework dummy thread waiting. 2022-04-11 21:15:38 -07:00
bunnei
13b1ee7679 hle: kernel: k_spin_lock: Remove unused ThreadPause. 2022-04-11 21:13:40 -07:00
bunnei
e1b3368c18 hle: kernel: Use std::mutex instead of spin locks for most kernel locking. 2022-04-11 21:13:40 -07:00
bunnei
203b812a83 Merge pull request #8157 from lat9nq/kernel-races
kernel: Fix some data races
2022-04-11 21:13:01 -07:00
tech-ticks
53f7a78e9e hle: kernel: Invalidate entire icache in UnmapProcessMemory and UnmapCodeMemory (fixes #8174) 2022-04-09 13:29:19 +02:00
bunnei
11febb02d6 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.
2022-04-08 14:13:22 -07:00
bunnei
5a3c38e133 hle: kernel: k_server_port: Release ref-counted host emulation members on Destroy. 2022-04-08 14:11:40 -07:00
bunnei
45da07576f hle: kernel: k_auto_object: Move unregister with kernel to after Destroy.
- Destructor is no longer invoked, so our object counting was off.
2022-04-08 14:11:40 -07:00
bunnei
2878df391c hle: kernel: hle_ipc: HasSessionRequestHandler: Check if domain handler is expired rather than locking. 2022-04-08 14:11:39 -07:00
Merry
de61c0897c core/hle: Replace lock_guard with scoped_lock 2022-04-07 19:44:07 +01:00
Fernando S
0bb26a7794 Merge pull request #8148 from merryhime/interrupts
dynarmic: Better interrupts
2022-04-07 16:21:41 +02:00
lat9nq
b64f4230b3 k_system_control: Fix data race
`return distribution(gen)` is a data race between a read and a write in
two threads, reported by TSan. Remove static random number generators so
they aren't using the same generator.
2022-04-05 19:55:56 -04:00
lat9nq
bda62c0837 k_auto_object: Fix data race
Change the memory order to acqure-release when we decrement the
reference count. Prevents a race with line 89 reported by TSan.
2022-04-03 21:47:58 -04:00
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.
2022-04-03 21:47:58 -04:00
lat9nq
0f347eaf52 k_process: Fix data race
TSan reported a race between thread 36 and thread 34, a read at :225 and
a write at :225 respectively. Make total_proces_running_time_ticks
atomic to avoid this race.
2022-04-03 21:47:57 -04:00
lat9nq
53d3082dd4 kernel: Fix current_process race
TSan reported a race at :258 and :803, so make current_process an atomic
pointer.
2022-04-03 21:47:57 -04:00
lat9nq
039ce14442 k_scheduler_lock: Fix data race
TSan reports a race between the main thread and T37 during
IsLockedByCurrentThread and when it's set at the end of Lock(),
respectively. Set owner_thread to an atomic pointer to fix it.

Co-authored-by: bunnei <bunneidev@gmail.com>
2022-04-03 21:47:57 -04:00
merry
f54345590b dynarmic: Better interrupts 2022-04-03 16:39:48 +01:00
bunnei
75e39568a0 hle: service: Add option for service interfaces to create or use the default thread. 2022-04-02 01:24:30 -04:00
bunnei
60f2fe3b48 hle: kernel: Create a default thread for services that do not need their own host thread. 2022-04-02 01:24:30 -04:00
bunnei
533ff8b1a9 hle: kernel: k_page_table: Fix implementations of LockForCodeMemory & UnlockForCodeMemory. 2022-03-26 01:49:34 -07:00
bunnei
003d5761e1 hle: kernel: k_page_table: Implement LockMemoryAndOpen & UnlockMemory. 2022-03-26 01:46:41 -07:00
bunnei
3beb4d4273 hle: kernel: svc: MapProcessMemory: Fix usage of KPageLinkedList to use physical address space. 2022-03-26 01:35:37 -07:00
bunnei
f84511eb4f hle: kernel: svc: CreateCodeMemory: Remove log of 'out' host pointer.
- This does not seem terribly useful and is inconsistent with other usage.
2022-03-26 01:34:29 -07:00
bunnei
7e6a6bb505 hle: kernel: k_code_memory: Fix usage of KPageLinkedList to use physical address space. 2022-03-26 01:33:16 -07:00
bunnei
506961d8cc hle: kernel: k_page_table: Implement MakeAndOpenPageGroup & MakePageGroup. 2022-03-26 01:25:52 -07:00
bunnei
416944c501 hle: kernel: k_page_table: Add IsHeapPhysicalAddress method. 2022-03-26 01:23:43 -07:00
bunnei
f5415480de hle: kernel: k_page_linked_list: Add Empty method. 2022-03-26 01:02:42 -07:00
bunnei
58a4c17e98 hle: kernel: svc: UnmapProcessCodeMemory: Fix inverted alignment check. 2022-03-26 01:01:55 -07:00
bunnei
c9ffc287bf Merge pull request #8048 from ameerj/include-purge
general: Reduce unused includes across the project
2022-03-21 18:03:54 -07:00
bunnei
15dca3345c Merge pull request #8040 from Morph1984/handle-table
KHandleTable: Optimize table entry layout
2022-03-19 23:17:37 -07:00
ameerj
22e01068e1 core: Reduce unused includes 2022-03-19 02:23:32 -04:00
ameerj
1967757627 general: Reduce core.h includes 2022-03-18 02:13:02 -04:00
Morph
c2a970b67d KHandleTable: Optimize table entry layout
Since the handle type is not being used, we can reduce the amount of space each entry takes up by 4 bytes.
2022-03-18 00:28:25 -04:00
bunnei
1494a66aa3 core: hle: kernel: init_slab_setup: Move CalculateSlabHeapGapSize to global namespace. 2022-03-14 18:14:54 -07:00
bunnei
8b109f8a69 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.
2022-03-14 18:14:54 -07:00
bunnei
18baef2ec9 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).
2022-03-14 18:14:54 -07:00
bunnei
58b39c8ad8 core: hle: kernel: Make object list container global and ensure it is reset on each emulation session. 2022-03-14 18:14:54 -07:00