From 4f652d31c6c38f7b2547b37863d18eb8242e0b56 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorkiewicz Date: Mon, 9 Aug 2021 18:30:07 +0200 Subject: [PATCH] mm/regions: add rmode and symbols sections to kernel sections Signed-off-by: Pawel Wieczorkiewicz --- include/mm/regions.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/mm/regions.h b/include/mm/regions.h index 776c724e..5dad496d 100644 --- a/include/mm/regions.h +++ b/include/mm/regions.h @@ -104,6 +104,12 @@ static inline bool in_init_section(const void *addr) { (addr >= _ptr(__start_bss_init) && addr < _ptr(__end_bss_init)); } +static inline bool in_rmode_section(const void *addr) { + return (addr >= _ptr(__start_text_rmode) && addr < _ptr(__end_text_rmode)) || + (addr >= _ptr(__start_data_rmode) && addr < _ptr(__end_data_rmode)) || + (addr >= _ptr(__start_bss_rmode) && addr < _ptr(__end_bss_rmode)); +} + static inline bool in_user_section(const void *addr) { return (addr >= _ptr(__start_text_user) && addr < _ptr(__end_text_user)) || (addr >= _ptr(__start_data_user) && addr < _ptr(__end_data_user)) || @@ -111,10 +117,12 @@ static inline bool in_user_section(const void *addr) { } static inline bool in_kernel_section(const void *addr) { - return (addr >= _ptr(__start_text) && addr < _ptr(__end_text)) || + return in_rmode_section(addr) || + (addr >= _ptr(__start_text) && addr < _ptr(__end_text)) || (addr >= _ptr(__start_data) && addr < _ptr(__end_data)) || (addr >= _ptr(__start_bss) && addr < _ptr(__end_bss)) || - (addr >= _ptr(__start_rodata) && addr < _ptr(__end_rodata)); + (addr >= _ptr(__start_rodata) && addr < _ptr(__end_rodata)) || + (addr >= _ptr(__start_symbols) && addr < _ptr(__end_symbols)); } static inline uint32_t get_bios_ebda_addr(void) {