- Jan 01, 2020
-
-
Markus Wick authored
This saves us two x64 instructions per load/store instruction. TODO: Clean up our memory code. We can use this optimization here as well.
-
- Nov 27, 2019
-
-
Lioncash authored
Now that literally every other API function is converted over to the Memory class, we can just move the file-local page table into the Memory implementation class, finally getting rid of global state within the memory code.
-
Lioncash authored
Now that everything else is migrated over, this is essentially just code relocation and conversion of a global accessor to the class member variable. All that remains is to migrate over the page table.
-
Lioncash authored
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.
-
Lioncash authored
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.
-
Lioncash authored
These currently aren't used anywhere in the codebase, so these are very trivial to move over to the Memory class.
-
Lioncash authored
This is only used within the accelerated rasterizer in two places, so this is also a very trivial migration.
-
Lioncash authored
This only had one usage spot, so this is fairly straightforward to convert over.
-
Lioncash authored
With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
-
Lioncash authored
These will eventually be migrated into the main Memory class, but for now, we put them in an anonymous namespace, so that the other functions that use them, can be migrated over separately.
-
Lioncash authored
A fairly straightforward migration. These member functions can just be mostly moved verbatim with minor changes. We already have the necessary plumbing in places that they're used. IsKernelVirtualAddress() can remain a non-member function, since it doesn't rely on class state in any form.
-
Lioncash authored
Migrates all of the direct mapping facilities over to the new memory class. In the process, this also obsoletes the need for memory_setup.h, so we can remove it entirely from the project.
-
Lioncash authored
Currently, the main memory management code is one of the remaining places where we have global state. The next series of changes will aim to rectify this. This change simply introduces the main skeleton of the class that will contain all the necessary state.
-
- Oct 06, 2019
-
-
Lioncash authored
This only encourages the use of the global system instance (which will be phased out long-term). Instead, we use the direct system function call directly to remove the appealing but discouraged short-hand.
-
- Sep 19, 2019
-
-
Fernando Sahmkow authored
This commit avoids Invalidating and Flushing the GPU if the page is not marked as a RasterizerCache Page.
-
- Jul 06, 2019
-
-
Lioncash authored
These aren't used within the central memory management code, so they can be removed.
-
- Apr 12, 2019
-
-
Lioncash authored
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.
-
- Apr 07, 2019
-
-
Lioncash authored
Now that nothing actually touches the internal page table aside from the memory subsystem itself, we can remove the accessor to it.
-
- Mar 21, 2019
-
-
bunnei authored
- GPU will be released on shutdown, before pages are unmapped. - On subsequent runs, current_page_table will be not nullptr, but GPU might not be valid yet.
-
- Mar 17, 2019
-
-
bunnei authored
-
- Mar 16, 2019
-
-
bunnei authored
-
- Mar 15, 2019
-
-
bunnei authored
-
- Mar 07, 2019
-
-
bunnei authored
-
- Mar 02, 2019
-
-
Weiyi Wang authored
The comment already invalidates itself: neither MMIO nor rasterizer cache belongsHLE kernel state. This mutex has a too large scope if MMIO or cache is included, which is prone to dead lock when multiple thread acquires these resource at the same time. If necessary, each MMIO component or rasterizer should have their own lock.
-
- Feb 27, 2019
-
-
Annomatg authored
- Memory::MapPages total samplecount was reduced from 4.6% to 1.06%. - From main menu into the game from 1.03% to 0.35%
-
- Dec 19, 2018
-
-
David Marcec authored
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
-
- Dec 06, 2018
-
-
Lioncash authored
Given memory should always be expected to be valid during normal execution, this should be a debug assertion, rather than a check in regular builds.
-
Lioncash authored
This was only ever public so that code could check whether or not a handle was valid or not. Instead of exposing the object directly and allowing external code to potentially mess with the map contents, we just provide a member function that allows checking whether or not a handle is valid. This makes all member variables of the VMManager class private except for the page table.
-
- Dec 05, 2018
-
-
heapo authored
Call shrink_to_fit after page-table vector resizing to cause crt to actually lower vector capacity. For 36-bit titles saves 800MB of commit.
-
- Oct 30, 2018
-
-
Frederic L authored
* 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
-
- Sep 30, 2018
-
-
Lioncash authored
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
-
- Sep 25, 2018
-
-
Lioncash authored
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
-
Lioncash authored
Given games can also request a 32-bit or 39-bit address space, we shouldn't be hardcoding the address space range as 36-bit.
-
- Sep 15, 2018
-
-
fearlessTobi authored
-
- Aug 31, 2018
-
-
bunnei authored
-
- Aug 28, 2018
-
-
Lioncash authored
Makes the class interface consistent and provides accessors for obtaining a reference to the memory manager instance. Given we also return references, this makes our more flimsy uses of const apparent, given const doesn't propagate through pointers in the way one would typically expect. This makes our mutable state more apparent in some places.
-
- Aug 04, 2018
-
-
Lioncash authored
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().
-
Lioncash authored
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.
-
- Aug 03, 2018