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
70 #define ADDR2PORT(addr) ((unsigned long __force)(addr) & 0xffffff) argument
72 static unsigned int ioport_read8(const void __iomem *addr) in ioport_read8() argument
74 return inb(ADDR2PORT(addr)); in ioport_read8()
77 static unsigned int ioport_read16(const void __iomem *addr) in ioport_read16() argument
79 return inw(ADDR2PORT(addr)); in ioport_read16()
82 static unsigned int ioport_read32(const void __iomem *addr) in ioport_read32() argument
84 return inl(ADDR2PORT(addr)); in ioport_read32()
87 static void ioport_write8(u8 datum, void __iomem *addr) in ioport_write8() argument
89 outb(datum, ADDR2PORT(addr)); in ioport_write8()
92 static void ioport_write16(u16 datum, void __iomem *addr) in ioport_write16() argument
94 outw(datum, ADDR2PORT(addr)); in ioport_write16()
97 static void ioport_write32(u32 datum, void __iomem *addr) in ioport_write32() argument
99 outl(datum, ADDR2PORT(addr)); in ioport_write32()
102 static void ioport_read8r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read8r() argument
104 insb(ADDR2PORT(addr), dst, count); in ioport_read8r()
107 static void ioport_read16r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read16r() argument
109 insw(ADDR2PORT(addr), dst, count); in ioport_read16r()
112 static void ioport_read32r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read32r() argument
114 insl(ADDR2PORT(addr), dst, count); in ioport_read32r()
117 static void ioport_write8r(void __iomem *addr, const void *s, unsigned long n) in ioport_write8r() argument
119 outsb(ADDR2PORT(addr), s, n); in ioport_write8r()
122 static void ioport_write16r(void __iomem *addr, const void *s, unsigned long n) in ioport_write16r() argument
124 outsw(ADDR2PORT(addr), s, n); in ioport_write16r()
127 static void ioport_write32r(void __iomem *addr, const void *s, unsigned long n) in ioport_write32r() argument
129 outsl(ADDR2PORT(addr), s, n); in ioport_write32r()
153 static unsigned int iomem_read8(const void __iomem *addr) in iomem_read8() argument
155 return readb(addr); in iomem_read8()
158 static unsigned int iomem_read16(const void __iomem *addr) in iomem_read16() argument
160 return readw(addr); in iomem_read16()
163 static unsigned int iomem_read16be(const void __iomem *addr) in iomem_read16be() argument
165 return __raw_readw(addr); in iomem_read16be()
168 static unsigned int iomem_read32(const void __iomem *addr) in iomem_read32() argument
170 return readl(addr); in iomem_read32()
173 static unsigned int iomem_read32be(const void __iomem *addr) in iomem_read32be() argument
175 return __raw_readl(addr); in iomem_read32be()
178 static u64 iomem_read64(const void __iomem *addr) in iomem_read64() argument
180 return readq(addr); in iomem_read64()
183 static u64 iomem_read64be(const void __iomem *addr) in iomem_read64be() argument
185 return __raw_readq(addr); in iomem_read64be()
188 static void iomem_write8(u8 datum, void __iomem *addr) in iomem_write8() argument
190 writeb(datum, addr); in iomem_write8()
193 static void iomem_write16(u16 datum, void __iomem *addr) in iomem_write16() argument
195 writew(datum, addr); in iomem_write16()
198 static void iomem_write16be(u16 datum, void __iomem *addr) in iomem_write16be() argument
200 __raw_writew(datum, addr); in iomem_write16be()
203 static void iomem_write32(u32 datum, void __iomem *addr) in iomem_write32() argument
205 writel(datum, addr); in iomem_write32()
208 static void iomem_write32be(u32 datum, void __iomem *addr) in iomem_write32be() argument
210 __raw_writel(datum, addr); in iomem_write32be()
213 static void iomem_write64(u64 datum, void __iomem *addr) in iomem_write64() argument
215 writel(datum, addr); in iomem_write64()
218 static void iomem_write64be(u64 datum, void __iomem *addr) in iomem_write64be() argument
220 __raw_writel(datum, addr); in iomem_write64be()
223 static void iomem_read8r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read8r() argument
226 *(u8 *)dst = __raw_readb(addr); in iomem_read8r()
231 static void iomem_read16r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read16r() argument
234 *(u16 *)dst = __raw_readw(addr); in iomem_read16r()
239 static void iomem_read32r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read32r() argument
242 *(u32 *)dst = __raw_readl(addr); in iomem_read32r()
247 static void iomem_write8r(void __iomem *addr, const void *s, unsigned long n) in iomem_write8r() argument
250 __raw_writeb(*(u8 *)s, addr); in iomem_write8r()
255 static void iomem_write16r(void __iomem *addr, const void *s, unsigned long n) in iomem_write16r() argument
258 __raw_writew(*(u16 *)s, addr); in iomem_write16r()
263 static void iomem_write32r(void __iomem *addr, const void *s, unsigned long n) in iomem_write32r() argument
266 __raw_writel(*(u32 *)s, addr); in iomem_write32r()
300 unsigned int ioread8(const void __iomem *addr) in ioread8() argument
302 if (unlikely(INDIRECT_ADDR(addr))) in ioread8()
303 return iomap_ops[ADDR_TO_REGION(addr)]->read8(addr); in ioread8()
304 return *((u8 *)addr); in ioread8()
307 unsigned int ioread16(const void __iomem *addr) in ioread16() argument
309 if (unlikely(INDIRECT_ADDR(addr))) in ioread16()
310 return iomap_ops[ADDR_TO_REGION(addr)]->read16(addr); in ioread16()
311 return le16_to_cpup((u16 *)addr); in ioread16()
314 unsigned int ioread16be(const void __iomem *addr) in ioread16be() argument
316 if (unlikely(INDIRECT_ADDR(addr))) in ioread16be()
317 return iomap_ops[ADDR_TO_REGION(addr)]->read16be(addr); in ioread16be()
318 return *((u16 *)addr); in ioread16be()
321 unsigned int ioread32(const void __iomem *addr) in ioread32() argument
323 if (unlikely(INDIRECT_ADDR(addr))) in ioread32()
324 return iomap_ops[ADDR_TO_REGION(addr)]->read32(addr); in ioread32()
325 return le32_to_cpup((u32 *)addr); in ioread32()
328 unsigned int ioread32be(const void __iomem *addr) in ioread32be() argument
330 if (unlikely(INDIRECT_ADDR(addr))) in ioread32be()
331 return iomap_ops[ADDR_TO_REGION(addr)]->read32be(addr); in ioread32be()
332 return *((u32 *)addr); in ioread32be()
335 u64 ioread64(const void __iomem *addr) in ioread64() argument
337 if (unlikely(INDIRECT_ADDR(addr))) in ioread64()
338 return iomap_ops[ADDR_TO_REGION(addr)]->read64(addr); in ioread64()
339 return le64_to_cpup((u64 *)addr); in ioread64()
342 u64 ioread64be(const void __iomem *addr) in ioread64be() argument
344 if (unlikely(INDIRECT_ADDR(addr))) in ioread64be()
345 return iomap_ops[ADDR_TO_REGION(addr)]->read64be(addr); in ioread64be()
346 return *((u64 *)addr); in ioread64be()
349 u64 ioread64_hi_lo(const void __iomem *addr) in ioread64_hi_lo() argument
353 high = ioread32(addr + sizeof(u32)); in ioread64_hi_lo()
354 low = ioread32(addr); in ioread64_hi_lo()
359 void iowrite8(u8 datum, void __iomem *addr) in iowrite8() argument
361 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite8()
362 iomap_ops[ADDR_TO_REGION(addr)]->write8(datum, addr); in iowrite8()
364 *((u8 *)addr) = datum; in iowrite8()
368 void iowrite16(u16 datum, void __iomem *addr) in iowrite16() argument
370 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16()
371 iomap_ops[ADDR_TO_REGION(addr)]->write16(datum, addr); in iowrite16()
373 *((u16 *)addr) = cpu_to_le16(datum); in iowrite16()
377 void iowrite16be(u16 datum, void __iomem *addr) in iowrite16be() argument
379 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16be()
380 iomap_ops[ADDR_TO_REGION(addr)]->write16be(datum, addr); in iowrite16be()
382 *((u16 *)addr) = datum; in iowrite16be()
386 void iowrite32(u32 datum, void __iomem *addr) in iowrite32() argument
388 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32()
389 iomap_ops[ADDR_TO_REGION(addr)]->write32(datum, addr); in iowrite32()
391 *((u32 *)addr) = cpu_to_le32(datum); in iowrite32()
395 void iowrite32be(u32 datum, void __iomem *addr) in iowrite32be() argument
397 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32be()
398 iomap_ops[ADDR_TO_REGION(addr)]->write32be(datum, addr); in iowrite32be()
400 *((u32 *)addr) = datum; in iowrite32be()
404 void iowrite64(u64 datum, void __iomem *addr) in iowrite64() argument
406 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite64()
407 iomap_ops[ADDR_TO_REGION(addr)]->write64(datum, addr); in iowrite64()
409 *((u64 *)addr) = cpu_to_le64(datum); in iowrite64()
413 void iowrite64be(u64 datum, void __iomem *addr) in iowrite64be() argument
415 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite64be()
416 iomap_ops[ADDR_TO_REGION(addr)]->write64be(datum, addr); in iowrite64be()
418 *((u64 *)addr) = datum; in iowrite64be()
422 void iowrite64_hi_lo(u64 val, void __iomem *addr) in iowrite64_hi_lo() argument
424 iowrite32(val >> 32, addr + sizeof(u32)); in iowrite64_hi_lo()
425 iowrite32(val, addr); in iowrite64_hi_lo()
430 void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count) in ioread8_rep() argument
432 if (unlikely(INDIRECT_ADDR(addr))) { in ioread8_rep()
433 iomap_ops[ADDR_TO_REGION(addr)]->read8r(addr, dst, count); in ioread8_rep()
436 *(u8 *)dst = *(u8 *)addr; in ioread8_rep()
442 void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count) in ioread16_rep() argument
444 if (unlikely(INDIRECT_ADDR(addr))) { in ioread16_rep()
445 iomap_ops[ADDR_TO_REGION(addr)]->read16r(addr, dst, count); in ioread16_rep()
448 *(u16 *)dst = *(u16 *)addr; in ioread16_rep()
454 void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count) in ioread32_rep() argument
456 if (unlikely(INDIRECT_ADDR(addr))) { in ioread32_rep()
457 iomap_ops[ADDR_TO_REGION(addr)]->read32r(addr, dst, count); in ioread32_rep()
460 *(u32 *)dst = *(u32 *)addr; in ioread32_rep()
466 void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite8_rep() argument
468 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite8_rep()
469 iomap_ops[ADDR_TO_REGION(addr)]->write8r(addr, src, count); in iowrite8_rep()
472 *(u8 *)addr = *(u8 *)src; in iowrite8_rep()
478 void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite16_rep() argument
480 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16_rep()
481 iomap_ops[ADDR_TO_REGION(addr)]->write16r(addr, src, count); in iowrite16_rep()
484 *(u16 *)addr = *(u16 *)src; in iowrite16_rep()
490 void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) in iowrite32_rep() argument
492 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32_rep()
493 iomap_ops[ADDR_TO_REGION(addr)]->write32r(addr, src, count); in iowrite32_rep()
496 *(u32 *)addr = *(u32 *)src; in iowrite32_rep()
509 void ioport_unmap(void __iomem *addr) in ioport_unmap() argument
511 if (!INDIRECT_ADDR(addr)) { in ioport_unmap()
512 iounmap(addr); in ioport_unmap()
517 void pci_iounmap(struct pci_dev *dev, void __iomem * addr) in pci_iounmap() argument
519 if (!INDIRECT_ADDR(addr)) { in pci_iounmap()
520 iounmap(addr); in pci_iounmap()