summaryrefslogtreecommitdiffstats
path: root/src/core/mem_map.h
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-18 05:05:31 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-18 05:05:31 +0200
commitb2baafaf8ba760ce2b975391fd04db52ad386e29 (patch)
treedb16aba20508121cd0d6d7cd489d1e1963b67525 /src/core/mem_map.h
parentfixed bug in Memory::GetPointer (diff)
downloadyuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.gz
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.bz2
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.lz
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.xz
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.zst
yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.zip
Diffstat (limited to 'src/core/mem_map.h')
-rw-r--r--src/core/mem_map.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index 9931daece..ab1eb2606 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -49,6 +49,23 @@ enum {
////////////////////////////////////////////////////////////////////////////////////////////////////
+/// Represents a block of heap memory mapped by ControlMemory
+struct HeapBlock {
+ HeapBlock() : base_address(0), address(0), size(0), operation(0), permissions(0) {
+ }
+ u32 base_address;
+ u32 address;
+ u32 size;
+ u32 operation;
+ u32 permissions;
+
+ const u32 GetVirtualAddress() const{
+ return base_address + address;
+ }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
// Base is a pointer to the base of the memory map. Yes, some MMU tricks
// are used to set up a full GC or Wii memory map in process memory. on
// 32-bit, you have to mask your offsets with 0x3FFFFFFF. This means that
@@ -81,6 +98,14 @@ void Write32(const u32 addr, const u32 data);
u8* GetPointer(const u32 Address);
+/**
+ * Maps a block of memory on the GSP heap
+ * @param size Size of block in bytes
+ * @param operation Control memory operation
+ * @param permissions Control memory permissions
+ */
+u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions);
+
inline const char* GetCharPointer(const u32 address) {
return (const char *)GetPointer(address);
}