2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
12 #include <linux/types.h>
13 #include <asm/byteorder.h>
16 #define PCI_IOBASE ((void __iomem *)0)
18 extern void __iomem *ioremap(unsigned long physaddr, unsigned long size);
19 extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
21 extern void iounmap(const void __iomem *addr);
23 #define ioremap_nocache(phy, sz) ioremap(phy, sz)
24 #define ioremap_wc(phy, sz) ioremap(phy, sz)
26 /* Change struct page to physical address */
27 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
29 #define __raw_readb __raw_readb
30 static inline u8 __raw_readb(const volatile void __iomem *addr)
37 : "m" (*(volatile u8 __force *)addr)
43 #define __raw_readw __raw_readw
44 static inline u16 __raw_readw(const volatile void __iomem *addr)
51 : "m" (*(volatile u16 __force *)addr)
57 #define __raw_readl __raw_readl
58 static inline u32 __raw_readl(const volatile void __iomem *addr)
65 : "m" (*(volatile u32 __force *)addr)
71 #define __raw_writeb __raw_writeb
72 static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
77 : "r" (b), "m" (*(volatile u8 __force *)addr)
81 #define __raw_writew __raw_writew
82 static inline void __raw_writew(u16 s, volatile void __iomem *addr)
87 : "r" (s), "m" (*(volatile u16 __force *)addr)
92 #define __raw_writel __raw_writel
93 static inline void __raw_writel(u32 w, volatile void __iomem *addr)
98 : "r" (w), "m" (*(volatile u32 __force *)addr)
103 #define readb_relaxed readb
104 #define readw_relaxed readw
105 #define readl_relaxed readl
107 #include <asm-generic/io.h>
109 #endif /* _ASM_ARC_IO_H */