hle: kernel: Use host memory allocations for KSlabMemory.
- There are some issues with the current workaround, we will just use host memory until we have a complete kernel memory implementation.
This commit is contained in:
parent
78853f888a
commit
227f9e5ab2
4 changed files with 20 additions and 174 deletions
|
@ -82,22 +82,6 @@ struct Memory::Impl {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
u8* GetKernelBuffer(VAddr start_vaddr, size_t size) {
|
||||
// TODO(bunnei): This is just a workaround until we have kernel memory layout mapped &
|
||||
// managed. Until then, we use this to allocate and access kernel memory regions.
|
||||
|
||||
auto search = kernel_memory_regions.find(start_vaddr);
|
||||
if (search != kernel_memory_regions.end()) {
|
||||
return search->second.get();
|
||||
}
|
||||
|
||||
std::unique_ptr<u8[]> new_memory_region{new u8[size]};
|
||||
u8* raw_ptr = new_memory_region.get();
|
||||
kernel_memory_regions[start_vaddr] = std::move(new_memory_region);
|
||||
|
||||
return raw_ptr;
|
||||
}
|
||||
|
||||
u8 Read8(const VAddr addr) {
|
||||
return Read<u8>(addr);
|
||||
}
|
||||
|
@ -727,7 +711,6 @@ struct Memory::Impl {
|
|||
}
|
||||
|
||||
Common::PageTable* current_page_table = nullptr;
|
||||
std::unordered_map<VAddr, std::unique_ptr<u8[]>> kernel_memory_regions;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
|
@ -765,10 +748,6 @@ u8* Memory::GetPointer(VAddr vaddr) {
|
|||
return impl->GetPointer(vaddr);
|
||||
}
|
||||
|
||||
u8* Memory::GetKernelBuffer(VAddr start_vaddr, size_t size) {
|
||||
return impl->GetKernelBuffer(start_vaddr, size);
|
||||
}
|
||||
|
||||
const u8* Memory::GetPointer(VAddr vaddr) const {
|
||||
return impl->GetPointer(vaddr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue