1 /*
2  * Copyright (c) 2019 Intel Corporation
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #include <zephyr/kernel.h>
7 #include <string.h>
8 #include <zephyr/arch/x86/memmap.h>
9 #include <zephyr/linker/linker-defs.h>
10 #include <kernel_arch_data.h>
11 
12 struct x86_memmap_exclusion x86_memmap_exclusions[] = {
13 #ifdef CONFIG_X86_64
14 	{ "locore", _locore_start, _locore_end },
15 #endif
16 #ifdef CONFIG_XIP
17 	{ "rom", __rom_region_start, __rom_region_end },
18 #endif
19 	{ "ram", _image_ram_start, _image_ram_end },
20 #ifdef CONFIG_USERSPACE
21 	{ "app_smem", _app_smem_start, _app_smem_end },
22 #endif
23 #ifdef CONFIG_COVERAGE_GCOV
24 	{ "gcov", __gcov_bss_start, __gcov_bss_end },
25 #endif
26 };
27 
28 int x86_nr_memmap_exclusions = sizeof(x86_memmap_exclusions) /
29 			       sizeof(struct x86_memmap_exclusion);
30 
31 /*
32  * The default map symbols are weak so that an application
33  * can override with a hardcoded manual map if desired.
34  */
35 
36 __weak enum x86_memmap_source x86_memmap_source = X86_MEMMAP_SOURCE_DEFAULT;
37 
38 __weak struct x86_memmap_entry x86_memmap[CONFIG_X86_MEMMAP_ENTRIES] = {
39 	{
40 		DT_REG_ADDR(DT_CHOSEN(zephyr_sram)),
41 		DT_REG_SIZE(DT_CHOSEN(zephyr_sram)),
42 		X86_MEMMAP_ENTRY_RAM
43 	}
44 };
45