Commit Graph

79 Commits (f785f73e9279dcb9cfdee93da694d7a1f55142ea)

Author SHA1 Message Date
Lioncash f785f73e92 general: Replace NonCopyable struct with equivalents 3 years ago
Markus Wick 3d2e80daed core/arm_interface: Call SVC after end of dynarmic block.
So we can modify all of dynarmic states within SVC without ExceptionalExit.

Especially as the ExceptionalExit hack is dropped on upstream dynarmic.
4 years ago
Markus Wick 993dbe49fc core/arm: Drop ChangeProcessorID.
This code was used to switch the CPU ID on thread switches.
However since "hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.", the CPU ID is not a constant.
This has been dead code since this rewrite, and dropped in dynarmic as well. So there is no need to keep it.
4 years ago
bunnei 354130cd84 core: arm: arm_interface: Fix shadowing errors. 4 years ago
bunnei 63fd1bb503 core: arm: Implement InvalidateCacheRange for CPU cache invalidation. 4 years ago
bunnei 7b642c7781 hle: kernel: multicore: Replace n-JITs impl. with 4 JITs. 4 years ago
bunnei 3d592972dc
Revert "core: Fix clang build" 5 years ago
Lioncash be1954e04c core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
5 years ago
Fernando Sahmkow 2f8947583f Core/Common: Address Feedback. 5 years ago
Fernando Sahmkow 4105f38022 SVC: Implement 32-bits wrappers and update Dynarmic. 5 years ago
Fernando Sahmkow f5e32935ca SingleCore: Use Cycle Timing instead of Host Timing. 5 years ago
Fernando Sahmkow 1567824d2d General: Move ARM_Interface into Threads. 5 years ago
Fernando Sahmkow 1b82ccec22 Core: Refactor ARM Interface. 5 years ago
Fernando Sahmkow 7b18174eef ARM/WaitTree: Better track the CallStack for each thread. 5 years ago
Fernando Sahmkow 725bac1404 Scheduler: Remove arm_interface lock and a few corrections. 5 years ago
Fernando Sahmkow 04e0f8776c General: Add better safety for JIT use. 5 years ago
Fernando Sahmkow e31425df38 General: Recover Prometheus project from harddrive failure
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host 
Timing, Reworks the Kernel's Scheduler, Introduce Idle State and 
Suspended State, Recreates the bootmanager, Initializes Multicore 
system.
5 years ago
bunnei 0f4f90cd04 arm_interface: Ensure ThreadContext is zero'd out. 5 years ago
bunnei c083ea7d78 core: Implement separate A32/A64 ARM interfaces. 5 years ago
Lioncash 536fc7f0ea core: Prepare various classes for memory read/write migration
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.
5 years ago
Lioncash 70624e1c1d core/arm: Remove obsolete Unicorn memory mapping
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.
6 years ago
Zach Hilman 5574be21cc arm_interface: Expand backtrace generation
Returns results as a vector of entries for further processing. Logs addresses, offsets, and mangled name.
6 years ago
Lioncash f2331a804a core/cpu_core_manager: Create threads separately from initialization.
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.
6 years ago
Lioncash a17dd30057 arm_interface: Make LogBacktrace() a const member function
This function doesn't modify instance state, so it can be made const.
6 years ago
David Marcec 22d4e10664 Moved log backtrace to arm_interface.cpp. Added printing of error code to fatal 6 years ago
David Marcec 08d5663cb8 Moved backtrace to ArmInterface 6 years ago
David Marcec 5102c91256 Moved backtrace to ArmInterface
Added to both dynarmic and unicorn
6 years ago
Lioncash 16145e2f21 arm_interface: Add missing fpsr/tpidr members to the ThreadContext struct
Internally within the kernel, it also includes a member variable for the
floating-point status register, and TPIDR, so we should do the same here to match
it.

While we're at it, also fix up the size of the struct and add a static
assertion to ensure it always stays the correct size.
7 years ago
Lioncash 9b8fc2b689 arm_interface: Replace kernel vm_manager include with a forward declaration
Avoids an unnecessary inclusion and also uncovers three places where
indirect inclusions were relied upon, which allows us to also resolve
those.
7 years ago
Lioncash b51e7e0288 arm_interface: Remove ARM11-isms from the CPU interface
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.
7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
Lioncash 43e0d865fa core: Namespace all code in the arm subdirectory under the Core namespace
Gets all of these types and interfaces out of the global namespace.
7 years ago
bunnei de7cb91995
Merge pull request #750 from lioncash/ctx
arm_interface: Remove unused tls_address member of ThreadContext
7 years ago
Subv d84eb9dac6 CPU: Save and restore the TPIDR_EL0 system register on every context switch.
Note that there's currently a dynarmic bug preventing this register from being written.
7 years ago
Lioncash ae09adfcb3 arm_interface: Remove unused tls_address member of ThreadContext
Currently, the TLS address is set within the scheduler, making this
member unused.
7 years ago
MerryMage 56cc1c11ec scheduler: Clear exclusive state when switching contexts 7 years ago
bunnei 23a0d2d7b7
Merge pull request #193 from N00byKing/3184_2_robotic_boogaloo
Implement Pull #3184 from citra: core/arm: Improve timing accuracy before service calls in JIT (Rebased)
7 years ago
bunnei 403f8e79ea arm_interface: Support unmapping previously mapped memory. 7 years ago
N00byKing bc88cae0c7 Implements citra-emu/citra#3184 7 years ago
MerryMage e35644c005 clang-format 7 years ago
MerryMage d2fbc78320 arm_dynarmic: Implement core 7 years ago
bunnei b172f0d770 arm: Remove SkyEye/Dyncom code that is ARMv6-only. 7 years ago
bunnei b1d5db1cf6 Merge remote-tracking branch 'upstream/master' into nx
# Conflicts:
#	src/core/CMakeLists.txt
#	src/core/arm/dynarmic/arm_dynarmic.cpp
#	src/core/arm/dyncom/arm_dyncom.cpp
#	src/core/hle/kernel/process.cpp
#	src/core/hle/kernel/thread.cpp
#	src/core/hle/kernel/thread.h
#	src/core/hle/kernel/vm_manager.cpp
#	src/core/loader/3dsx.cpp
#	src/core/loader/elf.cpp
#	src/core/loader/ncch.cpp
#	src/core/memory.cpp
#	src/core/memory.h
#	src/core/memory_setup.h
8 years ago
bunnei 6377585edb arm_interface: Set TLS address for dynarmic core. 8 years ago
bunnei 3411883fe3 arm: Use 64-bit addressing in a bunch of places. 8 years ago
Huw Pascoe 529f4a0131 Moved down_count to CoreTiming 8 years ago
MerryMage 67a70bd9e1 ARM_Interface: Implement PageTableChanged 8 years ago
bunnei 8b1e269e58 ThreadContext: Move from "core" to "arm_interface". 8 years ago
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 9 years ago
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 9 years ago