Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 lines
883 B
C
35 lines
883 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2020 Western Digital Corporation or its affiliates.
|
|
*/
|
|
#ifndef __ASM_SECTIONS_H
|
|
#define __ASM_SECTIONS_H
|
|
|
|
#include <asm-generic/sections.h>
|
|
#include <linux/mm.h>
|
|
|
|
extern char _start[];
|
|
extern char _start_kernel[];
|
|
extern char __init_data_begin[], __init_data_end[];
|
|
extern char __init_text_begin[], __init_text_end[];
|
|
extern char __alt_start[], __alt_end[];
|
|
extern char __exittext_begin[], __exittext_end[];
|
|
|
|
static inline bool is_va_kernel_text(uintptr_t va)
|
|
{
|
|
uintptr_t start = (uintptr_t)_start;
|
|
uintptr_t end = (uintptr_t)__init_data_begin;
|
|
|
|
return va >= start && va < end;
|
|
}
|
|
|
|
static inline bool is_va_kernel_lm_alias_text(uintptr_t va)
|
|
{
|
|
uintptr_t start = (uintptr_t)lm_alias(_start);
|
|
uintptr_t end = (uintptr_t)lm_alias(__init_data_begin);
|
|
|
|
return va >= start && va < end;
|
|
}
|
|
|
|
#endif /* __ASM_SECTIONS_H */
|