device: s/device_handles/device_deps/ in linker scripts

Use the "device_deps" naming scheme to emphasize we are storing device
dependencies. The fact we are using device handles to store them is an
implementation detail.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-06-14 12:10:40 +02:00 committed by Carles Cufí
commit 8bee39edff
9 changed files with 25 additions and 25 deletions

View file

@ -942,8 +942,8 @@ if(CONFIG_HAS_DTS)
) )
set_property(GLOBAL APPEND PROPERTY GENERATED_APP_SOURCE_FILES device_deps.c) set_property(GLOBAL APPEND PROPERTY GENERATED_APP_SOURCE_FILES device_deps.c)
# gen_device_deps runs on `__device_handles_pass1` so pass this info to the linker script generator # gen_device_deps runs on `__device_deps_pass1` so pass this info to the linker script generator
list(APPEND LINKER_PASS_${ZEPHYR_CURRENT_LINKER_PASS}_DEFINE "LINKER_DEVICE_HANDLES_PASS1") list(APPEND LINKER_PASS_${ZEPHYR_CURRENT_LINKER_PASS}_DEFINE "LINKER_DEVICE_DEPS_PASS1")
endif() endif()
if(CONFIG_CODE_DATA_RELOCATION) if(CONFIG_CODE_DATA_RELOCATION)

View file

@ -185,9 +185,9 @@ zephyr_iterable_section(NAME tracing_backend KVMA RAM_REGION GROUP RODATA_REGION
zephyr_linker_section(NAME zephyr_dbg_info KVMA RAM_REGION GROUP RODATA_REGION NOINPUT ${XIP_ALIGN_WITH_INPUT}) zephyr_linker_section(NAME zephyr_dbg_info KVMA RAM_REGION GROUP RODATA_REGION NOINPUT ${XIP_ALIGN_WITH_INPUT})
zephyr_linker_section_configure(SECTION zephyr_dbg_info INPUT ".zephyr_dbg_info" KEEP) zephyr_linker_section_configure(SECTION zephyr_dbg_info INPUT ".zephyr_dbg_info" KEEP)
zephyr_linker_section(NAME device_handles KVMA RAM_REGION GROUP RODATA_REGION NOINPUT ${XIP_ALIGN_WITH_INPUT} ENDALIGN 16) zephyr_linker_section(NAME device_deps KVMA RAM_REGION GROUP RODATA_REGION NOINPUT ${XIP_ALIGN_WITH_INPUT} ENDALIGN 16)
zephyr_linker_section_configure(SECTION device_handles INPUT .__device_handles_pass1* KEEP SORT NAME PASS LINKER_DEVICE_HANDLES_PASS1) zephyr_linker_section_configure(SECTION device_deps INPUT .__device_deps_pass1* KEEP SORT NAME PASS LINKER_DEVICE_DEPS_PASS1)
zephyr_linker_section_configure(SECTION device_handles INPUT .__device_handles_pass2* KEEP SORT NAME PASS NOT LINKER_DEVICE_HANDLES_PASS1) zephyr_linker_section_configure(SECTION device_deps INPUT .__device_deps_pass2* KEEP SORT NAME PASS NOT LINKER_DEVICE_DEPS_PASS1)
zephyr_iterable_section(NAME _static_thread_data KVMA RAM_REGION GROUP RODATA_REGION SUBALIGN 4) zephyr_iterable_section(NAME _static_thread_data KVMA RAM_REGION GROUP RODATA_REGION SUBALIGN 4)

View file

@ -778,7 +778,7 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
/** @brief Linker section were device handles are placed. */ /** @brief Linker section were device handles are placed. */
#define Z_DEVICE_HANDLES_SECTION \ #define Z_DEVICE_HANDLES_SECTION \
__attribute__((__section__(".__device_handles_pass1"))) __attribute__((__section__(".__device_deps_pass1")))
#ifdef __cplusplus #ifdef __cplusplus
#define Z_DEVICE_HANDLES_EXTERN extern #define Z_DEVICE_HANDLES_EXTERN extern

View file

@ -43,9 +43,9 @@
#endif #endif
#if defined(CONFIG_HAS_DYNAMIC_DEVICE_HANDLES) #if defined(CONFIG_HAS_DYNAMIC_DEVICE_HANDLES)
SECTION_DATA_PROLOGUE(device_handles,,) SECTION_DATA_PROLOGUE(device_deps,,)
{ {
#include "device-handles.ld" #include "device-deps.ld"
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_HAS_DYNAMIC_DEVICE_HANDLES */ #endif /* CONFIG_HAS_DYNAMIC_DEVICE_HANDLES */

View file

@ -65,8 +65,8 @@
#endif /* CONFIG_PCIE */ #endif /* CONFIG_PCIE */
#if !defined(CONFIG_HAS_DYNAMIC_DEVICE_HANDLES) #if !defined(CONFIG_HAS_DYNAMIC_DEVICE_HANDLES)
SECTION_DATA_PROLOGUE(device_handles,,) SECTION_DATA_PROLOGUE(device_deps,,)
{ {
#include <zephyr/linker/device-handles.ld> #include <zephyr/linker/device-deps.ld>
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* !CONFIG_HAS_DYNAMIC_DEVICE_HANDLES */ #endif /* !CONFIG_HAS_DYNAMIC_DEVICE_HANDLES */

View file

@ -0,0 +1,13 @@
/*
* Copyright (c) 2021 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
__device_deps_start = .;
#ifdef LINKER_DEVICE_DEPS_PASS1
KEEP(*(SORT(.__device_deps_pass1*)));
#else
KEEP(*(SORT(.__device_deps_pass2*)));
#endif /* LINKER_DEVICE_DEPS_PASS1 */
__device_deps_end = .;

View file

@ -1,13 +0,0 @@
/*
* Copyright (c) 2021 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
__device_handles_start = .;
#ifdef LINKER_DEVICE_HANDLES_PASS1
KEEP(*(SORT(.__device_handles_pass1*)));
#else
KEEP(*(SORT(.__device_handles_pass2*)));
#endif /* LINKER_DEVICE_HANDLES_PASS1 */
__device_handles_end = .;

View file

@ -107,7 +107,7 @@ def c_handle_array(dev, handles, dynamic_handles, extra_support_handles=0):
] ]
ctype = ( ctype = (
'{:s}Z_DECL_ALIGN(device_handle_t) ' '{:s}Z_DECL_ALIGN(device_handle_t) '
'__attribute__((__section__(".__device_handles_pass2")))' '__attribute__((__section__(".__device_deps_pass2")))'
).format('const ' if not dynamic_handles else '') ).format('const ' if not dynamic_handles else '')
return [ return [
# The `extern` line pretends this was first declared in some .h # The `extern` line pretends this was first declared in some .h

View file

@ -74,7 +74,7 @@ class SectionKind(Enum):
>>> SectionKind.for_section_with_name(".rodata.str1.4") >>> SectionKind.for_section_with_name(".rodata.str1.4")
<SectionKind.RODATA: 'rodata'> <SectionKind.RODATA: 'rodata'>
>>> SectionKind.for_section_with_name(".device_handles") >>> SectionKind.for_section_with_name(".device_deps")
None None
""" """
if ".text." in name: if ".text." in name: