memory: Add GetCurrentPageTable/SetCurrentPageTable
Don't expose Memory::current_page_table as a global.
This commit is contained in:
parent
4c4807a251
commit
6b8ad273fc
7 changed files with 19 additions and 13 deletions
|
@ -22,12 +22,20 @@ namespace Memory {
|
|||
static std::array<u8, Memory::VRAM_SIZE> vram;
|
||||
static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram;
|
||||
|
||||
PageTable* current_page_table = nullptr;
|
||||
static PageTable* current_page_table = nullptr;
|
||||
|
||||
std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() {
|
||||
return ¤t_page_table->pointers;
|
||||
}
|
||||
|
||||
void SetCurrentPageTable(PageTable* page_table) {
|
||||
current_page_table = page_table;
|
||||
}
|
||||
|
||||
PageTable* GetCurrentPageTable() {
|
||||
return current_page_table;
|
||||
}
|
||||
|
||||
static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) {
|
||||
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
|
||||
(base + size) * PAGE_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue