summaryrefslogtreecommitdiffstats
path: root/src/core/arm/unicorn (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: kernel: Move SVC to its own namesapce.bunnei2020-04-171-1/+1
|
* core: Implement separate A32/A64 ARM interfaces.bunnei2020-03-032-6/+9
|
* core/arm: Remove usage of global GetCurrentThread()Lioncash2020-01-311-1/+2
| | | | | Now both CPU backends go through their referenced system instance to obtain the current thread.
* core: Prepare various classes for memory read/write migrationLioncash2019-11-272-2/+1
| | | | | | | | | | Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
* arm_unicorn: Resolve sign conversion warningsLioncash2019-11-122-7/+9
| | | | | While we're at it, this also resolves a type truncation warning as well, given the code was truncating from a 64-bit value to a 32-bit one.
* Core_Timing: Address Feedback and suppress warnings.Fernando Sahmkow2019-10-111-1/+1
|
* Core Timing: Rework Core Timing to run all cores evenly.Fernando Sahmkow2019-10-091-1/+1
|
* core: Remove CurrentArmInterface() global accessorLioncash2019-07-131-3/+6
| | | | | Replaces the final usage of the global accessor function and removes it. Removes one more enabler of global state.
* core/arm: Remove obsolete Unicorn memory mappingLioncash2019-07-112-12/+0
| | | | | | | | This was initially necessary when AArch64 JIT emulation was in its infancy and all memory-related instructions weren't implemented. Given the JIT now has all of these facilities implemented, we can remove these functions from the CPU interface.
* core/cpu_core_manager: Create threads separately from initialization.Lioncash2019-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our initialization process is a little wonky than one would expect when it comes to code flow. We initialize the CPU last, as opposed to hardware, where the CPU obviously needs to be first, otherwise nothing else would work, and we have code that adds checks to get around this. For example, in the page table setting code, we check to see if the system is turned on before we even notify the CPU instances of a page table switch. This results in dead code (at the moment), because the only time a page table switch will occur is when the system is *not* running, preventing the emulated CPU instances from being notified of a page table switch in a convenient manner (technically the code path could be taken, but we don't emulate the process creation svc handlers yet). This moves the threads creation into its own member function of the core manager and restores a little order (and predictability) to our initialization process. Previously, in the multi-threaded cases, we'd kick off several threads before even the main kernel process was created and ready to execute (gross!). Now the initialization process is like so: Initialization: 1. Timers 2. CPU 3. Kernel 4. Filesystem stuff (kind of gross, but can be amended trivially) 5. Applet stuff (ditto in terms of being kind of gross) 6. Main process (will be moved into the loading step in a following change) 7. Telemetry (this should be initialized last in the future). 8. Services (4 and 5 should ideally be alongside this). 9. GDB (gross. Uses namespace scope state. Needs to be refactored into a class or booted altogether). 10. Renderer 11. GPU (will also have its threads created in a separate step in a following change). Which... isn't *ideal* per-se, however getting rid of the wonky intertwining of CPU state initialization out of this mix gets rid of most of the footguns when it comes to our initialization process.
* kernel/svc: Deglobalize the supervisor call handlersLioncash2019-04-082-24/+25
| | | | | | | | | | | Adjusts the interface of the wrappers to take a system reference, which allows accessing a system instance without using the global accessors. This also allows getting rid of all global accessors within the supervisor call handling code. While this does make the wrappers themselves slightly more noisy, this will be further cleaned up in a follow-up. This eliminates the global system accessors in the current code while preserving the existing interface.
* Merge pull request #2240 from FearlessTobi/port-4651bunnei2019-04-062-3/+4
|\ | | | | Port citra-emu/citra#4651: "gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to let watchpoints break into GDB."
| * gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to let watchpoints break into GDB. (#4651)Dimitri A2019-03-152-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gdbstub: fix IsMemoryBreak() returning false while connected to client As a result, the only existing codepath for a memory watchpoint hit to break into GDB (InterpeterMainLoop, GDB_BP_CHECK, ARMul_State::RecordBreak) is finally taken, which exposes incorrect logic* in both RecordBreak and ServeBreak. * a blank BreakpointAddress structure is passed, which sets r15 (PC) to NULL * gdbstub: DynCom: default-initialize two members/vars used in conditionals * gdbstub: DynCom: don't record memory watchpoint hits via RecordBreak() For now, instead check for GDBStub::IsMemoryBreak() in InterpreterMainLoop and ServeBreak. Fixes PC being set to a stale/unhit breakpoint address (often zero) when a memory watchpoint (rwatch, watch, awatch) is handled in ServeBreak() and generates a GDB trap. Reasons for removing a call to RecordBreak() for memory watchpoints: * The``breakpoint_data`` we pass is typed Execute or None. It describes the predicted next code breakpoint hit relative to PC; * GDBStub::IsMemoryBreak() returns true if a recent Read/Write operation hit a watchpoint. It doesn't specify which in return, nor does it trace it anywhere. Thus, the only data we could give RecordBreak() is a placeholder BreakpointAddress at offset NULL and type Access. I found the idea silly, compared to simply relying on GDBStub::IsMemoryBreak(). There is currently no measure in the code that remembers the addresses (and types) of any watchpoints that were hit by an instruction, in order to send them to GDB as "extended stop information." I'm considering an implementation for this. * gdbstub: Change an ASSERT to DEBUG_ASSERT I have never seen the (Reg[15] == last_bkpt.address) assert fail in practice, even after several weeks of (locally) developping various branches around GDB. Only leave it inside Debug builds.
* | core: Add missing override specifiers where applicableLioncash2019-04-041-1/+1
|/ | | | | | | | | Applies the override specifier where applicable. In the case of destructors that are defaulted in their definition, they can simply be removed. This also removes the unnecessary inclusions being done in audin_u and audrec_u, given their close proximity.
* core_timing: Convert core timing into a classLioncash2019-02-162-4/+10
| | | | | | | | | | | Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
* core_timing: Rename CoreTiming namespace to Core::TimingLioncash2019-02-121-2/+2
| | | | | | Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
* Moved backtrace to ArmInterfaceDavid Marcec2018-12-192-17/+0
|
* Moved backtrace to ArmInterfaceDavid Marcec2018-12-032-0/+18
| | | | Added to both dynarmic and unicorn
* kernel/thread: Make all instance variables privateLioncash2018-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
* arm_interface: Remove ARM11-isms from the CPU interfaceLioncash2018-09-182-24/+13
| | | | | | | | | This modifies the CPU interface to more accurately match an AArch64-supporting CPU as opposed to an ARM11 one. Two of the methods don't even make sense to keep around for this interface, as Adv Simd is used, rather than the VFP in the primary execution state. This is essentially a modernization change that should have occurred from the get-go.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-152-4/+4
|
* Update microprofile scopes.Markus Wick2018-09-041-2/+2
| | | | | | Blame the subsystems which deserve the blame :) The updated list is not complete, just the ones I've spotted on random sampling the stack trace.
* core: Namespace all code in the arm subdirectory under the Core namespaceLioncash2018-08-252-2/+10
| | | | Gets all of these types and interfaces out of the global namespace.
* GDBStub works with both Unicorn and Dynarmic now (#941)Hedges2018-08-071-1/+1
| | | | | | * GDBStub works with both Unicorn and Dynarmic now * Tidy up
* Merge pull request #750 from lioncash/ctxbunnei2018-07-211-4/+0
|\ | | | | arm_interface: Remove unused tls_address member of ThreadContext
| * arm_interface: Remove unused tls_address member of ThreadContextLioncash2018-07-211-4/+0
| | | | | | | | | | Currently, the TLS address is set within the scheduler, making this member unused.
* | CPU: Save and restore the TPIDR_EL0 system register on every context switch.Subv2018-07-212-0/+12
|/ | | | Note that there's currently a dynarmic bug preventing this register from being written.
* scheduler: Clear exclusive state when switching contextsMerryMage2018-07-162-0/+3
|
* More improvements to GDBStub (#653)Hedges2018-07-131-2/+2
| | | | | | | | | | | * More improvements to GDBStub - Debugging of threads should work correctly with source and assembly level stepping and modifying registers and memory, meaning threads and callstacks are fully clickable in VS. - List of modules is available to the client, with assumption that .nro and .nso are backed up by an .elf with symbols, while deconstructed ROMs keep N names. - Initial support for floating point registers. * Tidy up as requested in PR feedback * Tidy up as requested in PR feedback
* GDB Stub Improvements (#508)Hedges2018-06-062-1/+41
| | | | | | | | | | * GDB Stub should work now. * Applied clang-format. * Replaced htonll with swap64. * Tidy up.
* core: Implement multicore support.bunnei2018-05-111-1/+1
|
* general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-1/+1
| | | | | | This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
* general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-2/+2
|
* Clean Warnings (?)N00byKing2018-03-191-1/+1
|
* Merge pull request #193 from N00byKing/3184_2_robotic_boogaloobunnei2018-03-192-1/+12
|\ | | | | Implement Pull #3184 from citra: core/arm: Improve timing accuracy before service calls in JIT (Rebased)
| * Implements citra-emu/citra#3184N00byKing2018-02-252-1/+12
| |
* | arm_interface: Support unmapping previously mapped memory.bunnei2018-03-162-0/+5
| |
* | Stub am::SetScreenShotPermission, and bsd::StartMonitoring functionsmailwl2018-02-221-1/+2
|/
* Build: Automagically handle unicornJames Rowe2018-01-161-1/+1
| | | | | | | On MSVC if unicorn isn't found, fallback to bundled unicorn On everything else, fallback to building unicorn in externals Also fixes loading unicorn in msvc
* Build: Add unicorn as a submodule and build it if neededJames Rowe2018-01-161-1/+1
| | | | | | | Adds a cmake custom target that will build unicorn on first compile and uses this in the build scripts as well. Updates Appveyor and Travis build scripts to work with the new unicorn build, and updates the paths to all of the different artifacts.
* arm_unicorn: Log unmapped memory access address.bunnei2018-01-131-1/+1
|
* yuzu: Update license text to be consistent across project.bunnei2018-01-132-2/+2
|
* arm_dynarmic: Implement coreMerryMage2018-01-122-11/+14
|
* arm_unicorn: Load/release unicorn DLL.bunnei2018-01-041-0/+16
|
* unicorn: Use for arm interface on Windows.bunnei2018-01-042-0/+240