1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _LINUX_IOREMAP_H 2 #ifndef _LINUX_IOREMAP_H 3 #define _LINUX_IOREMAP_H 3 #define _LINUX_IOREMAP_H 4 4 5 #include <linux/kasan.h> 5 #include <linux/kasan.h> 6 #include <asm/pgtable.h> 6 #include <asm/pgtable.h> 7 #include <asm/vmalloc.h> << 8 7 9 #if defined(CONFIG_HAS_IOMEM) || defined(CONFI 8 #if defined(CONFIG_HAS_IOMEM) || defined(CONFIG_GENERIC_IOREMAP) 10 /* 9 /* 11 * Ioremap often, but not always uses the gene 10 * Ioremap often, but not always uses the generic vmalloc area. E.g on 12 * Power ARCH, it could have different ioremap 11 * Power ARCH, it could have different ioremap space. 13 */ 12 */ 14 #ifndef IOREMAP_START 13 #ifndef IOREMAP_START 15 #define IOREMAP_START VMALLOC_START 14 #define IOREMAP_START VMALLOC_START 16 #define IOREMAP_END VMALLOC_END 15 #define IOREMAP_END VMALLOC_END 17 #endif 16 #endif 18 static inline bool is_ioremap_addr(const void 17 static inline bool is_ioremap_addr(const void *x) 19 { 18 { 20 unsigned long addr = (unsigned long)ka 19 unsigned long addr = (unsigned long)kasan_reset_tag(x); 21 20 22 return addr >= IOREMAP_START && addr < 21 return addr >= IOREMAP_START && addr < IOREMAP_END; 23 } 22 } 24 #else 23 #else 25 static inline bool is_ioremap_addr(const void 24 static inline bool is_ioremap_addr(const void *x) 26 { 25 { 27 return false; 26 return false; 28 } 27 } 29 #endif 28 #endif 30 29 31 #endif /* _LINUX_IOREMAP_H */ 30 #endif /* _LINUX_IOREMAP_H */ 32 31
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.