summaryrefslogtreecommitdiff
path: root/src/core/arm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* physical_core: Make use of std::make_unique instead of std::make_shared in ctorGravatar Lioncash2020-04-243-7/+12
| | | | | | | We can also allow unicorn to be constructed in 32-bit mode or 64-bit mode to satisfy the need for both interpreter instances. Allows this code to compile successfully of non x86-64 architectures.
* Merge pull request #3724 from bunnei/fix-unicornGravatar bunnei2020-04-201-0/+11
|\ | | | | core: arm_unicorn: Fix interpret fallback by temporarily mapping instruction page.
| * core: arm_unicorn: Fix interpret fallback by temporarily mapping instruction ↵Gravatar bunnei2020-04-191-0/+11
| | | | | | | | page.
* | dynarmic: Add option to disable CPU JIT optimizationsGravatar MerryMage2020-04-201-2/+8
|/
* dynarmic: Enable strict alignment checks.Gravatar bunnei2020-04-171-1/+4
| | | | - Also add a missing include.
* core: memory: Move to Core::Memory namespace.Gravatar bunnei2020-04-174-5/+5
| | | | - helpful to disambiguate Kernel::Memory namespace.
* core: kernel: Move SVC to its own namesapce.Gravatar bunnei2020-04-173-3/+3
|
* arm_interface: Ensure ThreadContext is zero'd out.Gravatar bunnei2020-04-171-16/+16
|
* CMakeLists: Specify -Wextra on linux buildsGravatar Lioncash2020-04-151-2/+2
| | | | | | | | | | | Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
* core: Implement separate A32/A64 ARM interfaces.Gravatar bunnei2020-03-028-71/+367
|
* core: dynarmic: Add CP15 from Citra.Gravatar bunnei2020-03-022-0/+232
|
* ARM_Interface: Cache the JITs instead of deleting/recreating.Gravatar Fernando Sahmkow2020-02-262-4/+19
| | | | | | This was a bug inherited from citra which was fixed by then at some time. This commit corrects such bug and ensures JITs are correctly recycled.
* Core: Set all hardware emulation constants in a single file.Gravatar Fernando Sahmkow2020-02-111-1/+2
|
* core/arm: Remove usage of global GetCurrentThread()Gravatar Lioncash2020-01-302-2/+4
| | | | | Now both CPU backends go through their referenced system instance to obtain the current thread.
* System: Address FeedbackGravatar Fernando Sahmkow2020-01-272-3/+5
|
* Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Gravatar Fernando Sahmkow2020-01-261-1/+1
| | | | This commit instends on better naming the new purpose of this classes.
* ArmInterface: Delegate Exclusive monitor factory to exclusive monitor ↵Gravatar Fernando Sahmkow2020-01-262-1/+22
| | | | interfasce.
* core/memory + arm/dynarmic: Use a global offset within our arm page table.Gravatar Markus Wick2020-01-011-0/+1
| | | | | | This saves us two x64 instructions per load/store instruction. TODO: Clean up our memory code. We can use this optimization here as well.
* core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classGravatar Lioncash2019-11-262-15/+22
| | | | | | | | | The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
* core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classGravatar Lioncash2019-11-262-18/+18
| | | | | | | | | | | | | | With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
* core: Prepare various classes for memory read/write migrationGravatar Lioncash2019-11-266-9/+14
| | | | | | | | | | 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 warningsGravatar Lioncash2019-11-123-8/+10
| | | | | 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.Gravatar Fernando Sahmkow2019-10-112-2/+2
|
* Core Timing: Rework Core Timing to run all cores evenly.Gravatar Fernando Sahmkow2019-10-092-2/+2
|
* Revert "arm_dynarmic: Check if jit is nullptr when preparing reschedule"Gravatar bunnei2019-09-291-3/+0
|
* Merge pull request #2574 from DarkLordZach/dynarmic-jit-nullptrGravatar bunnei2019-09-291-0/+3
|\ | | | | arm_dynarmic: Check if jit is nullptr when preparing reschedule
| * arm_dynarmic: Check if jit is nullptr when preparing rescheduleGravatar Zach Hilman2019-06-101-0/+3
| | | | | | | | Prevents crash with multiprocess loading.
* | core: Remove CurrentArmInterface() global accessorGravatar Lioncash2019-07-121-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 mappingGravatar Lioncash2019-07-115-31/+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.
* | loader: Move NSO module tracking to AppLoaderGravatar Zach Hilman2019-05-261-8/+19
| | | | | | Also cleanup of general stuff
* | arm_interface: Expand backtrace generationGravatar Zach Hilman2019-05-252-7/+194
|/ | | | Returns results as a vector of entries for further processing. Logs addresses, offsets, and mangled name.
* core/cpu_core_manager: Create threads separately from initialization.Gravatar Lioncash2019-04-114-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 handlersGravatar Lioncash2019-04-074-39/+37
| | | | | | | | | | | 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.
* arm/arm_dynarmic: Remove unnecessary current_page_table memberGravatar Lioncash2019-04-072-8/+0
| | | | | Given the page table will always be guaranteed to be that of whatever the current process is, we no longer need to keep this around.
* Merge pull request #2240 from FearlessTobi/port-4651Gravatar bunnei2019-04-052-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 ↵Gravatar Dimitri A2019-03-152-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | let watchpoints break into GDB. (#4651) * 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 applicableGravatar Lioncash2019-04-043-4/+3
| | | | | | | | | | | | | | | | | | 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: Move PageTable struct into Common.Gravatar bunnei2019-03-161-2/+2
| |
* | Corrections, documenting and fixes.Gravatar Fernando Sahmkow2019-02-161-1/+1
| |
* | Use u128 on Clock Cycles calculation.Gravatar Fernando Sahmkow2019-02-151-1/+1
| |
* | Correct CNTPCT to use Clock Cycles instead of Cpu Cycles.Gravatar Fernando Sahmkow2019-02-151-2/+3
|/
* core_timing: Convert core timing into a classGravatar Lioncash2019-02-154-10/+24
| | | | | | | | | | | 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::TimingGravatar Lioncash2019-02-122-5/+5
| | | | | | 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.
* arm_interface: Make include path relative for arm_interface.hGravatar Lioncash2018-12-301-1/+1
| | | | Makes it consistent with the rest of the includes.
* arm_interface: Make LogBacktrace() a const member functionGravatar Lioncash2018-12-302-2/+2
| | | | This function doesn't modify instance state, so it can be made const.
* arm_interface: Mark variables as const where applicable in LogBacktrace()Gravatar Lioncash2018-12-301-3/+4
| | | | | Two of these variables have fixed values, so we can make that immediately obvious from the get-go.
* arm_interface: Remove unnecessary semicolonGravatar Lioncash2018-12-301-1/+1
| | | | | Namespaces don't require the use of a semicolon. Silences a -Wextra-semi warning.
* Merge pull request #1847 from ogniK5377/backtrace-breakGravatar bunnei2018-12-293-0/+35
|\ | | | | Print backtrace on svcBreak
| * Moved log backtrace to arm_interface.cpp. Added printing of error code to fatalGravatar David Marcec2018-12-292-17/+33
| |
| * Moved backtrace to ArmInterfaceGravatar David Marcec2018-12-195-36/+17
| |