summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-08-06 01:51:46 -0300
committerGravatar Yuri Kunde Schlesner2015-08-16 01:03:49 -0300
commit840b85690b5de1e7ca89763ff6ca58cbe9b6d68f (patch)
treea19e41f7c9a273ce89cbd072d93a64f2df087987 /src
parentAPT: Adjust shared font hack so it works with the new linear heap code (diff)
downloadyuzu-840b85690b5de1e7ca89763ff6ca58cbe9b6d68f.tar.gz
yuzu-840b85690b5de1e7ca89763ff6ca58cbe9b6d68f.tar.xz
yuzu-840b85690b5de1e7ca89763ff6ca58cbe9b6d68f.zip
Kernel: Remove unused legacy heap MapBlock_* functions
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/memory.cpp60
-rw-r--r--src/core/hle/kernel/memory.h17
-rw-r--r--src/core/system.cpp1
3 files changed, 0 insertions, 78 deletions
diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp
index e69b121eb..e4fc5f3c4 100644
--- a/src/core/hle/kernel/memory.cpp
+++ b/src/core/hle/kernel/memory.cpp
@@ -109,59 +109,6 @@ static MemoryArea memory_areas[] = {
109 {TLS_AREA_VADDR, TLS_AREA_SIZE, "TLS Area"}, // TLS memory 109 {TLS_AREA_VADDR, TLS_AREA_SIZE, "TLS Area"}, // TLS memory
110}; 110};
111 111
112/// Represents a block of memory mapped by ControlMemory/MapMemoryBlock
113struct MemoryBlock {
114 MemoryBlock() : handle(0), base_address(0), address(0), size(0), operation(0), permissions(0) {
115 }
116 u32 handle;
117 u32 base_address;
118 u32 address;
119 u32 size;
120 u32 operation;
121 u32 permissions;
122
123 const u32 GetVirtualAddress() const{
124 return base_address + address;
125 }
126};
127
128static std::map<u32, MemoryBlock> heap_map;
129static std::map<u32, MemoryBlock> heap_linear_map;
130
131}
132
133u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions) {
134 MemoryBlock block;
135
136 block.base_address = HEAP_VADDR;
137 block.size = size;
138 block.operation = operation;
139 block.permissions = permissions;
140
141 if (heap_map.size() > 0) {
142 const MemoryBlock last_block = heap_map.rbegin()->second;
143 block.address = last_block.address + last_block.size;
144 }
145 heap_map[block.GetVirtualAddress()] = block;
146
147 return block.GetVirtualAddress();
148}
149
150u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions) {
151 MemoryBlock block;
152
153 block.base_address = LINEAR_HEAP_VADDR;
154 block.size = size;
155 block.operation = operation;
156 block.permissions = permissions;
157
158 if (heap_linear_map.size() > 0) {
159 const MemoryBlock last_block = heap_linear_map.rbegin()->second;
160 block.address = last_block.address + last_block.size;
161 }
162 heap_linear_map[block.GetVirtualAddress()] = block;
163
164 return block.GetVirtualAddress();
165} 112}
166 113
167void Init() { 114void Init() {
@@ -186,11 +133,4 @@ void InitLegacyAddressSpace(Kernel::VMManager& address_space) {
186 address_space.Reprotect(shared_page_vma, VMAPermission::Read); 133 address_space.Reprotect(shared_page_vma, VMAPermission::Read);
187} 134}
188 135
189void Shutdown() {
190 heap_map.clear();
191 heap_linear_map.clear();
192
193 LOG_DEBUG(HW_Memory, "shutdown OK");
194}
195
196} // namespace 136} // namespace
diff --git a/src/core/hle/kernel/memory.h b/src/core/hle/kernel/memory.h
index 2e2cae17d..36690b091 100644
--- a/src/core/hle/kernel/memory.h
+++ b/src/core/hle/kernel/memory.h
@@ -31,22 +31,5 @@ namespace Memory {
31 31
32void Init(); 32void Init();
33void InitLegacyAddressSpace(Kernel::VMManager& address_space); 33void InitLegacyAddressSpace(Kernel::VMManager& address_space);
34void Shutdown();
35
36/**
37 * Maps a block of memory on the heap
38 * @param size Size of block in bytes
39 * @param operation Memory map operation type
40 * @param permissions Memory allocation permissions
41 */
42u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions);
43
44/**
45 * Maps a block of memory on the GSP heap
46 * @param size Size of block in bytes
47 * @param operation Memory map operation type
48 * @param permissions Control memory permissions
49 */
50u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions);
51 34
52} // namespace 35} // namespace
diff --git a/src/core/system.cpp b/src/core/system.cpp
index 8d80ef372..3cd84bf5e 100644
--- a/src/core/system.cpp
+++ b/src/core/system.cpp
@@ -29,7 +29,6 @@ void Shutdown() {
29 HLE::Shutdown(); 29 HLE::Shutdown();
30 Kernel::Shutdown(); 30 Kernel::Shutdown();
31 HW::Shutdown(); 31 HW::Shutdown();
32 Memory::Shutdown();
33 CoreTiming::Shutdown(); 32 CoreTiming::Shutdown();
34 Core::Shutdown(); 33 Core::Shutdown();
35} 34}