Skip to contentSkip to conversation

um: add dummy ioremap and iounmap functions

PATCH Superseded Logan Gunthorpe 2 participants 3 messages May 24, 2017 User-mode Linux (UML)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 um: add dummy ioremap and iounmap functions

The user mode architecture does not provide ioremap or iounmap, and because of this, the arch won't build when the functions are used in some core libraries.

I have designs to use these functions in scatterlist.c where they'd almost certainly never be called on the um architecture but it does need to compile.

---
 arch/um/include/asm/io.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 arch/um/include/asm/io.h
arch/um/include/asm/io.h new file +17 -0
new file mode 100644
index 0000000..8f35d57
@@ -0,0 +1,17 @@
+#ifndef _ASM_UM_IO_H
+#define _ASM_UM_IO_H
+
+#define ioremap ioremap
+static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
+{
+	return (void __iomem *)(unsigned long)offset;
+}
+
+#define iounmap iounmap
+static inline void iounmap(void __iomem *addr)
+{
+}
+
+#include <asm-generic/io.h>
+
+#endif
Signature · 1 line
2.1.4
#1 lore raw
Quoted 7 lines · Logan Gunthorpe

The user mode architecture does not provide ioremap or iounmap, and because of this, the arch won't build when the functions are used in some core libraries.

I have designs to use these functions in scatterlist.c where they'd almost certainly never be called on the um architecture but it does need to compile.

Then make it fail there.

Incidentally, s390 has ioremap() only when CONFIG_PCI is set.

#2 lore raw
Quoted 5 lines · Al Viro
Quoted 3 lines

I have designs to use these functions in scatterlist.c where they'd almost certainly never be called on the um architecture but it does need to compile.

Then make it fail there.

Ok, will do. I'll send a v2 patch shortly.

Quoted 1 line

Incidentally, s390 has ioremap() only when CONFIG_PCI is set.

Hmm, ok, I'll take a peek. The kbuild robot never reported any build issues with that architecture. I did see exactly this on the tile architecture which I sent another patch for (that your feedback also applies to).

Thanks for the quick review and feedback,

Logan