Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / linux / ioremap.h
blob2bd1661fe9ad607ada4ecbe4f8d091337706b742
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_IOREMAP_H
3 #define _LINUX_IOREMAP_H
5 #include <linux/kasan.h>
6 #include <asm/pgtable.h>
7 #include <asm/vmalloc.h>
9 #if defined(CONFIG_HAS_IOMEM) || defined(CONFIG_GENERIC_IOREMAP)
11 * Ioremap often, but not always uses the generic vmalloc area. E.g on
12 * Power ARCH, it could have different ioremap space.
14 #ifndef IOREMAP_START
15 #define IOREMAP_START VMALLOC_START
16 #define IOREMAP_END VMALLOC_END
17 #endif
18 static inline bool is_ioremap_addr(const void *x)
20 unsigned long addr = (unsigned long)kasan_reset_tag(x);
22 return addr >= IOREMAP_START && addr < IOREMAP_END;
24 #else
25 static inline bool is_ioremap_addr(const void *x)
27 return false;
29 #endif
31 #endif /* _LINUX_IOREMAP_H */