diff mbox

[V3,12/41] xen/arm: Add helpers ioreadl/iowritel

Message ID 1368152307-598-13-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall May 10, 2013, 2:17 a.m. UTC
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/mm.h |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 4ac8fab..b5ea2d1 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -156,7 +156,17 @@  extern void clear_fixmap(unsigned map);
 /* map a 2MB aligned physical range in virtual memory. */
 void* early_ioremap(paddr_t start, size_t len, unsigned attributes);
 /* map a physical range in virtual memory */
-void *ioremap_attr(paddr_t start, size_t len, unsigned attributes);
+void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned attributes);
+
+static inline uint32_t ioreadl(const volatile void __iomem *addr)
+{
+    return (*(volatile uint32_t *)addr);
+}
+
+static inline void iowritel(const volatile void __iomem *addr, uint32_t val)
+{
+    *(volatile uint32_t *)addr = val;
+}
 
 #define mfn_valid(mfn)        ({                                              \
     unsigned long __m_f_n = (mfn);                                            \