aboutsummaryrefslogtreecommitdiff
path: root/src/core/memory.h
AgeCommit message (Collapse)Author
2020-04-17core: memory: Updates for new VMM.bunnei
2020-04-17core: memory: Move to Core::Memory namespace.bunnei
- helpful to disambiguate Kernel::Memory namespace.
2020-04-08Memory: Address Feedback.Fernando Sahmkow
2020-04-06Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow
2020-01-18core/memory: Create a special MapMemoryRegion for physical memory.Markus Wick
This allows us to create a fastmem arena within the memory.cpp helpers.
2019-11-26core/memory; Migrate over SetCurrentPageTable() to the Memory classLioncash
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.
2019-11-26core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash
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.
2019-11-26core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash
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.
2019-11-26core/memory: Migrate over ZeroBlock() and CopyBlock() to the Memory classLioncash
These currently aren't used anywhere in the codebase, so these are very trivial to move over to the Memory class.
2019-11-26core/memory: Migrate over RasterizerMarkRegionCached() to the Memory classLioncash
This is only used within the accelerated rasterizer in two places, so this is also a very trivial migration.
2019-11-26core/memory: Migrate over ReadCString() to the Memory classLioncash
This only had one usage spot, so this is fairly straightforward to convert over.
2019-11-26core/memory: Migrate over GetPointer()Lioncash
With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
2019-11-26core/memory: Migrate over address checking functions to the new Memory classLioncash
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.
2019-11-26core/memory: Migrate over memory mapping functions to the new Memory classLioncash
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.
2019-11-26core/memory: Introduce skeleton of Memory classLioncash
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.
2019-07-06memory: Remove unused PageTable forward declarationLioncash
This isn't used by anything in the header file, so it can be removed.
2019-05-07core/memory: Remove unused FlushMode enumLioncash
Recent changes to memory-related code resulted in this being unused, so we can remove it.
2019-04-11core/cpu_core_manager: Create threads separately from initialization.Lioncash
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.
2019-04-07Merge pull request #2361 from lioncash/pagetablebunnei
core/memory: Minor simplifications to page table management
2019-04-07core/memory: Remove unused enum constantsLioncash
These are holdovers from Citra and can be removed.
2019-04-07core/memory: Remove GetCurrentPageTable()Lioncash
Now that nothing actually touches the internal page table aside from the memory subsystem itself, we can remove the accessor to it.
2019-03-21core/memory: Remove unnecessary includesLioncash
In 93da8e0abfcdcc6e3cb5488a0db12373429f1377, the page table construct was moved to the common library (which utilized these inclusions). Since the move, nothing requires these headers to be included within the memory header.
2019-03-16core: Move PageTable struct into Common.bunnei
2019-03-16memory: Simplify rasterizer cache operations.bunnei
2018-09-24memory: Dehardcode the use of fixed memory range constantsLioncash
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.
2018-09-24memory: Dehardcode the use of a 36-bit address spaceLioncash
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.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi
2018-08-31gl_renderer: Cache textures, framebuffers, and shaders based on CPU address.bunnei
2018-08-05memory: Make prototype parameter names match their definitionsLioncash
Keeps the code consistent.
2018-08-05memory: Correct prototype of ZeroBlockLioncash
Previously, the prototype wasn't matching the definition, which has a Processor parameter before the destination address.
2018-08-05memory: Remove unnecessary const qualifiers in prototypesLioncash
These aren't necessary, as value-wise const only matters in the definition.
2018-08-03core/memory: Get rid of 3DS leftoversLioncash
Removes leftover code from citra that isn't needed.
2018-06-22Kernel/Arbiters: Fix casts, cleanup comments/magic numbersMichael Scire
2018-04-24gl_rasterizer_cache: Update to be based on GPU addresses, not CPU addresses.bunnei
2018-03-31memory: Fix stack region.bunnei
2018-03-26memory: Add RasterizerMarkRegionCached code and cleanup.bunnei
2018-03-23Merge pull request #265 from bunnei/tegra-progress-2bunnei
Tegra progress 2
2018-03-23rasterizer: Flush and invalidate regions should be 64-bit.bunnei
2018-03-22memory: Port RasterizerFlushVirtualRegion from Citra.bunnei
2018-03-22Remove more N3DS ReferencesN00byKing
2018-03-16memory: Add regions for map region, "new" map region, etc.bunnei
2018-02-12arm_dynarmic: Support direct page table accessMerryMage
2018-01-27memory: Replace all memory hooking with Special regionsMerryMage
2018-01-16Update memory.hDavid
2018-01-16Increased heap size and changed tls area vaddrDavid Marcec
2018-01-01core/video_core: Fix a bunch of u64 -> u32 warnings.bunnei
2017-12-28svc: Implement MapMemory.bunnei
2017-10-22memory: Support 32-bit paging, move heap address space up.bunnei
2017-10-09Merge remote-tracking branch 'upstream/master' into nxbunnei
# 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
2017-10-09loader: Various improvements for NSO/NRO loaders.bunnei