io.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * S390 version
  3. * Copyright IBM Corp. 1999
  4. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
  5. *
  6. * Derived from "include/asm-i386/io.h"
  7. */
  8. #ifndef _S390_IO_H
  9. #define _S390_IO_H
  10. #include <linux/kernel.h>
  11. #include <asm/page.h>
  12. #include <asm/pci_io.h>
  13. void *xlate_dev_mem_ptr(unsigned long phys);
  14. #define xlate_dev_mem_ptr xlate_dev_mem_ptr
  15. void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
  16. /*
  17. * Convert a virtual cached pointer to an uncached pointer
  18. */
  19. #define xlate_dev_kmem_ptr(p) p
  20. #define IO_SPACE_LIMIT 0
  21. #ifdef CONFIG_PCI
  22. #define ioremap_nocache(addr, size) ioremap(addr, size)
  23. #define ioremap_wc ioremap_nocache
  24. static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
  25. {
  26. return (void __iomem *) offset;
  27. }
  28. static inline void iounmap(volatile void __iomem *addr)
  29. {
  30. }
  31. /*
  32. * s390 needs a private implementation of pci_iomap since ioremap with its
  33. * offset parameter isn't sufficient. That's because BAR spaces are not
  34. * disjunctive on s390 so we need the bar parameter of pci_iomap to find
  35. * the corresponding device and create the mapping cookie.
  36. */
  37. #define pci_iomap pci_iomap
  38. #define pci_iounmap pci_iounmap
  39. #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
  40. #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
  41. #define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
  42. #define __raw_readb zpci_read_u8
  43. #define __raw_readw zpci_read_u16
  44. #define __raw_readl zpci_read_u32
  45. #define __raw_readq zpci_read_u64
  46. #define __raw_writeb zpci_write_u8
  47. #define __raw_writew zpci_write_u16
  48. #define __raw_writel zpci_write_u32
  49. #define __raw_writeq zpci_write_u64
  50. #define readb_relaxed readb
  51. #define readw_relaxed readw
  52. #define readl_relaxed readl
  53. #define readq_relaxed readq
  54. #endif /* CONFIG_PCI */
  55. #include <asm-generic/io.h>
  56. #endif