Memory: Properly cleanup & shutdown.
This commit is contained in:
parent
28df8dbfeb
commit
bbabed8e98
3 changed files with 56 additions and 34 deletions
|
@ -15,7 +15,6 @@ namespace Memory {
|
|||
|
||||
static std::map<u32, MemoryBlock> heap_map;
|
||||
static std::map<u32, MemoryBlock> heap_linear_map;
|
||||
static std::map<u32, MemoryBlock> shared_map;
|
||||
|
||||
/// Convert a physical address to virtual address
|
||||
VAddr PhysicalToVirtualAddress(const PAddr addr) {
|
||||
|
@ -185,12 +184,6 @@ u8 *GetPointer(const VAddr vaddr) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps a block of memory on the heap
|
||||
* @param size Size of block in bytes
|
||||
* @param operation Memory map operation type
|
||||
* @param flags Memory allocation flags
|
||||
*/
|
||||
u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions) {
|
||||
MemoryBlock block;
|
||||
|
||||
|
@ -208,12 +201,6 @@ u32 MapBlock_Heap(u32 size, u32 operation, u32 permissions) {
|
|||
return block.GetVirtualAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_HeapLinear(u32 size, u32 operation, u32 permissions) {
|
||||
MemoryBlock block;
|
||||
|
||||
|
@ -231,6 +218,14 @@ u32 MapBlock_HeapLinear(u32 size, u32 operation, u32 permissions) {
|
|||
return block.GetVirtualAddress();
|
||||
}
|
||||
|
||||
void MemBlock_Init() {
|
||||
}
|
||||
|
||||
void MemBlock_Shutdown() {
|
||||
heap_map.clear();
|
||||
heap_linear_map.clear();
|
||||
}
|
||||
|
||||
u8 Read8(const VAddr addr) {
|
||||
u8 data = 0;
|
||||
Read<u8>(data, addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue