aboutsummaryrefslogtreecommitdiff
path: root/pk/mmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'pk/mmap.h')
-rw-r--r--pk/mmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pk/mmap.h b/pk/mmap.h
index e3c2035..3fc3186 100644
--- a/pk/mmap.h
+++ b/pk/mmap.h
@@ -5,6 +5,7 @@
#include "syscall.h"
#include "encoding.h"
#include "file.h"
+#include "mtrap.h"
#include <stddef.h>
#define PROT_NONE 0
@@ -31,4 +32,7 @@ uintptr_t do_mremap(uintptr_t addr, size_t old_size, size_t new_size, int flags)
uintptr_t do_mprotect(uintptr_t addr, size_t length, int prot);
uintptr_t do_brk(uintptr_t addr);
+#define va2pa(va) ({ uintptr_t __va = (uintptr_t)(va); \
+ __va >= DRAM_BASE ? __va : __va + first_free_paddr; })
+
#endif