mapmem.h 619 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2015 National Instruments
  4. *
  5. * (C) Copyright 2015
  6. * Joe Hershberger <joe.hershberger@ni.com>
  7. */
  8. #ifndef __MAPMEM_H
  9. #define __MAPMEM_H
  10. /* Define a null map_sysmem() if the architecture doesn't use it */
  11. # ifdef CONFIG_ARCH_MAP_SYSMEM
  12. #include <asm/io.h>
  13. # else
  14. static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
  15. {
  16. return (void *)(uintptr_t)paddr;
  17. }
  18. static inline void unmap_sysmem(const void *vaddr)
  19. {
  20. }
  21. static inline phys_addr_t map_to_sysmem(const void *ptr)
  22. {
  23. return (phys_addr_t)(uintptr_t)ptr;
  24. }
  25. # endif
  26. #endif /* __MAPMEM_H */