io.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #define xlate_dev_mem_ptr xlate_dev_mem_ptr
  14. void *xlate_dev_mem_ptr(phys_addr_t phys);
  15. #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
  16. void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
  17. /*
  18. * Convert a virtual cached pointer to an uncached pointer
  19. */
  20. #define xlate_dev_kmem_ptr(p) p
  21. #define IO_SPACE_LIMIT 0
  22. #ifdef CONFIG_PCI
  23. #define ioremap_nocache(addr, size) ioremap(addr, size)
  24. #define ioremap_wc ioremap_nocache
  25. #define ioremap_wt ioremap_nocache
  26. static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
  27. {
  28. return (void __iomem *) offset;
  29. }
  30. static inline void iounmap(volatile void __iomem *addr)
  31. {
  32. }
  33. static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
  34. {
  35. return NULL;
  36. }
  37. static inline void ioport_unmap(void __iomem *p)
  38. {
  39. }
  40. /*
  41. * s390 needs a private implementation of pci_iomap since ioremap with its
  42. * offset parameter isn't sufficient. That's because BAR spaces are not
  43. * disjunctive on s390 so we need the bar parameter of pci_iomap to find
  44. * the corresponding device and create the mapping cookie.
  45. */
  46. #define pci_iomap pci_iomap
  47. #define pci_iounmap pci_iounmap
  48. #define pci_iomap_wc pci_iomap
  49. #define pci_iomap_wc_range pci_iomap_range
  50. #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
  51. #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
  52. #define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
  53. #define __raw_readb zpci_read_u8
  54. #define __raw_readw zpci_read_u16
  55. #define __raw_readl zpci_read_u32
  56. #define __raw_readq zpci_read_u64
  57. #define __raw_writeb zpci_write_u8
  58. #define __raw_writew zpci_write_u16
  59. #define __raw_writel zpci_write_u32
  60. #define __raw_writeq zpci_write_u64
  61. #endif /* CONFIG_PCI */
  62. #include <asm-generic/io.h>
  63. #endif