* Introduce Jit32 and JitCore32 objects
* Initialize JIT when launching 32bit executables
* Introduce kernel objects for 32bit processes
This commit introduces two new kernel thread types, `KNceThread` and `Jit32Thread`.
`KNceThread`s behave like the previous kernel thread object by setting up thread state and jumping into guest code.
`KJit32Thread`s need to run guest code on a `JitCore32` object, so they perform the necessary state setup and then they also setup the jit core for executing guest code. A loop was introduced because jit execution might return when halted, either for an SVC or for preemption. In those cases the thread needs to wait to be scheduled before executing again.
The process object has also been updated to be able to create 32bit threads when running 32bit processes.
Additionally NCE's ThreadContext has been removed from DeviceState, since a thread is not an NCE thread only anymore, and IPC code has been changed to retrieve the tls region from the thread object.
* Introduce a preemption handler for scheduling with JIT
Scheduler initialization has been delayed until process information is available, as it needs to differentiate between 32bit and 64bit processes.
* Support initializing VMM for 32bit address spaces
* Implement GetThreadContext3 SVC for 32bit processes
* Introduce a thread local pointer to the current guest thread
This also gives easier access to the current guest process structure via the thread structure, just like any kernel does for their internal structures.
* Add a signal handler for JIT threads
* Implement coprocessor 15 accesses
* Implement exclusive memory writes and exclusive monitor
* Enable JIT fastmem
* Enable more JIT optimizations and log exceptions
* Fix incorrect logging call in QueryMemory
* Translate guest virtual addresses on direct accesses from SVCs
* Perform TLS page address translation for direct accesses
This allows the IPC code to work without modifications since `KThread::tlsRegion` now stores a host address that can be accessed directly.
* Add Dynarmic as a submodule
* Revert "Perform TLS page address translation for direct accesses"
This reverts commit 2e25b3f7e4f0687b038fa949648c74e3393da006.
* Revert "Translate guest virtual addresses on direct accesses from SVCs"
This reverts commit 7bec4e0902e6dbb6f06a2efac53a1e2127f44068.
* add an option to change cpu backend
* Fix
---------
Co-authored-by: lynxnb <niccolo.betto@gmail.com>
* Add support for multiple search locations
Co-authored-by: hacobotdev <hacobotdev>
* SearchLocationHelper: Use mutableListOf<Uri> and change the return value of the ``getSearchLocations`` function to List<Uri>
* MainViewModel: Modify load rom and check rom hash to accept List uri instead of array uri
* Use SearchLocationHelper when initialising search location first time
* fix search location app bar title
The memory manager has been reworked to handle addresses in the guest address space, and applying an offset to get the address on the host whenever memory needs to be mapped/unmapped/reprotected.
The memory manager was incorrectly inserting chunks when the new chunk was being inserted at the beginning of the chunks map (no previous chunk available). The existing chunk was resized to an empty chunk (correctly), but the new chunk was never inserted because of `std::map::insert` skipping insertion on an already existing key.
This resulted in an empty chunk being left at the beginning of the map, causing infinite loops for code that worked by scanning the chunks map.
Usages of `std::map::operator[]` have also been replaced with the safer `insert_or_assign`.
dynsym is not hardcoded to handle Elf64_Sym only anymore, and a templated ResolveSymbol function has been introduced to easily support Elf32_Sym lookup in the future.
dynsym is not hardcoded to handle Elf64_Sym only anymore, and a templated ResolveSymbol function has been introduced to easily support Elf32_Sym lookup in the future.