ioremap.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * (c) Copyright 2006 Hewlett-Packard Development Company, L.P.
  3. * Bjorn Helgaas <bjorn.helgaas@hp.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <linux/compiler.h>
  10. #include <linux/module.h>
  11. #include <linux/efi.h>
  12. #include <asm/io.h>
  13. static inline void __iomem *
  14. __ioremap (unsigned long offset, unsigned long size)
  15. {
  16. return (void __iomem *) (__IA64_UNCACHED_OFFSET | offset);
  17. }
  18. void __iomem *
  19. ioremap (unsigned long offset, unsigned long size)
  20. {
  21. if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB))
  22. return phys_to_virt(offset);
  23. if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
  24. return __ioremap(offset, size);
  25. /*
  26. * Someday this should check ACPI resources so we
  27. * can do the right thing for hot-plugged regions.
  28. */
  29. return __ioremap(offset, size);
  30. }
  31. EXPORT_SYMBOL(ioremap);
  32. void __iomem *
  33. ioremap_nocache (unsigned long offset, unsigned long size)
  34. {
  35. return __ioremap(offset, size);
  36. }
  37. EXPORT_SYMBOL(ioremap_nocache);