| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
memory: Add class to manage and enforce memory freezing
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
kernel: Differentiate kernel and user processes when picking ID
|
| |/
| |
| |
| | |
This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
|
|\ \
| |/
|/| |
core: Add detailed local reporting feature for development
|
| |
| |
| | |
Also cleanup of general stuff
|
| | |
|
| |
| |
| |
| | |
Needed for backtrace decomposition
|
| |
| |
| |
| |
| | |
The contents of these includes aren't used anywhere in this translation
unit.
|
| |
| |
| |
| | |
This is a hold-over from Citra and doesn't apply to yuzu.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Makes the dependency explicit in the TelemetrySession's interface
instead of making it a hidden dependency.
This also revealed a hidden issue with the way the telemetry session was
being initialized. It was attempting to retrieve the app loader and log
out title-specific information. However, this isn't always guaranteed to
be possible.
During the initialization phase, everything is being constructed. It
doesn't mean an actual title has been selected. This is what the Load()
function is for. This potentially results in dead code paths involving
the app loader. Instead, we explicitly add this information when we know
the app loader instance is available.
|
|\
| |
| | |
applets: Add AppletManager and implement PhotoViewer and Error applets
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This gives us significantly more control over where in the
initialization process we start execution of the main process.
Previously we were running the main process before the CPU or GPU
threads were initialized (not good). This amends execution to start
after all of our threads are properly set up.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that we have dependencies on the initialization order, we can move
the creation of the main process to a more sensible area: where we
actually load in the executable data.
This allows localizing the creation and loading of the process in one
location, making the initialization of the process much nicer to trace.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Like with CPU emulation, we generally don't want to fire off the threads
immediately after the relevant classes are initialized, we want to do
this after all necessary data is done loading first.
This splits the thread creation into its own interface member function
to allow controlling when these threads in particular get created.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Instead, pass in the core timing instance and make the dependency
explicit in the interface.
|
|\
| |
| | |
file_sys: Implement parser and interpreter for game memory cheats
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that we have the address arbiter extracted to its own class, we can
fix an innaccuracy with the kernel. Said inaccuracy being that there
isn't only one address arbiter. Each process instance contains its own
AddressArbiter instance in the actual kernel.
This fixes that and gets rid of another long-standing issue that could
arise when attempting to create more than one process.
|
|\ \
| | |
| | | |
Asynchronous GPU command processing
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |/ /
|/| | |
core: Remove the global telemetry accessor function
|
| |/
| |
| |
| |
| | |
The telemetry instance is actually a member of the class itself, so we
can access it directly instead of going through the global accessor.
|
|/
|
|
|
| |
Allows getting rid of reliance on the global accessor functions and
instead operating on the provided system instance.
|
|
|
|
|
| |
Avoids the use of the global accessor in favor of explicitly making the
system a dependency within the interface.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This is a function that definitely doesn't always have a non-modifying
behavior across all implementations, so this should be made non-const.
This gets rid of the need to mark data members as mutable to work around
the fact mutating data members needs to occur.
|
|\
| |
| | |
settings: Add support for setting the RTC manually
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
am: Implement HLE profile selector applet
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Keeps the CPU-specific behavior from being spread throughout the main
System class. This will also act as the home to contain member functions
that perform operations on all cores. The reason for this being that the
following pattern is sort of prevalent throughout sections of the
codebase:
If clearing the instruction cache for all 4 cores is necessary:
Core::System::GetInstance().ArmInterface(0).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(1).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(2).ClearInstructionCache();
Core::System::GetInstance().ArmInterface(3).ClearInstructionCache();
This is kind of... well, silly to copy around whenever it's needed.
especially when it can be reduced down to a single line.
This change also puts the basics in place to begin "ungrafting" all of the
forwarding member functions from the System class that are used to
access CPU state or invoke CPU-specific behavior. As such, this change
itself makes no changes to the direct external interface of System. This
will be covered by another changeset.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* get rid of boost::optional
* Remove optional references
* Use std::reference_wrapper for optional references
* Fix clang format
* Fix clang format part 2
* Adressed feedback
* Fix clang format and MacOS build
|
|
|
|
|
|
| |
Many of the Current<Thing> getters (as well as a few others) were
missing const qualified variants, which makes it a pain to retrieve
certain things from const qualified references to System.
|
|
|
|
|
| |
CpuCore already does this sort of checking, so we can just call that
instead of duplicating the assertions.
|
| |
|
|
|
|
|
|
|
|
| |
There's no need for shared ownership here, as the only owning class
instance of those Cpu instances is the System class itself. We can also
make the thread_to_cpu map use regular pointers instead of shared_ptrs,
given that the Cpu instances will always outlive the cases where they're
used with that map.
|
|
|
|
|
|
| |
Like the barrier, this is owned entirely by the System and will always
outlive the encompassing state, so shared ownership semantics aren't
necessary here.
|
|
|
|
|
|
| |
This will always outlive the Cpu instances, since it's destroyed after
we destroy the Cpu instances on shutdown, so there's no need for shared
ownership semantics here.
|
|
|
|
|
|
|
| |
Neither of these functions alter the ownership of the provided pointer,
so we can simply make the parameters a reference rather than a direct
shared pointer alias. This way we also disallow passing incorrect memory values like
nullptr.
|
|
|
|
|
|
|
|
|
|
|
| |
There's no real need to use a shared pointer in these cases, and only
makes object management more fragile in terms of how easy it would be to
introduce cycles. Instead, just do the simple thing of using a regular
pointer. Much of this is just a hold-over from citra anyways.
It also doesn't make sense from a behavioral point of view for a
process' thread to prolong the lifetime of the process itself (the
process is supposed to own the thread, not the other way around).
|
|
|
|
|
|
|
|
| |
A process should never require being reference counted in this
situation. If the handle to a process is freed before this function is
called, it's definitely a bug with our lifetime management, so we can
put the requirement in place for the API that the process must be a
valid instance.
|
|
|
|
|
|
| |
Given these are only added to the class to allow those functions to
access the private constructor, it's a better approach to just make them
static functions in the interface, to make the dependency explicit.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Given we now have the kernel as a class, it doesn't make sense to keep
the current process pointer within the System class, as processes are
related to the kernel.
This also gets rid of a subtle case where memory wouldn't be freed on
core shutdown, as the current_process pointer would never be reset,
causing the pointed to contents to continue to live.
|
|
|
|
|
|
|
|
|
|
| |
The only reason this include was necessary, was because the constructor
wasn't defaulted in the cpp file and the compiler would inline it
wherever it was used. However, given Controller is forward declared, all
those inlined constructors would see an incomplete type, causing a
compilation failure. So, we just place the constructor in the cpp file,
where it can see the complete type definition, allowing us to remove
this include.
|
|
|
|
| |
This helper is called very often. The memory ownership shall not be transfered, so just return the raw pointer.
|
|
|
|
|
|
| |
Eliminates the need to rebuild some source files if the file_util header
ever changes. This also uncovered some indirect inclusions, which have
also been fixed.
|
|
|
|
|
|
|
|
|
|
|
| |
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which
replaces most of the includes in the core header with forward declarations.
This makes it so that if any of the headers the core header was
previously including change, then no one will need to rebuild the bulk
of the core, due to core.h being quite a prevalent inclusion.
This should make turnaround for changes much faster for developers.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
core.h is kind of a massive header in terms what it includes within
itself. It includes VFS utilities, kernel headers, file_sys header,
ARM-related headers, etc. This means that changing anything in the
headers included by core.h essentially requires you to rebuild almost
all of core.
Instead, we can modify the System class to use the PImpl idiom, which
allows us to move all of those headers to the cpp file and forward
declare the bulk of the types that would otherwise be included, reducing
compile times. This change specifically only performs the PImpl portion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As means to pave the way for getting rid of global state within core,
This eliminates kernel global state by removing all globals. Instead
this introduces a KernelCore class which acts as a kernel instance. This
instance lives in the System class, which keeps its lifetime contained
to the lifetime of the System class.
This also forces the kernel types to actually interact with the main
kernel instance itself instead of having transient kernel state placed
all over several translation units, keeping everything together. It also
has a nice consequence of making dependencies much more explicit.
This also makes our initialization a tad bit more correct. Previously we
were creating a kernel process before the actual kernel was initialized,
which doesn't really make much sense.
The KernelCore class itself follows the PImpl idiom, which allows
keeping all the implementation details sealed away from everything else,
which forces the use of the exposed API and allows us to avoid any
unnecessary inclusions within the main kernel header.
|
|
|
|
|
| |
These conditions are always true, since the outer conditional already
checks for these conditions.
|
|
|
|
| |
Prompts for title type on NCA files.
|
|
|
|
| |
i.e. Load the concatenated 00+01 if 01 exists as well. Needed for split NAND NCAs.
|
|
|
|
| |
Gets the class out of the global namespace.
|
|
|
| |
Full list of new errors and descriptions in core/loader/loader.h
|
| |
|
|
|
|
|
|
| |
* GDBStub works with both Unicorn and Dynarmic now
* Tidy up
|
|\
| |
| | |
video_core: Eliminate the g_renderer global variable
|
| |
| |
| |
| |
| |
| |
| | |
All calling code assumes that the rasterizer will be in a valid state,
which is a totally fine assumption. The only way the rasterizer wouldn't
be is if initialization is done incorrectly or fails, which is checked
against in System::Init().
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We move the initialization of the renderer to the core class, while
keeping the creation of it and any other specifics in video_core. This
way we can ensure that the renderer is initialized and doesn't give
unfettered access to the renderer. This also makes dependencies on types
more explicit.
For example, the GPU class doesn't need to depend on the
existence of a renderer, it only needs to care about whether or not it
has a rasterizer, but since it was accessing the global variable, it was
also making the renderer a part of its dependency chain. By adjusting
the interface, we can get rid of this dependency.
|
|\ \
| |/
|/| |
XCI and Encrypted NCA Support
|
| | |
|
| |
| |
| |
| | |
Removes leftover code from citra that isn't needed.
|
|\ \
| | |
| | | |
video_core: Make global EmuWindow instance part of the base renderer …
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.
This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
|
|\ \
| | |
| | | |
kernel: Move object class to its own source files
|
| |/
| |
| |
| |
| |
| | |
General moving to keep kernel object types separate from the direct
kernel code. Also essentially a preliminary cleanup before eliminating
global kernel state in the kernel code.
|
|/
|
|
|
|
| |
None of these files are used in any meaningful way. They're just
leftovers from citra. Also has the benefit of getting rid of an unused
global variable.
|
|
|
|
| |
- This is necessary so streams are created on the same thread.
|
| |
|
| |
|
|\
| |
| | |
core: Don't construct instance of Core::System, just to access its live instance
|
| |
| |
| |
| |
| |
| | |
This makes it a compilation error to construct additional instances of
the System class directly, preventing accidental wasteful constructions
over and over.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This would result in a lot of allocations and related object
construction, just to toss it all away immediately after the call.
These are definitely not intentional, and it was intended that all of
these should have been accessing the static function GetInstance()
through the name itself, not constructed instances.
|
|/
|
|
|
|
|
|
|
|
| |
* Virtual Filesystem
* Fix delete bug and documentate
* Review fixes + other stuff
* Fix puyo regression
|
|
|
|
| |
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add VfsFile and VfsDirectory classes
* Finish abstract Vfs classes
* Implement RealVfsFile (computer fs backend)
* Finish RealVfsFile and RealVfsDirectory
* Finished OffsetVfsFile
* More changes
* Fix import paths
* Major refactor
* Remove double const
* Use experimental/filesystem or filesystem depending on compiler
* Port partition_filesystem
* More changes
* More Overhaul
* FSP_SRV fixes
* Fixes and testing
* Try to get filesystem to compile
* Filesystem on linux
* Remove std::filesystem and document/test
* Compile fixes
* Missing include
* Bug fixes
* Fixes
* Rename v_file and v_dir
* clang-format fix
* Rename NGLOG_* to LOG_*
* Most review changes
* Fix TODO
* Guess 'main' to be Directory by filename
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
LOG_GENERIC usages will be amended in a follow-up to keep API changes separate from
interface changes, as it will require removing a parameter from the relevant function
in the VMManager class.
|
|
|
|
|
| |
Converts the service manager from a global into an instance-based
variable.
|
|
|
|
|
|
| |
* core, main.h: Abort on 32Bit ROMs
* main.cpp: Fix Grammar
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Implement Pull #3184 from citra: core/arm: Improve timing accuracy before service calls in JIT (Rebased)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
|
|\
| |
| | |
Implement Pull #3275 from citra: core: Don't Shutdown before we've even Init-ed
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
* Port citra #3352 to yuzu
This change allows non x86_64 architectures to compile yuzu by skipping the building of dynarmic
* Fixed clang-format errors
* fixes more clang-format errors
|
| |
|
| |
|
| |
|
|
|
|
| |
* CoreTiming: New CoreTiming; Add Test for CoreTiming
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# 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
|
| |
| |
| |
| | |
The loaders will now just create a Kernel::Process, construct it and return it to the caller, which is responsible for setting it as the current process and configuring the global page table.
|
| |
| |
| |
| | |
The loader is in charge of setting the newly created process's page table as the main one during the loading process.
|
|/
|
|
|
| |
* Network: Set and send the game information over enet
Added Callbacks for RoomMember and GetMemberList to Room in preparation for web_services.
|
| |
|
|
|
|
|
| |
- Deleted GetStatus() because it wasn't used anywhere outside of Core::System.
- Fixed design flaw where the message bar status could be set despite the game being stopped.
|
| |
|
|
|
|
|
|
|
|
| |
- Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review).
- Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore.
- Made dialog messages more clear.
- Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic.
- Cleaned up some other stuff.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This replaces the hardcoded VRAM/DSP mappings with ones made based on
the ExHeader ARM11 Kernel caps list. While this has no visible effect
for most applications (since they use a standard set of mappings) it
does improve support for system modules and n3DS exclusives.
|
|
|
|
| |
More ergonomic to use and will be required for upcoming changes.
|
| |
|
|
|
| |
Fixes #2455
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Currently, this is only ever queried, so adding a function to check if the
server is enabled is more sensible.
If directly modifying this externally is ever desirable, it should be done
by adding a function to the interface, rather than exposing implementation
details directly.
|
| |
|
|
|
|
|
|
|
| |
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|
| |
|
| |
|
| |
|
|\
| |
| | |
hle: Get rid of direct global access to g_reschedule
|
| | |
|
| |
| |
| |
| |
| | |
This shouldn't be directly exposed if there's already a partial API that operates on it.
We can just provide the rest of that API.
|
|/ |
|
|
|
|
| |
Add error popup when citra initialization failed
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
|
|
|
|
| |
Instead just use nullptr to represent no thread is active.
|
|
|
|
|
| |
The TLS area for thread T with id Ti is located at TLS_AREA_VADDR + (Ti - 1) * 0x200.
This allows some games like Mario Kart 7 to continue further.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
ARM_Disasm only has static methods, so there's no need to have an instance of it.
|
|
|
|
| |
This thread will not actually execute instructions, it will only advance the timing/events and try to yield immediately to the next ready thread, if there aren't any ready threads then it will be rescheduled and start its job again.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Core: Cleaned up comment to be more readable.
Citra: Changed loop to be more readable.
|
|
|
|
| |
Core: Added a comment to explain the logic for the RunLoop iterations.
|
|\
| |
| |
| |
| |
| | |
Conflicts:
src/core/hle/function_wrappers.h
src/core/hle/service/gsp.cpp
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|