ioport.c 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * arch/sh/kernel/ioport.c
  3. *
  4. * Copyright (C) 2000 Niibe Yutaka
  5. * Copyright (C) 2005 - 2007 Paul Mundt
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file "COPYING" in the main directory of this archive
  9. * for more details.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/io.h>
  13. unsigned long sh_io_port_base __read_mostly = -1;
  14. EXPORT_SYMBOL(sh_io_port_base);
  15. void __iomem *__ioport_map(unsigned long addr, unsigned int size)
  16. {
  17. if (sh_mv.mv_ioport_map)
  18. return sh_mv.mv_ioport_map(addr, size);
  19. return (void __iomem *)(addr + sh_io_port_base);
  20. }
  21. EXPORT_SYMBOL(__ioport_map);
  22. void __iomem *ioport_map(unsigned long port, unsigned int nr)
  23. {
  24. void __iomem *ret;
  25. ret = __ioport_map_trapped(port, nr);
  26. if (ret)
  27. return ret;
  28. return __ioport_map(port, nr);
  29. }
  30. EXPORT_SYMBOL(ioport_map);
  31. void ioport_unmap(void __iomem *addr)
  32. {
  33. if (sh_mv.mv_ioport_unmap)
  34. sh_mv.mv_ioport_unmap(addr);
  35. }
  36. EXPORT_SYMBOL(ioport_unmap);