2006-01-15 05:41:58

by Jeff Dike

[permalink] [raw]
Subject: [PATCH 3/3] UML - Add __raw_writel definition

Add implementations of the write* and __raw_write* functions. __raw_writel
is needed by lib/iocopy.c, which shouldn't be used in UML, but which is
unconditionally linked in anyway.

Signed-off-by: Jeff Dike <[email protected]>

Index: linux-2.6.15-mm/include/asm-um/io.h
===================================================================
--- linux-2.6.15-mm.orig/include/asm-um/io.h 2005-08-28 19:41:01.000000000 -0400
+++ linux-2.6.15-mm/include/asm-um/io.h 2006-01-14 19:12:17.000000000 -0500
@@ -33,4 +33,20 @@ static inline void * phys_to_virt(unsign
*/
#define xlate_dev_kmem_ptr(p) p

+static inline void writeb(unsigned char b, volatile void __iomem *addr)
+{
+ *(volatile unsigned char __force *) addr = b;
+}
+static inline void writew(unsigned short b, volatile void __iomem *addr)
+{
+ *(volatile unsigned short __force *) addr = b;
+}
+static inline void writel(unsigned int b, volatile void __iomem *addr)
+{
+ *(volatile unsigned int __force *) addr = b;
+}
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
#endif