File: sections.h

package info (click to toggle)
linux 6.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,532,052 kB
  • sloc: ansic: 23,400,063; asm: 266,720; sh: 108,896; makefile: 49,712; python: 36,925; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (37 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_SECTIONS_H
#define _ASM_X86_SECTIONS_H

#define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed

#include <asm-generic/sections.h>
#include <asm/extable.h>

extern char __brk_base[], __brk_limit[];
extern char __end_rodata_aligned[];

#if defined(CONFIG_X86_64)
extern char __end_rodata_hpage_align[];
#endif

extern char __end_of_kernel_reserve[];

extern unsigned long _brk_start, _brk_end;

static inline bool arch_is_kernel_initmem_freed(unsigned long addr)
{
	/*
	 * If _brk_start has not been cleared, brk allocation is incomplete,
	 * and we can not make assumptions about its use.
	 */
	if (_brk_start)
		return 0;

	/*
	 * After brk allocation is complete, space between _brk_end and _end
	 * is available for allocation.
	 */
	return addr >= _brk_end && addr < (unsigned long)&_end;
}

#endif	/* _ASM_X86_SECTIONS_H */