Merge pull request #4158 from FearlessTobi/port-933

Port #933 from yuzu: Multiple cleanups in memory
This commit is contained in:
Pengfei Zhu 2018-08-31 14:38:43 +08:00 committed by GitHub
commit 0fe57d075a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,10 +181,10 @@ void SetCurrentPageTable(PageTable* page_table);
PageTable* GetCurrentPageTable();
/// Determines if the given VAddr is valid for the specified process.
bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr);
bool IsValidVirtualAddress(const VAddr addr);
bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr);
bool IsValidVirtualAddress(VAddr vaddr);
bool IsValidPhysicalAddress(const PAddr addr);
bool IsValidPhysicalAddress(PAddr paddr);
u8 Read8(VAddr addr);
u16 Read16(VAddr addr);
@ -196,20 +196,19 @@ void Write16(VAddr addr, u16 data);
void Write32(VAddr addr, u32 data);
void Write64(VAddr addr, u64 data);
void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_buffer,
size_t size);
void ReadBlock(const VAddr src_addr, void* dest_buffer, size_t size);
void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const void* src_buffer,
void ReadBlock(const Kernel::Process& process, VAddr src_addr, void* dest_buffer, size_t size);
void ReadBlock(VAddr src_addr, void* dest_buffer, size_t size);
void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer,
size_t size);
void WriteBlock(const VAddr dest_addr, const void* src_buffer, size_t size);
void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size_t size);
void ZeroBlock(const VAddr dest_addr, const size_t size);
void WriteBlock(VAddr dest_addr, const void* src_buffer, size_t size);
void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, const size_t size);
void ZeroBlock(VAddr dest_addr, const size_t size);
void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, size_t size);
void CopyBlock(VAddr dest_addr, VAddr src_addr, size_t size);
u8* GetPointer(VAddr virtual_address);
u8* GetPointer(VAddr vaddr);
std::string ReadCString(VAddr virtual_address, std::size_t max_length);
std::string ReadCString(VAddr vaddr, std::size_t max_length);
/**
* Converts a virtual address inside a region with 1:1 mapping to physical memory to a physical
@ -228,7 +227,7 @@ PAddr VirtualToPhysicalAddress(VAddr addr);
/**
* Undoes a mapping performed by VirtualToPhysicalAddress().
*/
boost::optional<VAddr> PhysicalToVirtualAddress(PAddr addr);
boost::optional<VAddr> PhysicalToVirtualAddress(PAddr paddr);
/**
* Gets a pointer to the memory region beginning at the specified physical address.