Better use of address types in mm.h.
These functions are called to map physical pages in and out of the
address space. It makes more sense for the APIs to use those physical
addresses and avoid mistakes or confusion in the conversions.
Once the physical address has been mapped it will be available as a
virtual address or pointer in the hypervisor and an intermediate
physical address in the VMs. The corresponding type is now returned from
the mapping functions to avoid complication or mistakes in conversion by
the caller and the vast majority of the address type conversions now
happen within mm.
Internally to mm, the stage 1 and stage 2 tables still share the same
management code so that is made generic for the type of input address
being used.
Change-Id: I9201b98b7329ead304903b8b8968c4378eb5a4db
diff --git a/inc/addr.h b/inc/addr.h
index 964660b..15d32b5 100644
--- a/inc/addr.h
+++ b/inc/addr.h
@@ -70,11 +70,11 @@
}
/**
- * Advances a virtual address.
+ * Advances a physical address.
*/
-static inline vaddr_t va_add(vaddr_t va, size_t n)
+static inline paddr_t pa_add(paddr_t pa, size_t n)
{
- return va_init(va_addr(va) + n);
+ return pa_init(pa_addr(pa) + n);
}
/**