1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2015 National Instruments
6 * Joe Hershberger <joe.hershberger@ni.com>
12 /* Define a null map_sysmem() if the architecture doesn't use it */
13 # ifdef CONFIG_ARCH_MAP_SYSMEM
16 #include <linux/types.h>
18 static inline void *map_sysmem(phys_addr_t paddr
, unsigned long len
)
20 return (void *)(uintptr_t)paddr
;
23 static inline void unmap_sysmem(const void *vaddr
)
27 static inline phys_addr_t
map_to_sysmem(const void *ptr
)
29 return (phys_addr_t
)(uintptr_t)ptr
;
33 * nomap_sysmem() - pass through an address unchanged
35 * This is used to indicate an address which should NOT be mapped, e.g. in
36 * SMBIOS tables. Using this function instead of a case shows that the sandbox
37 * conversion has been done
39 static inline void *nomap_sysmem(phys_addr_t paddr
, unsigned long len
)
41 return (void *)(uintptr_t)paddr
;
44 static inline phys_addr_t
nomap_to_sysmem(const void *ptr
)
46 return (phys_addr_t
)(uintptr_t)ptr
;
51 #endif /* __MAPMEM_H */