Lines Matching refs:addr
36 #define INDIRECT_ADDR(addr) (((unsigned long)(addr) & 1UL<<63) != 0) argument
37 #define ADDR_TO_REGION(addr) (((unsigned long)addr >> 60) & 7) argument
40 #define INDIRECT_ADDR(addr) (((unsigned long)(addr) & 1UL<<31) != 0) argument
41 #define ADDR_TO_REGION(addr) (((unsigned long)addr >> 28) & 7) argument
66 #define ADDR2PORT(addr) ((unsigned long __force)(addr) & 0xffffff) argument
68 static unsigned int ioport_read8(void __iomem *addr) in ioport_read8() argument
70 return inb(ADDR2PORT(addr)); in ioport_read8()
73 static unsigned int ioport_read16(void __iomem *addr) in ioport_read16() argument
75 return inw(ADDR2PORT(addr)); in ioport_read16()
78 static unsigned int ioport_read32(void __iomem *addr) in ioport_read32() argument
80 return inl(ADDR2PORT(addr)); in ioport_read32()
83 static void ioport_write8(u8 datum, void __iomem *addr) in ioport_write8() argument
85 outb(datum, ADDR2PORT(addr)); in ioport_write8()
88 static void ioport_write16(u16 datum, void __iomem *addr) in ioport_write16() argument
90 outw(datum, ADDR2PORT(addr)); in ioport_write16()
93 static void ioport_write32(u32 datum, void __iomem *addr) in ioport_write32() argument
95 outl(datum, ADDR2PORT(addr)); in ioport_write32()
98 static void ioport_read8r(void __iomem *addr, void *dst, unsigned long count) in ioport_read8r() argument
100 insb(ADDR2PORT(addr), dst, count); in ioport_read8r()
103 static void ioport_read16r(void __iomem *addr, void *dst, unsigned long count) in ioport_read16r() argument
105 insw(ADDR2PORT(addr), dst, count); in ioport_read16r()
108 static void ioport_read32r(void __iomem *addr, void *dst, unsigned long count) in ioport_read32r() argument
110 insl(ADDR2PORT(addr), dst, count); in ioport_read32r()
113 static void ioport_write8r(void __iomem *addr, const void *s, unsigned long n) in ioport_write8r() argument
115 outsb(ADDR2PORT(addr), s, n); in ioport_write8r()
118 static void ioport_write16r(void __iomem *addr, const void *s, unsigned long n) in ioport_write16r() argument
120 outsw(ADDR2PORT(addr), s, n); in ioport_write16r()
123 static void ioport_write32r(void __iomem *addr, const void *s, unsigned long n) in ioport_write32r() argument
125 outsl(ADDR2PORT(addr), s, n); in ioport_write32r()
149 static unsigned int iomem_read8(void __iomem *addr) in iomem_read8() argument
151 return readb(addr); in iomem_read8()
154 static unsigned int iomem_read16(void __iomem *addr) in iomem_read16() argument
156 return readw(addr); in iomem_read16()
159 static unsigned int iomem_read16be(void __iomem *addr) in iomem_read16be() argument
161 return __raw_readw(addr); in iomem_read16be()
164 static unsigned int iomem_read32(void __iomem *addr) in iomem_read32() argument
166 return readl(addr); in iomem_read32()
169 static unsigned int iomem_read32be(void __iomem *addr) in iomem_read32be() argument
171 return __raw_readl(addr); in iomem_read32be()
174 static void iomem_write8(u8 datum, void __iomem *addr) in iomem_write8() argument
176 writeb(datum, addr); in iomem_write8()
179 static void iomem_write16(u16 datum, void __iomem *addr) in iomem_write16() argument
181 writew(datum, addr); in iomem_write16()
184 static void iomem_write16be(u16 datum, void __iomem *addr) in iomem_write16be() argument
186 __raw_writew(datum, addr); in iomem_write16be()
189 static void iomem_write32(u32 datum, void __iomem *addr) in iomem_write32() argument
191 writel(datum, addr); in iomem_write32()
194 static void iomem_write32be(u32 datum, void __iomem *addr) in iomem_write32be() argument
196 __raw_writel(datum, addr); in iomem_write32be()
199 static void iomem_read8r(void __iomem *addr, void *dst, unsigned long count) in iomem_read8r() argument
202 *(u8 *)dst = __raw_readb(addr); in iomem_read8r()
207 static void iomem_read16r(void __iomem *addr, void *dst, unsigned long count) in iomem_read16r() argument
210 *(u16 *)dst = __raw_readw(addr); in iomem_read16r()
215 static void iomem_read32r(void __iomem *addr, void *dst, unsigned long count) in iomem_read32r() argument
218 *(u32 *)dst = __raw_readl(addr); in iomem_read32r()
223 static void iomem_write8r(void __iomem *addr, const void *s, unsigned long n) in iomem_write8r() argument
226 __raw_writeb(*(u8 *)s, addr); in iomem_write8r()
231 static void iomem_write16r(void __iomem *addr, const void *s, unsigned long n) in iomem_write16r() argument
234 __raw_writew(*(u16 *)s, addr); in iomem_write16r()
239 static void iomem_write32r(void __iomem *addr, const void *s, unsigned long n) in iomem_write32r() argument
242 __raw_writel(*(u32 *)s, addr); in iomem_write32r()
272 unsigned int ioread8(void __iomem *addr) in ioread8() argument
274 if (unlikely(INDIRECT_ADDR(addr))) in ioread8()
275 return iomap_ops[ADDR_TO_REGION(addr)]->read8(addr); in ioread8()
276 return *((u8 *)addr); in ioread8()
279 unsigned int ioread16(void __iomem *addr) in ioread16() argument
281 if (unlikely(INDIRECT_ADDR(addr))) in ioread16()
282 return iomap_ops[ADDR_TO_REGION(addr)]->read16(addr); in ioread16()
283 return le16_to_cpup((u16 *)addr); in ioread16()
286 unsigned int ioread16be(void __iomem *addr) in ioread16be() argument
288 if (unlikely(INDIRECT_ADDR(addr))) in ioread16be()
289 return iomap_ops[ADDR_TO_REGION(addr)]->read16be(addr); in ioread16be()
290 return *((u16 *)addr); in ioread16be()
293 unsigned int ioread32(void __iomem *addr) in ioread32() argument
295 if (unlikely(INDIRECT_ADDR(addr))) in ioread32()
296 return iomap_ops[ADDR_TO_REGION(addr)]->read32(addr); in ioread32()
297 return le32_to_cpup((u32 *)addr); in ioread32()
300 unsigned int ioread32be(void __iomem *addr) in ioread32be() argument
302 if (unlikely(INDIRECT_ADDR(addr))) in ioread32be()
303 return iomap_ops[ADDR_TO_REGION(addr)]->read32be(addr); in ioread32be()
304 return *((u32 *)addr); in ioread32be()
307 void iowrite8(u8 datum, void __iomem *addr) in iowrite8() argument
309 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite8()
310 iomap_ops[ADDR_TO_REGION(addr)]->write8(datum, addr); in iowrite8()
312 *((u8 *)addr) = datum; in iowrite8()
316 void iowrite16(u16 datum, void __iomem *addr) in iowrite16() argument
318 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16()
319 iomap_ops[ADDR_TO_REGION(addr)]->write16(datum, addr); in iowrite16()
321 *((u16 *)addr) = cpu_to_le16(datum); in iowrite16()
325 void iowrite16be(u16 datum, void __iomem *addr) in iowrite16be() argument
327 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16be()
328 iomap_ops[ADDR_TO_REGION(addr)]->write16be(datum, addr); in iowrite16be()
330 *((u16 *)addr) = datum; in iowrite16be()
334 void iowrite32(u32 datum, void __iomem *addr) in iowrite32() argument
336 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32()
337 iomap_ops[ADDR_TO_REGION(addr)]->write32(datum, addr); in iowrite32()
339 *((u32 *)addr) = cpu_to_le32(datum); in iowrite32()
343 void iowrite32be(u32 datum, void __iomem *addr) in iowrite32be() argument
345 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32be()
346 iomap_ops[ADDR_TO_REGION(addr)]->write32be(datum, addr); in iowrite32be()
348 *((u32 *)addr) = datum; in iowrite32be()
354 void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) in ioread8_rep() argument
356 if (unlikely(INDIRECT_ADDR(addr))) { in ioread8_rep()
357 iomap_ops[ADDR_TO_REGION(addr)]->read8r(addr, dst, count); in ioread8_rep()
360 *(u8 *)dst = *(u8 *)addr; in ioread8_rep()
366 void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) in ioread16_rep() argument
368 if (unlikely(INDIRECT_ADDR(addr))) { in ioread16_rep()
369 iomap_ops[ADDR_TO_REGION(addr)]->read16r(addr, dst, count); in ioread16_rep()
372 *(u16 *)dst = *(u16 *)addr; in ioread16_rep()
378 void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) in ioread32_rep() argument
380 if (unlikely(INDIRECT_ADDR(addr))) { in ioread32_rep()
381 iomap_ops[ADDR_TO_REGION(addr)]->read32r(addr, dst, count); in ioread32_rep()
384 *(u32 *)dst = *(u32 *)addr; in ioread32_rep()
390 void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite8_rep() argument
392 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite8_rep()
393 iomap_ops[ADDR_TO_REGION(addr)]->write8r(addr, src, count); in iowrite8_rep()
396 *(u8 *)addr = *(u8 *)src; in iowrite8_rep()
402 void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite16_rep() argument
404 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16_rep()
405 iomap_ops[ADDR_TO_REGION(addr)]->write16r(addr, src, count); in iowrite16_rep()
408 *(u16 *)addr = *(u16 *)src; in iowrite16_rep()
414 void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite32_rep() argument
416 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32_rep()
417 iomap_ops[ADDR_TO_REGION(addr)]->write32r(addr, src, count); in iowrite32_rep()
420 *(u32 *)addr = *(u32 *)src; in iowrite32_rep()
433 void ioport_unmap(void __iomem *addr) in ioport_unmap() argument
435 if (!INDIRECT_ADDR(addr)) { in ioport_unmap()
436 iounmap(addr); in ioport_unmap()
440 void pci_iounmap(struct pci_dev *dev, void __iomem * addr) in pci_iounmap() argument
442 if (!INDIRECT_ADDR(addr)) { in pci_iounmap()
443 iounmap(addr); in pci_iounmap()