]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
arm/acpi: emulate io ports for arm
authorShannon Zhao <shannon.zhao@linaro.org>
Mon, 29 Feb 2016 15:01:21 +0000 (16:01 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:31 +0000 (16:32 +0000)
Add macros to emulate x86 style ports for arm. This avoids modification in
common code for acpi. Here just print a warning on ARM.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen/include/asm-arm/arm64/io.h

index 37abc4788f018ccdafb85442a799e0a92bd72b7f..f80156f56e2694354b56849e0fa2e16e296d5701 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef _ARM_ARM64_IO_H
 #define _ARM_ARM64_IO_H
 
+#include <asm/system.h>
 #include <asm/byteorder.h>
 
 /*
@@ -109,4 +110,26 @@ static inline u64 __raw_readq(const volatile void __iomem *addr)
 #define writel(v,c)             ({ __iowmb(); writel_relaxed((v),(c)); })
 #define writeq(v,c)             ({ __iowmb(); writeq_relaxed((v),(c)); })
 
+/*
+ * Emulate x86 io ports for ARM.
+ */
+static inline int emulate_read(u64 addr)
+{
+    printk(XENLOG_G_WARNING "Can't access IO %lx\n", addr);
+    return 0;
+}
+
+static inline void emulate_write(u64 addr)
+{
+    printk(XENLOG_G_WARNING "Can't access IO %lx\n", addr);
+}
+
+#define inb(c) ( emulate_read(c) )
+#define inw(c) ( emulate_read(c) )
+#define inl(c) ( emulate_read(c) )
+
+#define outb(v, c) ( emulate_write(c) )
+#define outw(v, c) ( emulate_write(c) )
+#define outl(v, c) ( emulate_write(c) )
+
 #endif /* _ARM_ARM64_IO_H */