hiddenDangerAnalysis.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * linux/include/asm-m68k/io.h
  3. *
  4. * 4/1/00 RZ: - rewritten to avoid clashes between ISA/PCI and other
  5. * IO access
  6. * - added Q40 support
  7. * - added skeleton for GG-II and Amiga PCMCIA
  8. * 2/3/01 RZ: - moved a few more defs into raw_io.h
  9. *
  10. * inX/outX should not be used by any driver unless it does
  11. * ISA access. Other drivers should use function defined in raw_io.h
  12. * or define its own macros on top of these.
  13. *
  14. * inX(),outX() are for ISA I/O
  15. * isa_readX(),isa_writeX() are for ISA memory
  16. */
  17. #ifndef _IO_H
  18. #define _IO_H
  19. #ifdef __KERNEL__
  20. #include <linux/compiler.h>
  21. #include <asm/raw_io.h>
  22. #include <asm/virtconvert.h>
  23. #include <asm-generic/iomap.h>
  24. #ifdef CONFIG_ATARI
  25. #include <asm/atarihw.h>
  26. #endif
  27. /*
  28. * IO/MEM definitions for various ISA bridges
  29. */
  30. #ifdef CONFIG_Q40
  31. #define q40_isa_io_base 0xff400000
  32. #define q40_isa_mem_base 0xff800000
  33. #define Q40_ISA_IO_B(ioaddr) (q40_isa_io_base+1+4*((unsigned long)(ioaddr)))
  34. #define Q40_ISA_IO_W(ioaddr) (q40_isa_io_base+ 4*((unsigned long)(ioaddr)))
  35. #define Q40_ISA_MEM_B(madr) (q40_isa_mem_base+1+4*((unsigned long)(madr)))
  36. #define Q40_ISA_MEM_W(madr) (q40_isa_mem_base+ 4*((unsigned long)(madr)))
  37. #define MULTI_ISA 0
  38. #endif /* Q40 */
  39. #ifdef CONFIG_AMIGA_PCMCIA
  40. #include <asm/amigayle.h>
  41. #define AG_ISA_IO_B(ioaddr) ( GAYLE_IO+(ioaddr)+(((ioaddr)&1)*GAYLE_ODD) )
  42. #define AG_ISA_IO_W(ioaddr) ( GAYLE_IO+(ioaddr) )
  43. #ifndef MULTI_ISA
  44. #define MULTI_ISA 0
  45. #else
  46. #undef MULTI_ISA
  47. #define MULTI_ISA 1
  48. #endif
  49. #endif /* AMIGA_PCMCIA */
  50. #if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE)
  51. #define HAVE_ARCH_PIO_SIZE
  52. #define PIO_OFFSET 0
  53. #define PIO_MASK 0xffff
  54. #define PIO_RESERVED 0x10000
  55. u8 mcf_pci_inb(u32 addr);
  56. u16 mcf_pci_inw(u32 addr);
  57. u32 mcf_pci_inl(u32 addr);
  58. void mcf_pci_insb(u32 addr, u8 *buf, u32 len);
  59. void mcf_pci_insw(u32 addr, u16 *buf, u32 len);
  60. void mcf_pci_insl(u32 addr, u32 *buf, u32 len);
  61. void mcf_pci_outb(u8 v, u32 addr);
  62. void mcf_pci_outw(u16 v, u32 addr);
  63. void mcf_pci_outl(u32 v, u32 addr);
  64. void mcf_pci_outsb(u32 addr, const u8 *buf, u32 len);
  65. void mcf_pci_outsw(u32 addr, const u16 *buf, u32 len);
  66. void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len);
  67. #define inb mcf_pci_inb
  68. #define inb_p mcf_pci_inb
  69. #define inw mcf_pci_inw
  70. #define inw_p mcf_pci_inw
  71. #define inl mcf_pci_inl
  72. #define inl_p mcf_pci_inl
  73. #define insb mcf_pci_insb
  74. #define insw mcf_pci_insw
  75. #define insl mcf_pci_insl
  76. #define outb mcf_pci_outb
  77. #define outb_p mcf_pci_outb
  78. #define outw mcf_pci_outw
  79. #define outw_p mcf_pci_outw
  80. #define outl mcf_pci_outl
  81. #define outl_p mcf_pci_outl
  82. #define outsb mcf_pci_outsb
  83. #define outsw mcf_pci_outsw
  84. #define outsl mcf_pci_outsl
  85. #define readb(addr) in_8(addr)
  86. #define writeb(v, addr) out_8((addr), (v))
  87. #define readw(addr) in_le16(addr)
  88. #define writew(v, addr) out_le16((addr), (v))
  89. #elif defined(CONFIG_ISA)
  90. #if MULTI_ISA == 0
  91. #undef MULTI_ISA
  92. #endif
  93. #define ISA_TYPE_Q40 (1)
  94. #define ISA_TYPE_AG (2)
  95. #if defined(CONFIG_Q40) && !defined(MULTI_ISA)
  96. #define ISA_TYPE ISA_TYPE_Q40
  97. #define ISA_SEX 0
  98. #endif
  99. #if defined(CONFIG_AMIGA_PCMCIA) && !defined(MULTI_ISA)
  100. #define ISA_TYPE ISA_TYPE_AG
  101. #define ISA_SEX 1
  102. #endif
  103. #ifdef MULTI_ISA
  104. extern int isa_type;
  105. extern int isa_sex;
  106. #define ISA_TYPE isa_type
  107. #define ISA_SEX isa_sex
  108. #endif
  109. /*
  110. * define inline addr translation functions. Normally only one variant will
  111. * be compiled in so the case statement will be optimised away
  112. */
  113. static inline u8 __iomem *isa_itb(unsigned long addr)
  114. {