diff options
author | bunnei <bunneidev@gmail.com> | 2014-11-23 04:35:45 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-12-12 06:15:47 +0100 |
commit | 4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a (patch) | |
tree | c8ad6079befffdc1548e9402ca342f15610ad598 /src/core | |
parent | Merge pull request #256 from Subv/mutex (diff) | |
download | yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar.gz yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar.bz2 yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar.lz yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar.xz yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.tar.zst yuzu-4cb7a44d4e30cd7bc0ec0f07b4b734a7e03f1a3a.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/svc.cpp | 2 | ||||
-rw-r--r-- | src/core/mem_map.cpp | 16 | ||||
-rw-r--r-- | src/core/mem_map.h | 14 | ||||
-rw-r--r-- | src/core/mem_map_funcs.cpp | 32 |
4 files changed, 32 insertions, 32 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index a5805ed05..b99c301d4 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -43,7 +43,7 @@ static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, // Map GSP heap memory case MEMORY_OPERATION_GSP_HEAP: - *out_addr = Memory::MapBlock_HeapGSP(size, operation, permissions); + *out_addr = Memory::MapBlock_HeapLinear(size, operation, permissions); break; // Unknown ControlMemory operation diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp index 74a93b1d9..e1c2580ff 100644 --- a/src/core/mem_map.cpp +++ b/src/core/mem_map.cpp @@ -18,7 +18,7 @@ static MemArena arena; ///< The MemArena class u8* g_exefs_code = nullptr; ///< ExeFS:/.code is loaded here u8* g_system_mem = nullptr; ///< System memory u8* g_heap = nullptr; ///< Application heap (main memory) -u8* g_heap_gsp = nullptr; ///< GSP heap (main memory) +u8* g_heap_linear = nullptr; ///< Linear heap u8* g_vram = nullptr; ///< Video memory (VRAM) pointer u8* g_shared_mem = nullptr; ///< Shared memory u8* g_kernel_mem; ///< Kernel memory @@ -36,13 +36,13 @@ static u8* physical_kernel_mem; ///< Kernel memory // We don't declare the IO region in here since its handled by other means. static MemoryView g_views[] = { - {&g_exefs_code, &physical_exefs_code, EXEFS_CODE_VADDR, EXEFS_CODE_SIZE, 0}, - {&g_vram, &physical_vram, VRAM_VADDR, VRAM_SIZE, 0}, - {&g_heap, &physical_fcram, HEAP_VADDR, HEAP_SIZE, MV_IS_PRIMARY_RAM}, - {&g_shared_mem, &physical_shared_mem, SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, 0}, - {&g_system_mem, &physical_system_mem, SYSTEM_MEMORY_VADDR, SYSTEM_MEMORY_SIZE, 0}, - {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0}, - {&g_heap_gsp, &physical_heap_gsp, HEAP_GSP_VADDR, HEAP_GSP_SIZE, 0}, + {&g_exefs_code, &physical_exefs_code, EXEFS_CODE_VADDR, EXEFS_CODE_SIZE, 0}, + {&g_vram, &physical_vram, VRAM_VADDR, VRAM_SIZE, 0}, + {&g_heap, &physical_fcram, HEAP_VADDR, HEAP_SIZE, MV_IS_PRIMARY_RAM}, + {&g_shared_mem, &physical_shared_mem, SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, 0}, + {&g_system_mem, &physical_system_mem, SYSTEM_MEMORY_VADDR, SYSTEM_MEMORY_SIZE, 0}, + {&g_kernel_mem, &physical_kernel_mem, KERNEL_MEMORY_VADDR, KERNEL_MEMORY_SIZE, 0}, + {&g_heap_linear, &physical_heap_gsp, HEAP_LINEAR_VADDR, HEAP_LINEAR_SIZE, 0}, }; /*static MemoryView views[] = diff --git a/src/core/mem_map.h b/src/core/mem_map.h index f17afb60d..7b750f848 100644 --- a/src/core/mem_map.h +++ b/src/core/mem_map.h @@ -57,11 +57,11 @@ enum : u32 { HEAP_VADDR = 0x08000000, HEAP_VADDR_END = (HEAP_VADDR + HEAP_SIZE), - HEAP_GSP_SIZE = 0x02000000, ///< GSP heap size... TODO: Define correctly? - HEAP_GSP_VADDR = 0x14000000, - HEAP_GSP_VADDR_END = (HEAP_GSP_VADDR + HEAP_GSP_SIZE), - HEAP_GSP_PADDR = 0x00000000, - HEAP_GSP_PADDR_END = (HEAP_GSP_PADDR + HEAP_GSP_SIZE), + HEAP_LINEAR_SIZE = 0x08000000, ///< Linear heap size... TODO: Define correctly? + HEAP_LINEAR_VADDR = 0x14000000, + HEAP_LINEAR_VADDR_END = (HEAP_LINEAR_VADDR + HEAP_LINEAR_SIZE), + HEAP_LINEAR_PADDR = 0x00000000, + HEAP_LINEAR_PADDR_END = (HEAP_LINEAR_PADDR + HEAP_LINEAR_SIZE), HARDWARE_IO_SIZE = 0x01000000, HARDWARE_IO_PADDR = 0x10000000, ///< IO physical address start @@ -112,7 +112,7 @@ extern u8 *g_base; // These are guaranteed to point to "low memory" addresses (sub-32-bit). // 64-bit: Pointers to low-mem (sub-0x10000000) mirror // 32-bit: Same as the corresponding physical/virtual pointers. -extern u8* g_heap_gsp; ///< GSP heap (main memory) +extern u8* g_heap_linear; ///< Linear heap (main memory) extern u8* g_heap; ///< Application heap (main memory) extern u8* g_vram; ///< Video memory (VRAM) extern u8* g_shared_mem; ///< Shared memory @@ -159,7 +159,7 @@ u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions); * @param operation Memory map operation type * @param permissions Control memory permissions */ -u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions); +u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions); inline const char* GetCharPointer(const VAddr address) { return (const char *)GetPointer(address); diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp index 1887bcedb..b78821a3b 100644 --- a/src/core/mem_map_funcs.cpp +++ b/src/core/mem_map_funcs.cpp @@ -13,7 +13,7 @@ namespace Memory { static std::map<u32, MemoryBlock> heap_map; -static std::map<u32, MemoryBlock> heap_gsp_map; +static std::map<u32, MemoryBlock> heap_linear_map; static std::map<u32, MemoryBlock> shared_map; /// Convert a physical address to virtual address @@ -67,9 +67,9 @@ inline void Read(T &var, const VAddr vaddr) { } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { var = *((const T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR]); - // FCRAM - GSP heap - } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { - var = *((const T*)&g_heap_gsp[vaddr - HEAP_GSP_VADDR]); + // FCRAM - linear heap + } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) { + var = *((const T*)&g_heap_linear[vaddr - HEAP_LINEAR_VADDR]); // FCRAM - application heap } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { @@ -112,9 +112,9 @@ inline void Write(const VAddr vaddr, const T data) { } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { *(T*)&g_exefs_code[vaddr - EXEFS_CODE_VADDR] = data; - // FCRAM - GSP heap - } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { - *(T*)&g_heap_gsp[vaddr - HEAP_GSP_VADDR] = data; + // FCRAM - linear heap + } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) { + *(T*)&g_heap_linear[vaddr - HEAP_LINEAR_VADDR] = data; // FCRAM - application heap } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { @@ -154,9 +154,9 @@ u8 *GetPointer(const VAddr vaddr) { } else if ((vaddr >= EXEFS_CODE_VADDR) && (vaddr < EXEFS_CODE_VADDR_END)) { return g_exefs_code + (vaddr - EXEFS_CODE_VADDR); - // FCRAM - GSP heap - } else if ((vaddr >= HEAP_GSP_VADDR) && (vaddr < HEAP_GSP_VADDR_END)) { - return g_heap_gsp + (vaddr - HEAP_GSP_VADDR); + // FCRAM - linear heap + } else if ((vaddr >= HEAP_LINEAR_VADDR) && (vaddr < HEAP_LINEAR_VADDR_END)) { + return g_heap_linear + (vaddr - HEAP_LINEAR_VADDR); // FCRAM - application heap } else if ((vaddr >= HEAP_VADDR) && (vaddr < HEAP_VADDR_END)) { @@ -204,24 +204,24 @@ u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions) { } /** - * Maps a block of memory on the GSP heap + * Maps a block of memory on the linear heap * @param size Size of block in bytes * @param operation Memory map operation type * @param flags Memory allocation flags */ -u32 MapBlock_HeapGSP(u32 size, u32 operation, u32 permissions) { +u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions) { MemoryBlock block; - block.base_address = HEAP_GSP_VADDR; + block.base_address = HEAP_LINEAR_VADDR; block.size = size; block.operation = operation; block.permissions = permissions; - if (heap_gsp_map.size() > 0) { - const MemoryBlock last_block = heap_gsp_map.rbegin()->second; + if (heap_linear_map.size() > 0) { + const MemoryBlock last_block = heap_linear_map.rbegin()->second; block.address = last_block.address + last_block.size; } - heap_gsp_map[block.GetVirtualAddress()] = block; + heap_linear_map[block.GetVirtualAddress()] = block; return block.GetVirtualAddress(); } |