Skip to content

Commit

Permalink
arch: Port the ramfunc section to the Cmake function
Browse files Browse the repository at this point in the history
Remove it from linker.ld

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
  • Loading branch information
oyvindronningstad authored and nashif committed May 21, 2019
1 parent 0001039 commit 6d00394
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
6 changes: 6 additions & 0 deletions arch/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ zephyr_sources_ifdef(
CONFIG_EXECUTION_BENCHMARKING
timing_info_bench.c
)


zephyr_linker_sources_ifdef(CONFIG_ARCH_HAS_RAMFUNC_SUPPORT
RAM_SECTIONS
ramfunc.ld
)
20 changes: 20 additions & 0 deletions arch/common/ramfunc.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
* Copyright (c) 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/* Copied from linker.ld */

SECTION_DATA_PROLOGUE(.ramfunc,,)
{
MPU_ALIGN(_ramfunc_ram_size);
_ramfunc_ram_start = .;
*(.ramfunc)
*(".ramfunc.*")
MPU_ALIGN(_ramfunc_ram_size);
_ramfunc_ram_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
_ramfunc_ram_size = _ramfunc_ram_end - _ramfunc_ram_start;
_ramfunc_rom_start = LOADADDR(.ramfunc);
14 changes: 0 additions & 14 deletions include/arch/arm/cortex_m/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -375,20 +375,6 @@ SECTIONS
_nocache_ram_size = _nocache_ram_end - _nocache_ram_start;
#endif /* CONFIG_NOCACHE_MEMORY */

#if defined(CONFIG_ARCH_HAS_RAMFUNC_SUPPORT)
SECTION_DATA_PROLOGUE(.ramfunc,,)
{
MPU_ALIGN(_ramfunc_ram_size);
_ramfunc_ram_start = .;
*(.ramfunc)
*(".ramfunc.*")
MPU_ALIGN(_ramfunc_ram_size);
_ramfunc_ram_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
_ramfunc_ram_size = _ramfunc_ram_end - _ramfunc_ram_start;
_ramfunc_rom_start = LOADADDR(.ramfunc);
#endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */

/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
Expand Down

0 comments on commit 6d00394

Please sign in to comment.