-
-
Save yuriks/0541b18ed09abf9dbe0732301e34d5d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MapSharedPages(VMManager& address_space) { | |
auto cfg_mem_vma = address_space | |
.MapBackingMemory(Memory::CONFIG_MEMORY_VADDR, | |
reinterpret_cast<u8*>(&ConfigMem::config_mem), | |
Memory::CONFIG_MEMORY_SIZE, MemoryState::Shared) | |
.MoveFrom(); | |
address_space.Reprotect(cfg_mem_vma, VMAPermission::Read); | |
auto shared_page_vma = address_space | |
.MapBackingMemory(Memory::SHARED_PAGE_VADDR, | |
reinterpret_cast<u8*>(&SharedPage::shared_page), | |
Memory::SHARED_PAGE_SIZE, MemoryState::Shared) | |
.MoveFrom(); | |
address_space.Reprotect(shared_page_vma, VMAPermission::Read); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment