summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-24 07:12:57 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-27 08:24:12 +0200
commit88365a23e76fe3a4a64c9dc65aa8554e25a20af0 (patch)
tree0ea4d18e1721471c8488f795f09f86c2bf80d148
parentKernel: Add VMManager to manage process address spaces (diff)
downloadyuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar.gz
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar.bz2
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar.lz
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar.xz
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.tar.zst
yuzu-88365a23e76fe3a4a64c9dc65aa8554e25a20af0.zip
-rw-r--r--src/core/mem_map.cpp31
-rw-r--r--src/core/mem_map.h8
2 files changed, 8 insertions, 31 deletions
diff --git a/src/core/mem_map.cpp b/src/core/mem_map.cpp
index 66d95ed27..bf814b945 100644
--- a/src/core/mem_map.cpp
+++ b/src/core/mem_map.cpp
@@ -21,18 +21,9 @@
namespace Memory {
-u8* g_exefs_code; ///< ExeFS:/.code is loaded here
-u8* g_heap; ///< Application heap (main memory)
-u8* g_shared_mem; ///< Shared memory
-u8* g_heap_linear; ///< Linear heap
-u8* g_vram; ///< Video memory (VRAM) pointer
-u8* g_dsp_mem; ///< DSP memory
-u8* g_tls_mem; ///< TLS memory
-
namespace {
struct MemoryArea {
- u8** ptr;
u32 base;
u32 size;
const char* name;
@@ -40,13 +31,13 @@ struct MemoryArea {
// We don't declare the IO regions in here since its handled by other means.
static MemoryArea memory_areas[] = {
- {&g_exefs_code, PROCESS_IMAGE_VADDR, PROCESS_IMAGE_MAX_SIZE, "Process Image"},
- {&g_heap, HEAP_VADDR, HEAP_SIZE, "Heap"},
- {&g_shared_mem, SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, "Shared Memory"},
- {&g_heap_linear, LINEAR_HEAP_VADDR, LINEAR_HEAP_SIZE, "Linear Heap"},
- {&g_vram, VRAM_VADDR, VRAM_SIZE, "VRAM"},
- {&g_dsp_mem, DSP_RAM_VADDR, DSP_RAM_SIZE, "DSP RAM"},
- {&g_tls_mem, TLS_AREA_VADDR, TLS_AREA_SIZE, "TLS Area"},
+ {PROCESS_IMAGE_VADDR, PROCESS_IMAGE_MAX_SIZE, "Process Image"}, // ExeFS:/.code is loaded here
+ {HEAP_VADDR, HEAP_SIZE, "Heap"}, // Application heap (main memory)
+ {SHARED_MEMORY_VADDR, SHARED_MEMORY_SIZE, "Shared Memory"}, // Shared memory
+ {LINEAR_HEAP_VADDR, LINEAR_HEAP_SIZE, "Linear Heap"}, // Linear heap (main memory)
+ {VRAM_VADDR, VRAM_SIZE, "VRAM"}, // Video memory (VRAM)
+ {DSP_RAM_VADDR, DSP_RAM_SIZE, "DSP RAM"}, // DSP memory
+ {TLS_AREA_VADDR, TLS_AREA_SIZE, "TLS Area"}, // TLS memory
};
/// Represents a block of memory mapped by ControlMemory/MapMemoryBlock
@@ -150,7 +141,6 @@ void Init() {
for (MemoryArea& area : memory_areas) {
auto block = std::make_shared<std::vector<u8>>(area.size);
- *area.ptr = block->data(); // TODO(yuriks): Remove
address_space.MapMemoryBlock(area.base, std::move(block), 0, area.size, MemoryState::Private).Unwrap();
}
@@ -162,19 +152,14 @@ void Init() {
(u8*)&SharedPage::shared_page, SHARED_PAGE_SIZE, MemoryState::Shared).MoveFrom();
address_space.Reprotect(shared_page_vma, VMAPermission::Read);
- LOG_DEBUG(HW_Memory, "initialized OK, RAM at %p", g_heap);
+ LOG_DEBUG(HW_Memory, "initialized OK");
}
void Shutdown() {
heap_map.clear();
heap_linear_map.clear();
-
address_space.Reset();
- for (MemoryArea& area : memory_areas) {
- *area.ptr = nullptr;
- }
-
LOG_DEBUG(HW_Memory, "shutdown OK");
}
diff --git a/src/core/mem_map.h b/src/core/mem_map.h
index 945815cd6..ba50914a8 100644
--- a/src/core/mem_map.h
+++ b/src/core/mem_map.h
@@ -8,14 +8,6 @@
namespace Memory {
-extern u8* g_exefs_code; ///< ExeFS:/.code is loaded here
-extern u8* g_heap; ///< Application heap (main memory)
-extern u8* g_shared_mem; ///< Shared memory
-extern u8* g_heap_linear; ///< Linear heap (main memory)
-extern u8* g_vram; ///< Video memory (VRAM)
-extern u8* g_dsp_mem; ///< DSP memory
-extern u8* g_tls_mem; ///< TLS memory
-
void Init();
void Shutdown();