diff options
Diffstat (limited to 'src/core/memory.h')
-rw-r--r-- | src/core/memory.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index f5bf0141f..e9b8ca873 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -36,7 +36,10 @@ enum class PageType : u8 { Unmapped, /// Page is mapped to regular memory. This is the only type you can get pointers to. Memory, - /// Page is mapped to a memory hook, which intercepts read and write requests. + /// Page is mapped to regular memory, but also needs to check for rasterizer cache flushing and + /// invalidation + RasterizerCachedMemory, + /// Page is mapped to a I/O region. Writing and reading to this page is handled by functions. Special, }; @@ -159,12 +162,13 @@ enum : VAddr { TLS_AREA_VADDR = NEW_LINEAR_HEAP_VADDR_END, TLS_ENTRY_SIZE = 0x200, TLS_AREA_SIZE = 0x10000000, - TLS_ADREA_VADDR_END = TLS_AREA_VADDR + TLS_AREA_SIZE, + TLS_AREA_VADDR_END = TLS_AREA_VADDR + TLS_AREA_SIZE, /// Application stack - STACK_VADDR = TLS_ADREA_VADDR_END, - STACK_SIZE = 0x10000, - STACK_VADDR_END = STACK_VADDR + STACK_SIZE, + STACK_AREA_VADDR = TLS_AREA_VADDR_END, + STACK_AREA_SIZE = 0x10000000, + STACK_AREA_VADDR_END = STACK_AREA_VADDR + STACK_AREA_SIZE, + DEFAULT_STACK_SIZE = 0x100000, /// Application heap /// Size is confirmed to be a static value on fw 3.0.0 @@ -242,4 +246,24 @@ boost::optional<VAddr> PhysicalToVirtualAddress(PAddr addr); */ u8* GetPhysicalPointer(PAddr address); +enum class FlushMode { + /// Write back modified surfaces to RAM + Flush, + /// Remove region from the cache + Invalidate, + /// Write back modified surfaces to RAM, and also remove them from the cache + FlushAndInvalidate, +}; + +/** + * Mark each page touching the region as cached. + */ +void RasterizerMarkRegionCached(VAddr start, u64 size, bool cached); + +/** + * Flushes and invalidates any externally cached rasterizer resources touching the given virtual + * address region. + */ +void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode); + } // namespace Memory |