Skip to content

Commit

Permalink
mm/regions: add rmode and symbols sections to kernel sections
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Aug 17, 2021
1 parent 654a72e commit 4f652d3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/mm/regions.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,25 @@ 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)) ||
(addr >= _ptr(__start_bss_user) && addr < _ptr(__end_bss_user));
}

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) {
Expand Down

0 comments on commit 4f652d3

Please sign in to comment.