mapmem.h 622 B

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