@@ -62,6 +62,7 @@
#define MAIRVAL (MAIR1VAL << 32 | MAIR0VAL)
+#ifdef CONFIG_MMU
/*
* Layout of the flags used for updating the hypervisor page tables
*
@@ -90,6 +91,30 @@
#define _PAGE_CONTIG_BIT 8
#define _PAGE_CONTIG (1U << _PAGE_CONTIG_BIT)
+#else /* !CONFIG_MMU */
+
+/*
+ * Layout of the flags used for updating MPU memory region attributes
+ * [0:2] Memory attribute Index
+ * [3:4] Execute Never
+ * [5:6] Access Permission
+ * [7] Region Present
+ */
+#define _PAGE_AI_BIT 0
+#define _PAGE_XN_BIT 3
+#define _PAGE_AP_BIT 5
+#define _PAGE_PRESENT_BIT 7
+#define _PAGE_AI (7U << _PAGE_AI_BIT)
+#define _PAGE_XN (2U << _PAGE_XN_BIT)
+#define _PAGE_RO (2U << _PAGE_AP_BIT)
+#define _PAGE_PRESENT (1U << _PAGE_PRESENT_BIT)
+#define PAGE_AI_MASK(x) (((x) >> _PAGE_AI_BIT) & 0x7U)
+#define PAGE_XN_MASK(x) (((x) >> _PAGE_XN_BIT) & 0x3U)
+#define PAGE_AP_MASK(x) (((x) >> _PAGE_AP_BIT) & 0x3U)
+#define PAGE_RO_MASK(x) (((x) >> _PAGE_AP_BIT) & 0x2U)
+
+#endif /* CONFIG_MMU */
+
/*
* _PAGE_DEVICE and _PAGE_NORMAL are convenience defines. They are not
* meant to be used outside of this header.
Introduce the MPU memory mapping flags in asm/page.h. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> --- xen/arch/arm/include/asm/page.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)