From e2c7954be5ccabc7c5f87000db01cef040ca4b47 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 29 Jul 2015 11:54:44 -0300 Subject: Memory: Move address type conversion routines to memory.cpp/h These helpers aren't really part of the kernel, and mem_map.cpp/h is going to be moved there next. --- src/core/memory.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 2a06cc6c3..e6da3e2a5 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -123,6 +123,17 @@ void WriteBlock(VAddr addr, const u8* data, size_t size); u8* GetPointer(VAddr virtual_address); +/** +* Converts a virtual address inside a region with 1:1 mapping to physical memory to a physical +* address. This should be used by services to translate addresses for use by the hardware. +*/ +PAddr VirtualToPhysicalAddress(VAddr addr); + +/** +* Undoes a mapping performed by VirtualToPhysicalAddress(). +*/ +VAddr PhysicalToVirtualAddress(PAddr addr); + /** * Gets a pointer to the memory region beginning at the specified physical address. * -- cgit v1.2.3