kmap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _KMAP_H
  3. #define _KMAP_H
  4. #ifdef CONFIG_MMU
  5. /* Values for nocacheflag and cmode */
  6. #define IOMAP_FULL_CACHING 0
  7. #define IOMAP_NOCACHE_SER 1
  8. #define IOMAP_NOCACHE_NONSER 2
  9. #define IOMAP_WRITETHROUGH 3
  10. /*
  11. * These functions exported by arch/m68k/mm/kmap.c.
  12. * Only needed on MMU enabled systems.
  13. */
  14. extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
  15. int cacheflag);
  16. #define iounmap iounmap
  17. extern void iounmap(void __iomem *addr);
  18. #define ioremap ioremap
  19. static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
  20. {
  21. return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
  22. }
  23. #define ioremap_wt ioremap_wt
  24. static inline void __iomem *ioremap_wt(unsigned long physaddr,
  25. unsigned long size)
  26. {
  27. return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
  28. }
  29. #define memset_io memset_io
  30. static inline void memset_io(volatile void __iomem *addr, unsigned char val,
  31. int count)
  32. {
  33. __builtin_memset((void __force *) addr, val, count);
  34. }
  35. #define memcpy_fromio memcpy_fromio
  36. static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
  37. int count)
  38. {
  39. __builtin_memcpy(dst, (void __force *) src, count);
  40. }
  41. #define memcpy_toio memcpy_toio
  42. static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
  43. int count)
  44. {
  45. __builtin_memcpy((void __force *) dst, src, count);
  46. }
  47. #endif /* CONFIG_MMU */
  48. #define ioport_map ioport_map
  49. static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
  50. {
  51. return (void __iomem *) port;
  52. }
  53. #define ioport_unmap ioport_unmap
  54. static inline void ioport_unmap(void __iomem *p)
  55. {
  56. }
  57. #endif /* _KMAP_H */