summaryrefslogtreecommitdiffstats
path: root/src/core/memory.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* code: dodge PAGE_SIZE #defineKyle Kienapfel2022-08-201-3/+3
| | | | | | | | | | | | | | | | | | | | | Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number This is great except in yuzu we're using PAGE_SIZE as a variable Specific example `static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;` PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables. Simply deleted the underscores, and then added YUZU_ prefix Might be worth noting that there are multiple uses in different classes/namespaces This list may not be exhaustive Core::Memory 12 bits (4096) QueryCacheBase 12 bits ShaderCache 14 bits (16384) TextureCache 20 bits (1048576, or 1MB) Fixes #8779
* chore: make yuzu REUSE compliantAndrea Pappacoda2022-07-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [REUSE] is a specification that aims at making file copyright information consistent, so that it can be both human and machine readable. It basically requires that all files have a header containing copyright and licensing information. When this isn't possible, like when dealing with binary assets, generated files or embedded third-party dependencies, it is permitted to insert copyright information in the `.reuse/dep5` file. Oh, and it also requires that all the licenses used in the project are present in the `LICENSES` folder, that's why the diff is so huge. This can be done automatically with `reuse download --all`. The `reuse` tool also contains a handy subcommand that analyzes the project and tells whether or not the project is (still) compliant, `reuse lint`. Following REUSE has a few advantages over the current approach: - Copyright information is easy to access for users / downstream - Files like `dist/license.md` do not need to exist anymore, as `.reuse/dep5` is used instead - `reuse lint` makes it easy to ensure that copyright information of files like binary assets / images is always accurate and up to date To add copyright information of files that didn't have it I looked up who committed what and when, for each file. As yuzu contributors do not have to sign a CLA or similar I couldn't assume that copyright ownership was of the "yuzu Emulator Project", so I used the name and/or email of the commit author instead. [REUSE]: https://reuse.software Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
* Project AndioKelebek12022-07-221-0/+13
|
* core/debugger: memory breakpoint supportLiam2022-06-161-0/+11
|
* core/debugger: Implement new GDB stub debuggerLiam2022-06-011-0/+11
|
* memory: Address lioncash's reviewyzct123452021-08-051-1/+1
|
* memory: Clean up codeyzct123452021-08-051-100/+4
|
* hle: kernel: Use host memory allocations for KSlabMemory.bunnei2021-05-211-9/+0
| | | | - There are some issues with the current workaround, we will just use host memory until we have a complete kernel memory implementation.
* hle: kernel: Rename Process to KProcess.bunnei2021-05-061-9/+9
|
* core: memory: Add a work-around to allocate and access kernel memory regions by vaddr.bunnei2021-05-061-0/+16
|
* core: memory: Add templated GetPointer methods.bunnei2021-02-191-0/+10
|
* memory: Remove MemoryHookMerryMage2021-01-011-34/+0
|
* ARM/Memory: Correct Exclusive Monitor and Implement Exclusive Memory Writes.Fernando Sahmkow2020-06-271-0/+65
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-271-1/+1
| | | | | | | 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.
* core: memory: Updates for new VMM.bunnei2020-04-171-14/+1
|
* core: memory: Move to Core::Memory namespace.bunnei2020-04-171-2/+2
| | | | - helpful to disambiguate Kernel::Memory namespace.
* Memory: Address Feedback.Fernando Sahmkow2020-04-081-0/+68
|
* Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow2020-04-061-0/+10
|
* core/memory: Create a special MapMemoryRegion for physical memory.Markus Wick2020-01-181-1/+15
| | | | This allows us to create a fastmem arena within the memory.cpp helpers.
* core/memory; Migrate over SetCurrentPageTable() to the Memory classLioncash2019-11-271-4/+7
| | | | | | | 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.
* core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash2019-11-271-9/+88
| | | | | | | | | 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 classLioncash2019-11-271-7/+78
| | | | | | | | | | | | | | 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/memory: Migrate over ZeroBlock() and CopyBlock() to the Memory classLioncash2019-11-271-2/+51
| | | | | These currently aren't used anywhere in the codebase, so these are very trivial to move over to the Memory class.
* core/memory: Migrate over RasterizerMarkRegionCached() to the Memory classLioncash2019-11-271-5/+10
| | | | | This is only used within the accelerated rasterizer in two places, so this is also a very trivial migration.
* core/memory: Migrate over ReadCString() to the Memory classLioncash2019-11-271-2/+17
| | | | | This only had one usage spot, so this is fairly straightforward to convert over.
* core/memory: Migrate over GetPointer()Lioncash2019-11-271-2/+20
| | | | | With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
* core/memory: Migrate over address checking functions to the new Memory classLioncash2019-11-271-3/+21
| | | | | | | | | 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.
* core/memory: Migrate over memory mapping functions to the new Memory classLioncash2019-11-271-0/+59
| | | | | | 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.
* core/memory: Introduce skeleton of Memory classLioncash2019-11-271-0/+21
| | | | | | | | | 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.
* memory: Remove unused PageTable forward declarationLioncash2019-07-061-4/+0
| | | | This isn't used by anything in the header file, so it can be removed.
* core/memory: Remove unused FlushMode enumLioncash2019-05-071-9/+0
| | | | | Recent changes to memory-related code resulted in this being unused, so we can remove it.
* core/cpu_core_manager: Create threads separately from initialization.Lioncash2019-04-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #2361 from lioncash/pagetablebunnei2019-04-071-2/+1
|\ | | | | core/memory: Minor simplifications to page table management
| * core/memory: Remove GetCurrentPageTable()Lioncash2019-04-071-2/+1
| | | | | | | | | | Now that nothing actually touches the internal page table aside from the memory subsystem itself, we can remove the accessor to it.
* | core/memory: Remove unused enum constantsLioncash2019-04-071-10/+0
|/ | | | These are holdovers from Citra and can be removed.
* core/memory: Remove unnecessary includesLioncash2019-03-211-3/+0
| | | | | | | 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.
* core: Move PageTable struct into Common.bunnei2019-03-171-68/+6
|
* memory: Simplify rasterizer cache operations.bunnei2019-03-161-6/+0
|
* memory: Dehardcode the use of fixed memory range constantsLioncash2018-09-251-30/+1
| | | | | | | | 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.
* memory: Dehardcode the use of a 36-bit address spaceLioncash2018-09-251-11/+21
| | | | | 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.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-9/+9
|
* gl_renderer: Cache textures, framebuffers, and shaders based on CPU address.bunnei2018-08-311-2/+1
|
* memory: Make prototype parameter names match their definitionsLioncash2018-08-061-5/+5
| | | | Keeps the code consistent.
* memory: Correct prototype of ZeroBlockLioncash2018-08-061-1/+1
| | | | | Previously, the prototype wasn't matching the definition, which has a Processor parameter before the destination address.
* memory: Remove unnecessary const qualifiers in prototypesLioncash2018-08-061-9/+8
| | | | | These aren't necessary, as value-wise const only matters in the definition.
* core/memory: Get rid of 3DS leftoversLioncash2018-08-031-87/+1
| | | | Removes leftover code from citra that isn't needed.
* Kernel/Arbiters: Fix casts, cleanup comments/magic numbersMichael Scire2018-06-221-0/+7
|
* gl_rasterizer_cache: Update to be based on GPU addresses, not CPU addresses.bunnei2018-04-251-1/+2
|
* memory: Fix stack region.bunnei2018-03-311-4/+5
|
* memory: Add RasterizerMarkRegionCached code and cleanup.bunnei2018-03-271-0/+5
|
* Merge pull request #265 from bunnei/tegra-progress-2bunnei2018-03-241-1/+19
|\ | | | | Tegra progress 2
| * rasterizer: Flush and invalidate regions should be 64-bit.bunnei2018-03-231-1/+1
| |
| * memory: Port RasterizerFlushVirtualRegion from Citra.bunnei2018-03-231-1/+19
| |
* | Remove more N3DS ReferencesN00byKing2018-03-221-11/+0
|/
* memory: Add regions for map region, "new" map region, etc.bunnei2018-03-161-19/+29
|
* arm_dynarmic: Support direct page table accessMerryMage2018-02-121-4/+5
|
* memory: Replace all memory hooking with Special regionsMerryMage2018-01-271-51/+21
|
* Update memory.hDavid2018-01-171-2/+2
|
* Increased heap size and changed tls area vaddrDavid Marcec2018-01-161-2/+2
|
* core/video_core: Fix a bunch of u64 -> u32 warnings.bunnei2018-01-011-5/+5
|
* svc: Implement MapMemory.bunnei2017-12-291-1/+1
|
* memory: Support 32-bit paging, move heap address space up.bunnei2017-10-231-2/+2
|
* Merge remote-tracking branch 'upstream/master' into nxbunnei2017-10-101-14/+77
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # 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
| * Memory: Make WriteBlock take a Process parameter on which to operateSubv2017-10-011-0/+2
| |
| * Memory: Make ReadBlock take a Process parameter on which to operateSubv2017-10-011-0/+2
| |
| * Memory: Allow IsValidVirtualAddress to be called with a specific process parameter.Subv2017-09-271-0/+7
| | | | | | | | There is still an overload of IsValidVirtualAddress that only takes the VAddr and will default to the current process.
| * memory: Remove GetCurrentPageTablePointersMerryMage2017-09-241-6/+0
| |
| * memory: Add GetCurrentPageTable/SetCurrentPageTableMerryMage2017-09-241-1/+2
| | | | | | | | Don't expose Memory::current_page_table as a global.
| * Kernel/Memory: Changed GetPhysicalPointer so that it doesn't go through the current process' page table to obtain a pointer.Subv2017-09-151-2/+0
| |
| * Kernel/Memory: Give each Process its own page table.Subv2017-09-101-1/+59
| | | | | | | | The loader is in charge of setting the newly created process's page table as the main one during the loading process.
* | loader: Various improvements for NSO/NRO loaders.bunnei2017-10-101-2/+2
| |
* | core: Various changes to support 64-bit addressing.bunnei2017-09-301-8/+8
|/
* Memory: Add function to flush a virtual range from the rasterizer cacheYuri Kunde Schlesner2017-06-221-0/+13
| | | | | | This is slightly more ergonomic to use, correctly handles virtual regions which are disjoint in physical addressing space, and checks only regions which can be cached by the rasterizer.
* Memory: Add TryVirtualToPhysicalAddress, returning a boost::optionalYuri Kunde Schlesner2017-06-221-3/+11
|
* Memory: Make PhysicalToVirtualAddress return a boost::optionalYuri Kunde Schlesner2017-06-221-3/+4
| | | | And fix a few places in the code to take advantage of that.
* Memory: Add enum definitions for the n3DS FCRAM sizeYuri Kunde Schlesner2017-06-211-1/+3
|
* Memory: Add constants for the n3DS additional RAMYuri Kunde Schlesner2017-05-101-0/+10
| | | | This is 4MB of extra, separate memory that was added on the New 3DS.
* Expose page table to dynarmic for optimized reads and writes to the JITJames Rowe2016-11-251-0/+9
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-1/+0
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-35/+35
|
* Memory: add ReadCString functionwwylele2016-08-271-0/+3
|
* Memory: Make ReadBlock and WriteBlock accept void pointers.Subv2016-05-281-2/+2
|
* Memory: CopyBlockMerryMage2016-05-281-2/+2
|
* Memory: ZeroBlockMerryMage2016-05-211-0/+1
|
* Memory: ReadBlock/WriteBlockMerryMage2016-05-211-1/+3
|
* Memory: IsValidVirtualAddress/IsValidPhysicalAddressMerryMage2016-05-211-0/+3
|
* Merge pull request #1695 from Subv/tls_allocbunnei2016-05-131-6/+0
|\ | | | | Kernel/Threads: Dynamically allocate the TLS region for threads.
| * Kernel/Threads: Dynamically allocate the TLS region for threads in the BASE region of the linear heap.Subv2016-05-071-6/+0
| | | | | | | | | | | | Each thread gets a 0x200-byte area from the 0x1000-sized page, when all 8 thread slots in a single page are used up, the kernel allocates a new page to hold another 8 entries. This is consistent with what the real kernel does.
* | HWRasterizer: Texture forwardingtfarley2016-04-211-0/+16
|/
* Fix broken boot introduced by last-minute change in #1025Yuri Kunde Schlesner2015-08-221-1/+1
|
* Kernel: Implement svcGetProcessInfo in a basic wayYuri Kunde Schlesner2015-08-161-1/+3
| | | | | This also adds some basic memory usage accounting. These two types are used by Super Smash Bros. during startup.
* Kernel: Add more infrastructure to support different memory layoutsYuri Kunde Schlesner2015-08-161-0/+5
| | | | | | This adds some structures necessary to support multiple memory regions in the future. It also adds support for different system memory types and the new linear heap mapping at 0x30000000.
* Memory: Move address type conversion routines to memory.cpp/hYuri Kunde Schlesner2015-08-161-0/+11
| | | | | These helpers aren't really part of the kernel, and mem_map.cpp/h is going to be moved there next.
* Memory: Move PAGE_MASK and PAGE_BITS to memory.hYuri Kunde Schlesner2015-08-161-0/+2
|
* Common: Cleanup memory and misc includes.Emmanuel Gil Peyrot2015-06-281-0/+2
|
* Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot2015-05-291-1/+1
|
* Memory: Use a table based lookup scheme to read from memory regionsYuri Kunde Schlesner2015-05-151-0/+4
|
* Memmap: Re-organize memory function in two filesYuri Kunde Schlesner2015-05-151-0/+125
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.