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 10 #ifndef __MAPMEM_H 11 #define __MAPMEM_H 12 13 /* Define a null map_sysmem() if the architecture doesn't use it */ 14 # ifdef CONFIG_ARCH_MAP_SYSMEM 15 #include <asm/io.h> 16 # else 17 static inline void *map_sysmem(phys_addr_t paddr, unsigned long len) 18 { 19 return (void *)(uintptr_t)paddr; 20 } 21 22 static inline void unmap_sysmem(const void *vaddr) 23 { 24 } 25 26 static inline phys_addr_t map_to_sysmem(const void *ptr) 27 { 28 return (phys_addr_t)(uintptr_t)ptr; 29 } 30 # endif 31 32 #endif /* __MAPMEM_H */ 33