io.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * linux/include/asm-arm/arch-ebsa110/io.h
  3. *
  4. * Copyright (C) 1997,1998 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Modifications:
  11. * 06-Dec-1997 RMK Created.
  12. */
  13. #ifndef __ASM_ARM_ARCH_IO_H
  14. #define __ASM_ARM_ARCH_IO_H
  15. #define IO_SPACE_LIMIT 0xffff
  16. u8 __inb8(unsigned int port);
  17. void __outb8(u8 val, unsigned int port);
  18. u8 __inb16(unsigned int port);
  19. void __outb16(u8 val, unsigned int port);
  20. u16 __inw(unsigned int port);
  21. void __outw(u16 val, unsigned int port);
  22. u32 __inl(unsigned int port);
  23. void __outl(u32 val, unsigned int port);
  24. u8 __readb(const volatile void __iomem *addr);
  25. u16 __readw(const volatile void __iomem *addr);
  26. u32 __readl(const volatile void __iomem *addr);
  27. void __writeb(u8 val, void __iomem *addr);
  28. void __writew(u16 val, void __iomem *addr);
  29. void __writel(u32 val, void __iomem *addr);
  30. /*
  31. * Argh, someone forgot the IOCS16 line. We therefore have to handle
  32. * the byte stearing by selecting the correct byte IO functions here.
  33. */
  34. #ifdef ISA_SIXTEEN_BIT_PERIPHERAL
  35. #define inb(p) __inb16(p)
  36. #define outb(v,p) __outb16(v,p)
  37. #else
  38. #define inb(p) __inb8(p)
  39. #define outb(v,p) __outb8(v,p)
  40. #endif
  41. #define inw(p) __inw(p)
  42. #define outw(v,p) __outw(v,p)
  43. #define inl(p) __inl(p)
  44. #define outl(v,p) __outl(v,p)
  45. #define readb(b) __readb(b)
  46. #define readw(b) __readw(b)
  47. #define readl(b) __readl(b)
  48. #define readb_relaxed(addr) readb(addr)
  49. #define readw_relaxed(addr) readw(addr)
  50. #define readl_relaxed(addr) readl(addr)
  51. #define writeb(v,b) __writeb(v,b)
  52. #define writew(v,b) __writew(v,b)
  53. #define writel(v,b) __writel(v,b)
  54. static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size,
  55. unsigned int flags)
  56. {
  57. return (void __iomem *)cookie;
  58. }
  59. #define __arch_ioremap __arch_ioremap
  60. #define __arch_iounmap(cookie) do { } while (0)
  61. extern void insb(unsigned int port, void *buf, int sz);
  62. extern void insw(unsigned int port, void *buf, int sz);
  63. extern void insl(unsigned int port, void *buf, int sz);
  64. extern void outsb(unsigned int port, const void *buf, int sz);
  65. extern void outsw(unsigned int port, const void *buf, int sz);
  66. extern void outsl(unsigned int port, const void *buf, int sz);
  67. #endif