[PATCH 4/5] x86: define phys_to_virt and virt_to_phys

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Aug 12 05:19:43 PDT 2021


Some PCI drivers use those, so provide 1:1 implementations.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/x86/include/asm/io.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 5d19679b5064..0971727bc63d 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -82,6 +82,16 @@ static inline void io_delay(void)
 	inb(0x80);
 }
 
+static inline void *phys_to_virt(unsigned long phys)
+{
+	return (void *)phys;
+}
+
+static inline unsigned long virt_to_phys(volatile void *mem)
+{
+	return (unsigned long)mem;
+}
+
 #include <asm-generic/io.h>
 
 #endif	/* __ASM_X86_IO_H */
-- 
2.30.2




More information about the barebox mailing list