1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2020 Western Digital Corporation or its affiliates.
5 #ifndef __ASM_SECTIONS_H
6 #define __ASM_SECTIONS_H
8 #include <asm-generic/sections.h>
12 extern char _start_kernel[];
13 extern char __init_data_begin[], __init_data_end[];
14 extern char __init_text_begin[], __init_text_end[];
15 extern char __alt_start[], __alt_end[];
16 extern char __exittext_begin[], __exittext_end[];
18 static inline bool is_va_kernel_text(uintptr_t va)
20 uintptr_t start = (uintptr_t)_start;
21 uintptr_t end = (uintptr_t)__init_data_begin;
23 return va >= start && va < end;
26 static inline bool is_va_kernel_lm_alias_text(uintptr_t va)
28 uintptr_t start = (uintptr_t)lm_alias(_start);
29 uintptr_t end = (uintptr_t)lm_alias(__init_data_begin);
31 return va >= start && va < end;
34 #endif /* __ASM_SECTIONS_H */