Lines Matching full:addr
32 * Technically, this should be 'if (VMALLOC_START < addr < VMALLOC_END),
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
74 #define ADDR2PORT(addr) ((unsigned long __force)(addr) & 0xffffff) argument
76 static unsigned int ioport_read8(const void __iomem *addr) in ioport_read8() argument
78 return inb(ADDR2PORT(addr)); in ioport_read8()
81 static unsigned int ioport_read16(const void __iomem *addr) in ioport_read16() argument
83 return inw(ADDR2PORT(addr)); in ioport_read16()
86 static unsigned int ioport_read32(const void __iomem *addr) in ioport_read32() argument
88 return inl(ADDR2PORT(addr)); in ioport_read32()
91 static void ioport_write8(u8 datum, void __iomem *addr) in ioport_write8() argument
93 outb(datum, ADDR2PORT(addr)); in ioport_write8()
96 static void ioport_write16(u16 datum, void __iomem *addr) in ioport_write16() argument
98 outw(datum, ADDR2PORT(addr)); in ioport_write16()
101 static void ioport_write32(u32 datum, void __iomem *addr) in ioport_write32() argument
103 outl(datum, ADDR2PORT(addr)); in ioport_write32()
106 static void ioport_read8r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read8r() argument
108 insb(ADDR2PORT(addr), dst, count); in ioport_read8r()
111 static void ioport_read16r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read16r() argument
113 insw(ADDR2PORT(addr), dst, count); in ioport_read16r()
116 static void ioport_read32r(const void __iomem *addr, void *dst, unsigned long count) in ioport_read32r() argument
118 insl(ADDR2PORT(addr), dst, count); in ioport_read32r()
121 static void ioport_write8r(void __iomem *addr, const void *s, unsigned long n) in ioport_write8r() argument
123 outsb(ADDR2PORT(addr), s, n); in ioport_write8r()
126 static void ioport_write16r(void __iomem *addr, const void *s, unsigned long n) in ioport_write16r() argument
128 outsw(ADDR2PORT(addr), s, n); in ioport_write16r()
131 static void ioport_write32r(void __iomem *addr, const void *s, unsigned long n) in ioport_write32r() argument
133 outsl(ADDR2PORT(addr), s, n); in ioport_write32r()
157 static unsigned int iomem_read8(const void __iomem *addr) in iomem_read8() argument
159 return readb(addr); in iomem_read8()
162 static unsigned int iomem_read16(const void __iomem *addr) in iomem_read16() argument
164 return readw(addr); in iomem_read16()
167 static unsigned int iomem_read16be(const void __iomem *addr) in iomem_read16be() argument
169 return __raw_readw(addr); in iomem_read16be()
172 static unsigned int iomem_read32(const void __iomem *addr) in iomem_read32() argument
174 return readl(addr); in iomem_read32()
177 static unsigned int iomem_read32be(const void __iomem *addr) in iomem_read32be() argument
179 return __raw_readl(addr); in iomem_read32be()
183 static u64 iomem_read64(const void __iomem *addr) in iomem_read64() argument
185 return readq(addr); in iomem_read64()
188 static u64 iomem_read64be(const void __iomem *addr) in iomem_read64be() argument
190 return __raw_readq(addr); in iomem_read64be()
194 static void iomem_write8(u8 datum, void __iomem *addr) in iomem_write8() argument
196 writeb(datum, addr); in iomem_write8()
199 static void iomem_write16(u16 datum, void __iomem *addr) in iomem_write16() argument
201 writew(datum, addr); in iomem_write16()
204 static void iomem_write16be(u16 datum, void __iomem *addr) in iomem_write16be() argument
206 __raw_writew(datum, addr); in iomem_write16be()
209 static void iomem_write32(u32 datum, void __iomem *addr) in iomem_write32() argument
211 writel(datum, addr); in iomem_write32()
214 static void iomem_write32be(u32 datum, void __iomem *addr) in iomem_write32be() argument
216 __raw_writel(datum, addr); in iomem_write32be()
220 static void iomem_write64(u64 datum, void __iomem *addr) in iomem_write64() argument
222 writeq(datum, addr); in iomem_write64()
225 static void iomem_write64be(u64 datum, void __iomem *addr) in iomem_write64be() argument
227 __raw_writeq(datum, addr); in iomem_write64be()
231 static void iomem_read8r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read8r() argument
234 *(u8 *)dst = __raw_readb(addr); in iomem_read8r()
239 static void iomem_read16r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read16r() argument
242 *(u16 *)dst = __raw_readw(addr); in iomem_read16r()
247 static void iomem_read32r(const void __iomem *addr, void *dst, unsigned long count) in iomem_read32r() argument
250 *(u32 *)dst = __raw_readl(addr); in iomem_read32r()
255 static void iomem_write8r(void __iomem *addr, const void *s, unsigned long n) in iomem_write8r() argument
258 __raw_writeb(*(u8 *)s, addr); in iomem_write8r()
263 static void iomem_write16r(void __iomem *addr, const void *s, unsigned long n) in iomem_write16r() argument
266 __raw_writew(*(u16 *)s, addr); in iomem_write16r()
271 static void iomem_write32r(void __iomem *addr, const void *s, unsigned long n) in iomem_write32r() argument
274 __raw_writel(*(u32 *)s, addr); in iomem_write32r()
312 unsigned int ioread8(const void __iomem *addr) in ioread8() argument
314 if (unlikely(INDIRECT_ADDR(addr))) in ioread8()
315 return iomap_ops[ADDR_TO_REGION(addr)]->read8(addr); in ioread8()
316 return *((u8 *)addr); in ioread8()
319 unsigned int ioread16(const void __iomem *addr) in ioread16() argument
321 if (unlikely(INDIRECT_ADDR(addr))) in ioread16()
322 return iomap_ops[ADDR_TO_REGION(addr)]->read16(addr); in ioread16()
323 return le16_to_cpup((u16 *)addr); in ioread16()
326 unsigned int ioread16be(const void __iomem *addr) in ioread16be() argument
328 if (unlikely(INDIRECT_ADDR(addr))) in ioread16be()
329 return iomap_ops[ADDR_TO_REGION(addr)]->read16be(addr); in ioread16be()
330 return *((u16 *)addr); in ioread16be()
333 unsigned int ioread32(const void __iomem *addr) in ioread32() argument
335 if (unlikely(INDIRECT_ADDR(addr))) in ioread32()
336 return iomap_ops[ADDR_TO_REGION(addr)]->read32(addr); in ioread32()
337 return le32_to_cpup((u32 *)addr); in ioread32()
340 unsigned int ioread32be(const void __iomem *addr) in ioread32be() argument
342 if (unlikely(INDIRECT_ADDR(addr))) in ioread32be()
343 return iomap_ops[ADDR_TO_REGION(addr)]->read32be(addr); in ioread32be()
344 return *((u32 *)addr); in ioread32be()
348 u64 ioread64(const void __iomem *addr) in ioread64() argument
350 if (unlikely(INDIRECT_ADDR(addr))) in ioread64()
351 return iomap_ops[ADDR_TO_REGION(addr)]->read64(addr); in ioread64()
352 return le64_to_cpup((u64 *)addr); in ioread64()
355 u64 ioread64be(const void __iomem *addr) in ioread64be() argument
357 if (unlikely(INDIRECT_ADDR(addr))) in ioread64be()
358 return iomap_ops[ADDR_TO_REGION(addr)]->read64be(addr); in ioread64be()
359 return *((u64 *)addr); in ioread64be()
363 void iowrite8(u8 datum, void __iomem *addr) in iowrite8() argument
365 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite8()
366 iomap_ops[ADDR_TO_REGION(addr)]->write8(datum, addr); in iowrite8()
368 *((u8 *)addr) = datum; in iowrite8()
372 void iowrite16(u16 datum, void __iomem *addr) in iowrite16() argument
374 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16()
375 iomap_ops[ADDR_TO_REGION(addr)]->write16(datum, addr); in iowrite16()
377 *((u16 *)addr) = cpu_to_le16(datum); in iowrite16()
381 void iowrite16be(u16 datum, void __iomem *addr) in iowrite16be() argument
383 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite16be()
384 iomap_ops[ADDR_TO_REGION(addr)]->write16be(datum, addr); in iowrite16be()
386 *((u16 *)addr) = datum; in iowrite16be()
390 void iowrite32(u32 datum, void __iomem *addr) in iowrite32() argument
392 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32()
393 iomap_ops[ADDR_TO_REGION(addr)]->write32(datum, addr); in iowrite32()
395 *((u32 *)addr) = cpu_to_le32(datum); in iowrite32()
399 void iowrite32be(u32 datum, void __iomem *addr) in iowrite32be() argument
401 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite32be()
402 iomap_ops[ADDR_TO_REGION(addr)]->write32be(datum, addr); in iowrite32be()
404 *((u32 *)addr) = datum; in iowrite32be()
409 void iowrite64(u64 datum, void __iomem *addr) in iowrite64() argument
411 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite64()
412 iomap_ops[ADDR_TO_REGION(addr)]->write64(datum, addr); in iowrite64()
414 *((u64 *)addr) = cpu_to_le64(datum); in iowrite64()
418 void iowrite64be(u64 datum, void __iomem *addr) in iowrite64be() argument
420 if (unlikely(INDIRECT_ADDR(addr))) { in iowrite64be()
421 iomap_ops[ADDR_TO_REGION(addr)]->write64be(datum, addr); in iowrite64be()
423 *((u64 *)addr) = datum; in iowrite64be()
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()