summaryrefslogtreecommitdiff
path: root/include/asm-generic/sections.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/sections.h')
-rw-r--r--include/asm-generic/sections.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 614fc809de34..7cba8ff10d3a 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -129,6 +129,22 @@ static inline bool init_section_intersects(void *virt, size_t size)
}
/**
+ * is_kernel_core_data - checks if the pointer address is located in the
+ * .data section
+ *
+ * @addr: address to check
+ *
+ * Returns: true if the address is located in .data, false otherwise.
+ * Note: On some archs it may return true for core RODATA, and false
+ * for others. But will always be true for core RW data.
+ */
+static inline bool is_kernel_core_data(unsigned long addr)
+{
+ return addr >= (unsigned long)_sdata &&
+ addr < (unsigned long)_edata;
+}
+
+/**
* is_kernel_rodata - checks if the pointer address is located in the
* .rodata section
*