| .. | .. |
|---|
| 2 | 2 | #ifndef _ASM_X86_SECTIONS_H |
|---|
| 3 | 3 | #define _ASM_X86_SECTIONS_H |
|---|
| 4 | 4 | |
|---|
| 5 | +#define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed |
|---|
| 6 | + |
|---|
| 5 | 7 | #include <asm-generic/sections.h> |
|---|
| 6 | 8 | #include <asm/extable.h> |
|---|
| 7 | 9 | |
|---|
| .. | .. |
|---|
| 11 | 13 | |
|---|
| 12 | 14 | #if defined(CONFIG_X86_64) |
|---|
| 13 | 15 | extern char __end_rodata_hpage_align[]; |
|---|
| 14 | | -extern char __entry_trampoline_start[], __entry_trampoline_end[]; |
|---|
| 15 | 16 | #endif |
|---|
| 16 | 17 | |
|---|
| 18 | +extern char __end_of_kernel_reserve[]; |
|---|
| 19 | + |
|---|
| 20 | +extern unsigned long _brk_start, _brk_end; |
|---|
| 21 | + |
|---|
| 22 | +static inline bool arch_is_kernel_initmem_freed(unsigned long addr) |
|---|
| 23 | +{ |
|---|
| 24 | + /* |
|---|
| 25 | + * If _brk_start has not been cleared, brk allocation is incomplete, |
|---|
| 26 | + * and we can not make assumptions about its use. |
|---|
| 27 | + */ |
|---|
| 28 | + if (_brk_start) |
|---|
| 29 | + return 0; |
|---|
| 30 | + |
|---|
| 31 | + /* |
|---|
| 32 | + * After brk allocation is complete, space between _brk_end and _end |
|---|
| 33 | + * is available for allocation. |
|---|
| 34 | + */ |
|---|
| 35 | + return addr >= _brk_end && addr < (unsigned long)&_end; |
|---|
| 36 | +} |
|---|
| 37 | + |
|---|
| 17 | 38 | #endif /* _ASM_X86_SECTIONS_H */ |
|---|