zephyr/arch/x86/core/memmap.c
Torsten Rasmussen c6aded2dcb linker: align _image_rodata and _image_rom start/end/size linker symbols
Cleanup and preparation commit for linker script generator.

Zephyr linker scripts provides start and end symbols for each larger
areas in the linker script.

The symbols _image_rom_start and _image_rom_end corresponds to the group
ROMABLE_REGION defined in the ld linker scripts.

The symbols _image_rodata_start and _image_rodata_end is not placed as
independent group but covers common-rom.ld, thread-local-storage.ld,
kobject-rom.ld and snippets-rodata.ld.

This commit align those names and prepares for generation of groups in
linker scripts.

The symbols describing the ROMABLE_REGION will be renamed to:
_image_rom_start -> __rom_region_start
_image_rom_end   -> __rom_region_end

The rodata will also use the group symbol notation as:
_image_rodata_start -> __rodata_region_start
_image_rodata_end   -> __rodata_region_end

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-28 08:48:03 -04:00

45 lines
1.1 KiB
C

/*
* Copyright (c) 2019 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <string.h>
#include <arch/x86/memmap.h>
#include <linker/linker-defs.h>
#include <kernel_arch_data.h>
struct x86_memmap_exclusion x86_memmap_exclusions[] = {
#ifdef CONFIG_X86_64
{ "locore", _locore_start, _locore_end },
#endif
#ifdef CONFIG_XIP
{ "rom", __rom_region_start, __rom_region_end },
#endif
{ "ram", _image_ram_start, _image_ram_end },
#ifdef CONFIG_USERSPACE
{ "app_smem", _app_smem_start, _app_smem_end },
#endif
#ifdef CONFIG_COVERAGE_GCOV
{ "gcov", __gcov_bss_start, __gcov_bss_end },
#endif
};
int x86_nr_memmap_exclusions = sizeof(x86_memmap_exclusions) /
sizeof(struct x86_memmap_exclusion);
/*
* The default map symbols are weak so that an application
* can override with a hardcoded manual map if desired.
*/
__weak enum x86_memmap_source x86_memmap_source = X86_MEMMAP_SOURCE_DEFAULT;
__weak struct x86_memmap_entry x86_memmap[CONFIG_X86_MEMMAP_ENTRIES] = {
{
DT_REG_ADDR(DT_CHOSEN(zephyr_sram)),
DT_REG_SIZE(DT_CHOSEN(zephyr_sram)),
X86_MEMMAP_ENTRY_RAM
}
};