iterable_sections: move to specific header
Until now iterable sections APIs have been part of the toolchain (common) headers. They are not strictly related to a toolchain, they just rely on linker providing support for sections. Most files relied on indirect includes to access the API, now, it is included as needed. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
4975c94845
commit
dacb3dbfeb
133 changed files with 599 additions and 430 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <zephyr/drivers/interrupt_controller/loapic.h>
|
||||
#include <zephyr/irq.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <x86_mmu.h>
|
||||
|
||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Linker command/script file
|
||||
|
|
|
@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(uart_mux, CONFIG_UART_MUX_LOG_LEVEL);
|
|||
#include <zephyr/sys/ring_buffer.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "gsm_mux.h"
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(pcie, LOG_LEVEL_ERR);
|
|||
#include <zephyr/sys/check.h>
|
||||
#include <stdbool.h>
|
||||
#include <zephyr/drivers/pcie/pcie.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#if CONFIG_PCIE_MSI
|
||||
#include <zephyr/drivers/pcie/msi.h>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <ctype.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#define SENSOR_GET_HELP \
|
||||
"Get sensor data. Channel names are optional. All channels are read " \
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "uvb.h"
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#ifndef ZEPHYR_INCLUDE_UVB
|
||||
#define ZEPHYR_INCLUDE_UVB
|
||||
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <zephyr/arch/x86/intel64/thread.h>
|
||||
#include <zephyr/arch/x86/thread_stack.h>
|
||||
#if defined(CONFIG_PCIE) && !defined(_ASMLANGUAGE)
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#endif
|
||||
|
||||
#if CONFIG_ISR_STACK_SIZE != (CONFIG_ISR_SUBSTACK_SIZE * CONFIG_ISR_DEPTH)
|
||||
#error "Check ISR stack configuration (CONFIG_ISR_*)"
|
||||
|
@ -113,8 +116,6 @@ struct x86_ssf {
|
|||
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ \
|
||||
} while (false)
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef CONFIG_PCIE
|
||||
#define X86_RESERVE_IRQ(irq_p, name) \
|
||||
static TYPE_SECTION_ITERABLE(uint8_t, name, irq_alloc, name) = irq_p
|
||||
|
@ -122,6 +123,8 @@ struct x86_ssf {
|
|||
#define X86_RESERVE_IRQ(irq_p, name)
|
||||
#endif
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
/*
|
||||
* All Intel64 interrupts are dynamically connected.
|
||||
*/
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <zephyr/bluetooth/addr.h>
|
||||
#include <zephyr/bluetooth/gap.h>
|
||||
#include <zephyr/bluetooth/direction.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <zephyr/bluetooth/conn.h>
|
||||
#include <zephyr/bluetooth/uuid.h>
|
||||
#include <zephyr/bluetooth/att.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* @brief Provisioning
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* @brief Proxy
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <zephyr/init.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
#include <zephyr/sys/device_mmio.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/display.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -26,6 +26,7 @@ struct emul;
|
|||
#include <zephyr/drivers/espi_emul.h>
|
||||
#include <zephyr/drivers/i2c_emul.h>
|
||||
#include <zephyr/drivers/spi_emul.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* The types of supported buses.
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <zephyr/dt-bindings/pcie/pcie.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <zephyr/device.h>
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/tracing/tracing_macros.h>
|
||||
#include <zephyr/sys/mem_stats.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
#if defined(CONFIG_NETWORKING)
|
||||
#ifndef NETWORK_RAM_SECTIONS
|
||||
#define NETWORK_RAM_SECTIONS \
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4)
|
||||
|
||||
#if defined(CONFIG_BT_BREDR)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
ITERABLE_SECTION_ROM(tracing_backend, 4)
|
||||
|
||||
SECTION_DATA_PROLOGUE(zephyr_dbg_info,,)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
SECTION_PROLOGUE(initlevel,,)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
ITERABLE_SECTION_ROM(log_strings, 4)
|
||||
|
||||
ITERABLE_SECTION_ROM(log_const, 4)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
#if defined(CONFIG_EC_HOST_CMD)
|
||||
ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4)
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
#if defined(CONFIG_NET_SOCKETS)
|
||||
ITERABLE_SECTION_ROM(net_socket_register, 4)
|
||||
#endif
|
||||
|
|
145
include/zephyr/linker/iterable_sections.h
Normal file
145
include/zephyr/linker/iterable_sections.h
Normal file
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* Copyright (C) 2020, Intel Corporation
|
||||
* Copyright (C) 2023, Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_ZEPHYR_LINKER_ITERABLE_SECTIONS_H_
|
||||
#define INCLUDE_ZEPHYR_LINKER_ITERABLE_SECTIONS_H_
|
||||
|
||||
/**
|
||||
* @addtogroup iterable_section_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define Z_LINK_ITERABLE(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
KEEP(*(SORT_BY_NAME(._##struct_type.static.*))); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
#define Z_LINK_ITERABLE_NUMERIC(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
KEEP(*(SORT(._##struct_type.static.*_?_*))); \
|
||||
KEEP(*(SORT(._##struct_type.static.*_??_*))); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
#define Z_LINK_ITERABLE_ALIGNED(struct_type, align) \
|
||||
. = ALIGN(align); \
|
||||
Z_LINK_ITERABLE(struct_type);
|
||||
|
||||
#define Z_LINK_ITERABLE_GC_ALLOWED(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
*(SORT_BY_NAME(._##struct_type.static.*)); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
/**
|
||||
* @brief Define a read-only iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-only data.
|
||||
*
|
||||
* Note that this keeps the symbols in the image even though
|
||||
* they are not being directly referenced. Use this when symbols
|
||||
* are indirectly referenced by iterating through the section.
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE(struct_type); \
|
||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-only iterable section output, sorted numerically.
|
||||
*
|
||||
* This version of ITERABLE_SECTION_ROM() sorts the entries numerically, that
|
||||
* is, `SECNAME_10` will come after `SECNAME_2`. `_` separator is required, and
|
||||
* up to 2 numeric digits are handled (0-99).
|
||||
*
|
||||
* @see ITERABLE_SECTION_ROM()
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM_NUMERIC(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area, EMPTY, SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_NUMERIC(struct_type); \
|
||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a garbage collectable read-only iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-only data.
|
||||
*
|
||||
* Note that the symbols within the section can be garbage collected.
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM_GC_ALLOWED(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_GC_ALLOWED(struct_type); \
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-write iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-write data that is modified at runtime.
|
||||
*
|
||||
* Note that this keeps the symbols in the image even though
|
||||
* they are not being directly referenced. Use this when symbols
|
||||
* are indirectly referenced by iterating through the section.
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM(struct_type, subalign) \
|
||||
SECTION_DATA_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-write iterable section output, sorted numerically.
|
||||
*
|
||||
* This version of ITERABLE_SECTION_RAM() sorts the entries numerically, that
|
||||
* is, `SECNAME10` will come after `SECNAME2`. Up to 2 numeric digits are
|
||||
* handled (0-99).
|
||||
*
|
||||
* @see ITERABLE_SECTION_RAM()
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM_NUMERIC(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area, EMPTY, SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_NUMERIC(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a garbage collectable read-write iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-write data that is modified at runtime.
|
||||
*
|
||||
* Note that the symbols within the section can be garbage collected.
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM_GC_ALLOWED(struct_type, subalign) \
|
||||
SECTION_DATA_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_GC_ALLOWED(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/ /* end of struct_section_apis */
|
||||
|
||||
#endif /* INCLUDE_ZEPHYR_LINKER_ITERABLE_SECTIONS_H_ */
|
|
@ -37,142 +37,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef _LINKER
|
||||
|
||||
/**
|
||||
* @addtogroup iterable_section_apis
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define Z_LINK_ITERABLE(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
KEEP(*(SORT_BY_NAME(._##struct_type.static.*))); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
#define Z_LINK_ITERABLE_NUMERIC(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
KEEP(*(SORT(._##struct_type.static.*_?_*))); \
|
||||
KEEP(*(SORT(._##struct_type.static.*_??_*))); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
#define Z_LINK_ITERABLE_ALIGNED(struct_type, align) \
|
||||
. = ALIGN(align); \
|
||||
Z_LINK_ITERABLE(struct_type);
|
||||
|
||||
#define Z_LINK_ITERABLE_GC_ALLOWED(struct_type) \
|
||||
_CONCAT(_##struct_type, _list_start) = .; \
|
||||
*(SORT_BY_NAME(._##struct_type.static.*)); \
|
||||
_CONCAT(_##struct_type, _list_end) = .
|
||||
|
||||
/**
|
||||
* @brief Define a read-only iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-only data.
|
||||
*
|
||||
* Note that this keeps the symbols in the image even though
|
||||
* they are not being directly referenced. Use this when symbols
|
||||
* are indirectly referenced by iterating through the section.
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE(struct_type); \
|
||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-only iterable section output, sorted numerically.
|
||||
*
|
||||
* This version of ITERABLE_SECTION_ROM() sorts the entries numerically, that
|
||||
* is, `SECNAME_10` will come after `SECNAME_2`. `_` separator is required, and
|
||||
* up to 2 numeric digits are handled (0-99).
|
||||
*
|
||||
* @see ITERABLE_SECTION_ROM()
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM_NUMERIC(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area, EMPTY, SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_NUMERIC(struct_type); \
|
||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a garbage collectable read-only iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-only data.
|
||||
*
|
||||
* Note that the symbols within the section can be garbage collected.
|
||||
*/
|
||||
#define ITERABLE_SECTION_ROM_GC_ALLOWED(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_GC_ALLOWED(struct_type); \
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-write iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-write data that is modified at runtime.
|
||||
*
|
||||
* Note that this keeps the symbols in the image even though
|
||||
* they are not being directly referenced. Use this when symbols
|
||||
* are indirectly referenced by iterating through the section.
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM(struct_type, subalign) \
|
||||
SECTION_DATA_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a read-write iterable section output, sorted numerically.
|
||||
*
|
||||
* This version of ITERABLE_SECTION_RAM() sorts the entries numerically, that
|
||||
* is, `SECNAME10` will come after `SECNAME2`. Up to 2 numeric digits are
|
||||
* handled (0-99).
|
||||
*
|
||||
* @see ITERABLE_SECTION_RAM()
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM_NUMERIC(struct_type, subalign) \
|
||||
SECTION_PROLOGUE(struct_type##_area, EMPTY, SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_NUMERIC(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @brief Define a garbage collectable read-write iterable section output.
|
||||
*
|
||||
* @details
|
||||
* Define an output section which will set up an iterable area
|
||||
* of equally-sized data structures. For use with STRUCT_SECTION_ITERABLE().
|
||||
* Input sections will be sorted by name, per ld's SORT_BY_NAME.
|
||||
*
|
||||
* This macro should be used for read-write data that is modified at runtime.
|
||||
*
|
||||
* Note that the symbols within the section can be garbage collected.
|
||||
*/
|
||||
#define ITERABLE_SECTION_RAM_GC_ALLOWED(struct_type, subalign) \
|
||||
SECTION_DATA_PROLOGUE(struct_type##_area,,SUBALIGN(subalign)) \
|
||||
{ \
|
||||
Z_LINK_ITERABLE_GC_ALLOWED(struct_type); \
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/ /* end of struct_section_apis */
|
||||
|
||||
/*
|
||||
* generate a symbol to mark the start of the objects array for
|
||||
* the specified object and level, then link all of those objects
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <zephyr/logging/log_instance.h>
|
||||
#include <zephyr/logging/log_core.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/logging/log_output.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_
|
||||
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log_msg.h>
|
||||
#include <zephyr/logging/log_internal.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/sys/mpsc_packet.h>
|
||||
#include <zephyr/sys/cbprintf.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <stdint.h>
|
||||
#include <zephyr/mgmt/ec_host_cmd/backend.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
struct ec_host_cmd {
|
||||
struct ec_host_cmd_rx_ctx rx_ctx;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/util_macro.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <zephyr/types.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define ZEPHYR_INCLUDE_NET_ETHERNET_BRIDGE_H_
|
||||
|
||||
#include <zephyr/sys/slist.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/net_core.h>
|
||||
#include <zephyr/net/hostname.h>
|
||||
#include <zephyr/net/net_linkaddr.h>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <zephyr/device.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/net/capture.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <zephyr/net/net_ip.h>
|
||||
#include <zephyr/net/dns_resolve.h>
|
||||
#include <zephyr/net/socket_select.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/device.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/mem_blocks.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <zephyr/shell/shell_string_conv.h>
|
||||
#include <zephyr/logging/log_instance.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
#if defined CONFIG_SHELL_GETOPT
|
||||
|
|
291
include/zephyr/sys/iterable_sections.h
Normal file
291
include/zephyr/sys/iterable_sections.h
Normal file
|
@ -0,0 +1,291 @@
|
|||
/*
|
||||
* Copyright (C) 2020, Intel Corporation
|
||||
* Copyright (C) 2023, Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_
|
||||
#define INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_
|
||||
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Iterable Sections APIs
|
||||
* @defgroup iterable_section_apis Iterable Sections APIs
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section for a generic type.
|
||||
*
|
||||
* @details
|
||||
* Convenience helper combining __in_section() and Z_DECL_ALIGN().
|
||||
* The section name will be '.[SECNAME].static.[SECTION_POSTFIX]'
|
||||
*
|
||||
* In the linker script, create output sections for these using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM().
|
||||
*
|
||||
* @note In order to store the element in ROM, a const specifier has to
|
||||
* be added to the declaration: const TYPE_SECTION_ITERABLE(...);
|
||||
*
|
||||
* @param[in] type data type of variable
|
||||
* @param[in] varname name of variable to place in section
|
||||
* @param[in] secname type name of iterable section.
|
||||
* @param[in] section_postfix postfix to use in section name
|
||||
*/
|
||||
#define TYPE_SECTION_ITERABLE(type, varname, secname, section_postfix) \
|
||||
Z_DECL_ALIGN(type) varname \
|
||||
__in_section(_##secname, static, _CONCAT(section_postfix, _)) __used __noasan
|
||||
|
||||
/**
|
||||
* @brief iterable section start symbol for a generic type
|
||||
*
|
||||
* will return '_[OUT_TYPE]_list_start'.
|
||||
*
|
||||
* @param[in] secname type name of iterable section. For 'struct foobar' this
|
||||
* would be TYPE_SECTION_START(foobar)
|
||||
*
|
||||
*/
|
||||
#define TYPE_SECTION_START(secname) _CONCAT(_##secname, _list_start)
|
||||
|
||||
/**
|
||||
* @brief iterable section end symbol for a generic type
|
||||
*
|
||||
* will return '_<SECNAME>_list_end'.
|
||||
*
|
||||
* @param[in] secname type name of iterable section. For 'struct foobar' this
|
||||
* would be TYPE_SECTION_START(foobar)
|
||||
*/
|
||||
#define TYPE_SECTION_END(secname) _CONCAT(_##secname, _list_end)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for start symbol for a generic type
|
||||
*
|
||||
* Helper macro to give extern for start of iterable section. The macro
|
||||
* typically will be called TYPE_SECTION_START_EXTERN(struct foobar, foobar).
|
||||
* This allows the macro to hand different types as well as cases where the
|
||||
* type and section name may differ.
|
||||
*
|
||||
* @param[in] type data type of section
|
||||
* @param[in] secname name of output section
|
||||
*/
|
||||
#define TYPE_SECTION_START_EXTERN(type, secname) \
|
||||
extern type TYPE_SECTION_START(secname)[]
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for end symbol for a generic type
|
||||
*
|
||||
* Helper macro to give extern for end of iterable section. The macro
|
||||
* typically will be called TYPE_SECTION_END_EXTERN(struct foobar, foobar).
|
||||
* This allows the macro to hand different types as well as cases where the
|
||||
* type and section name may differ.
|
||||
*
|
||||
* @param[in] type data type of section
|
||||
* @param[in] secname name of output section
|
||||
*/
|
||||
#define TYPE_SECTION_END_EXTERN(type, secname) \
|
||||
extern type TYPE_SECTION_END(secname)[]
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section for a generic type
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by TYPE_SECTION_ITERABLE().
|
||||
* The linker must provide a _<SECNAME>_list_start symbol and a
|
||||
* _<SECNAME>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define TYPE_SECTION_FOREACH(type, secname, iterator) \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
TYPE_SECTION_END_EXTERN(type, secname); \
|
||||
for (type * iterator = TYPE_SECTION_START(secname); ({ \
|
||||
__ASSERT(iterator <= TYPE_SECTION_END(secname),\
|
||||
"unexpected list end location"); \
|
||||
iterator < TYPE_SECTION_END(secname); \
|
||||
}); \
|
||||
iterator++)
|
||||
|
||||
/**
|
||||
* @brief Get element from section for a generic type.
|
||||
*
|
||||
* @note There is no protection against reading beyond the section.
|
||||
*
|
||||
* @param[in] type type of element
|
||||
* @param[in] secname name of output section
|
||||
* @param[in] i Index.
|
||||
* @param[out] dst Pointer to location where pointer to element is written.
|
||||
*/
|
||||
#define TYPE_SECTION_GET(type, secname, i, dst) do { \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
*(dst) = &TYPE_SECTION_START(secname)[i]; \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief Count elements in a section for a generic type.
|
||||
*
|
||||
* @param[in] type type of element
|
||||
* @param[in] secname name of output section
|
||||
* @param[out] dst Pointer to location where result is written.
|
||||
*/
|
||||
#define TYPE_SECTION_COUNT(type, secname, dst) do { \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
TYPE_SECTION_END_EXTERN(type, secname); \
|
||||
*(dst) = ((uintptr_t)TYPE_SECTION_END(secname) - \
|
||||
(uintptr_t)TYPE_SECTION_START(secname)) / sizeof(type); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief iterable section start symbol for a struct type
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_START(struct_type) \
|
||||
TYPE_SECTION_START(struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for start symbol for a struct
|
||||
*
|
||||
* Helper macro to give extern for start of iterable section.
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_START_EXTERN(struct_type) \
|
||||
TYPE_SECTION_START_EXTERN(struct struct_type, struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section end symbol for a struct type
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_END(struct_type) \
|
||||
TYPE_SECTION_END(struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for end symbol for a struct
|
||||
*
|
||||
* Helper macro to give extern for end of iterable section.
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_END_EXTERN(struct_type) \
|
||||
TYPE_SECTION_END_EXTERN(struct struct_type, struct_type)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element of alternate data type for an iterable section.
|
||||
*
|
||||
* @details
|
||||
* Special variant of STRUCT_SECTION_ITERABLE(), for placing alternate
|
||||
* data types within the iterable section of a specific data type. The
|
||||
* data type sizes and semantics must be equivalent!
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ALTERNATE(secname, struct_type, varname) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname, secname, varname)
|
||||
|
||||
/**
|
||||
* @brief Defines an array of elements of alternate data type for an iterable
|
||||
* section.
|
||||
*
|
||||
* @see STRUCT_SECTION_ITERABLE_ALTERNATE
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(secname, struct_type, varname, \
|
||||
size) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname[size], secname, \
|
||||
varname)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section.
|
||||
*
|
||||
* @details
|
||||
* Convenience helper combining __in_section() and Z_DECL_ALIGN().
|
||||
* The section name is the struct type prepended with an underscore.
|
||||
* The subsection is "static" and the subsubsection is the variable name.
|
||||
*
|
||||
* In the linker script, create output sections for these using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM().
|
||||
*
|
||||
* @note In order to store the element in ROM, a const specifier has to
|
||||
* be added to the declaration: const STRUCT_SECTION_ITERABLE(...);
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE(struct_type, varname) \
|
||||
STRUCT_SECTION_ITERABLE_ALTERNATE(struct_type, struct_type, varname)
|
||||
|
||||
/**
|
||||
* @brief Defines an array of elements for an iterable section.
|
||||
*
|
||||
* @see STRUCT_SECTION_ITERABLE
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ARRAY(struct_type, varname, size) \
|
||||
STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(struct_type, struct_type, \
|
||||
varname, size)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section with a custom name.
|
||||
*
|
||||
* The name can be used to customize how iterable section entries are sorted.
|
||||
* @see STRUCT_SECTION_ITERABLE()
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_NAMED(struct_type, name, varname) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname, struct_type, name)
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section (alternate).
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by STRUCT_SECTION_ITERABLE().
|
||||
* The linker must provide a _<SECNAME>_list_start symbol and a
|
||||
* _<SECNAME>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define STRUCT_SECTION_FOREACH_ALTERNATE(secname, struct_type, iterator) \
|
||||
TYPE_SECTION_FOREACH(struct struct_type, secname, iterator)
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section.
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by STRUCT_SECTION_ITERABLE().
|
||||
* The linker must provide a _<struct_type>_list_start symbol and a
|
||||
* _<struct_type>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define STRUCT_SECTION_FOREACH(struct_type, iterator) \
|
||||
STRUCT_SECTION_FOREACH_ALTERNATE(struct_type, struct_type, iterator)
|
||||
|
||||
/**
|
||||
* @brief Get element from section.
|
||||
*
|
||||
* @note There is no protection against reading beyond the section.
|
||||
*
|
||||
* @param[in] struct_type Struct type.
|
||||
* @param[in] i Index.
|
||||
* @param[out] dst Pointer to location where pointer to element is written.
|
||||
*/
|
||||
#define STRUCT_SECTION_GET(struct_type, i, dst) \
|
||||
TYPE_SECTION_GET(struct struct_type, struct_type, i, dst)
|
||||
|
||||
/**
|
||||
* @brief Count elements in a section.
|
||||
*
|
||||
* @param[in] struct_type Struct type
|
||||
* @param[out] dst Pointer to location where result is written.
|
||||
*/
|
||||
#define STRUCT_SECTION_COUNT(struct_type, dst) \
|
||||
TYPE_SECTION_COUNT(struct struct_type, struct_type, dst);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/ /* end of struct_section_apis */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_ */
|
|
@ -9,6 +9,8 @@
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define ZEPHYR_INCLUDE_SYS_P4WQ_H_
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/* Zephyr Pooled Parallel Preemptible Priority-based Work Queues */
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/types.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -195,276 +195,6 @@
|
|||
/* Check if a pointer is aligned enough for a particular data type. */
|
||||
#define IS_PTR_ALIGNED(ptr, type) IS_PTR_ALIGNED_BYTES(ptr, __alignof(type))
|
||||
|
||||
/**
|
||||
* @brief Iterable Sections APIs
|
||||
* @defgroup iterable_section_apis Iterable Sections APIs
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section for a generic type.
|
||||
*
|
||||
* @details
|
||||
* Convenience helper combining __in_section() and Z_DECL_ALIGN().
|
||||
* The section name will be '.[SECNAME].static.[SECTION_POSTFIX]'
|
||||
*
|
||||
* In the linker script, create output sections for these using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM().
|
||||
*
|
||||
* @note In order to store the element in ROM, a const specifier has to
|
||||
* be added to the declaration: const TYPE_SECTION_ITERABLE(...);
|
||||
*
|
||||
* @param[in] type data type of variable
|
||||
* @param[in] varname name of variable to place in section
|
||||
* @param[in] secname type name of iterable section.
|
||||
* @param[in] section_postfix postfix to use in section name
|
||||
*/
|
||||
#define TYPE_SECTION_ITERABLE(type, varname, secname, section_postfix) \
|
||||
Z_DECL_ALIGN(type) varname \
|
||||
__in_section(_##secname, static, _CONCAT(section_postfix, _)) __used __noasan
|
||||
|
||||
/**
|
||||
* @brief iterable section start symbol for a generic type
|
||||
*
|
||||
* will return '_[OUT_TYPE]_list_start'.
|
||||
*
|
||||
* @param[in] secname type name of iterable section. For 'struct foobar' this
|
||||
* would be TYPE_SECTION_START(foobar)
|
||||
*
|
||||
*/
|
||||
#define TYPE_SECTION_START(secname) _CONCAT(_##secname, _list_start)
|
||||
|
||||
/**
|
||||
* @brief iterable section end symbol for a generic type
|
||||
*
|
||||
* will return '_<SECNAME>_list_end'.
|
||||
*
|
||||
* @param[in] secname type name of iterable section. For 'struct foobar' this
|
||||
* would be TYPE_SECTION_START(foobar)
|
||||
*/
|
||||
#define TYPE_SECTION_END(secname) _CONCAT(_##secname, _list_end)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for start symbol for a generic type
|
||||
*
|
||||
* Helper macro to give extern for start of iterable section. The macro
|
||||
* typically will be called TYPE_SECTION_START_EXTERN(struct foobar, foobar).
|
||||
* This allows the macro to hand different types as well as cases where the
|
||||
* type and section name may differ.
|
||||
*
|
||||
* @param[in] type data type of section
|
||||
* @param[in] secname name of output section
|
||||
*/
|
||||
#define TYPE_SECTION_START_EXTERN(type, secname) \
|
||||
extern type TYPE_SECTION_START(secname)[]
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for end symbol for a generic type
|
||||
*
|
||||
* Helper macro to give extern for end of iterable section. The macro
|
||||
* typically will be called TYPE_SECTION_END_EXTERN(struct foobar, foobar).
|
||||
* This allows the macro to hand different types as well as cases where the
|
||||
* type and section name may differ.
|
||||
*
|
||||
* @param[in] type data type of section
|
||||
* @param[in] secname name of output section
|
||||
*/
|
||||
#define TYPE_SECTION_END_EXTERN(type, secname) \
|
||||
extern type TYPE_SECTION_END(secname)[]
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section for a generic type
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by TYPE_SECTION_ITERABLE().
|
||||
* The linker must provide a _<SECNAME>_list_start symbol and a
|
||||
* _<SECNAME>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define TYPE_SECTION_FOREACH(type, secname, iterator) \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
TYPE_SECTION_END_EXTERN(type, secname); \
|
||||
for (type * iterator = TYPE_SECTION_START(secname); ({ \
|
||||
__ASSERT(iterator <= TYPE_SECTION_END(secname),\
|
||||
"unexpected list end location"); \
|
||||
iterator < TYPE_SECTION_END(secname); \
|
||||
}); \
|
||||
iterator++)
|
||||
|
||||
/**
|
||||
* @brief Get element from section for a generic type.
|
||||
*
|
||||
* @note There is no protection against reading beyond the section.
|
||||
*
|
||||
* @param[in] type type of element
|
||||
* @param[in] secname name of output section
|
||||
* @param[in] i Index.
|
||||
* @param[out] dst Pointer to location where pointer to element is written.
|
||||
*/
|
||||
#define TYPE_SECTION_GET(type, secname, i, dst) do { \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
*(dst) = &TYPE_SECTION_START(secname)[i]; \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief Count elements in a section for a generic type.
|
||||
*
|
||||
* @param[in] type type of element
|
||||
* @param[in] secname name of output section
|
||||
* @param[out] dst Pointer to location where result is written.
|
||||
*/
|
||||
#define TYPE_SECTION_COUNT(type, secname, dst) do { \
|
||||
TYPE_SECTION_START_EXTERN(type, secname); \
|
||||
TYPE_SECTION_END_EXTERN(type, secname); \
|
||||
*(dst) = ((uintptr_t)TYPE_SECTION_END(secname) - \
|
||||
(uintptr_t)TYPE_SECTION_START(secname)) / sizeof(type); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief iterable section start symbol for a struct type
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_START(struct_type) \
|
||||
TYPE_SECTION_START(struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for start symbol for a struct
|
||||
*
|
||||
* Helper macro to give extern for start of iterable section.
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_START_EXTERN(struct_type) \
|
||||
TYPE_SECTION_START_EXTERN(struct struct_type, struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section end symbol for a struct type
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_END(struct_type) \
|
||||
TYPE_SECTION_END(struct_type)
|
||||
|
||||
/**
|
||||
* @brief iterable section extern for end symbol for a struct
|
||||
*
|
||||
* Helper macro to give extern for end of iterable section.
|
||||
*
|
||||
* @param[in] struct_type data type of section
|
||||
*/
|
||||
#define STRUCT_SECTION_END_EXTERN(struct_type) \
|
||||
TYPE_SECTION_END_EXTERN(struct struct_type, struct_type)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element of alternate data type for an iterable section.
|
||||
*
|
||||
* @details
|
||||
* Special variant of STRUCT_SECTION_ITERABLE(), for placing alternate
|
||||
* data types within the iterable section of a specific data type. The
|
||||
* data type sizes and semantics must be equivalent!
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ALTERNATE(secname, struct_type, varname) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname, secname, varname)
|
||||
|
||||
/**
|
||||
* @brief Defines an array of elements of alternate data type for an iterable
|
||||
* section.
|
||||
*
|
||||
* @see STRUCT_SECTION_ITERABLE_ALTERNATE
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(secname, struct_type, varname, \
|
||||
size) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname[size], secname, \
|
||||
varname)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section.
|
||||
*
|
||||
* @details
|
||||
* Convenience helper combining __in_section() and Z_DECL_ALIGN().
|
||||
* The section name is the struct type prepended with an underscore.
|
||||
* The subsection is "static" and the subsubsection is the variable name.
|
||||
*
|
||||
* In the linker script, create output sections for these using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM().
|
||||
*
|
||||
* @note In order to store the element in ROM, a const specifier has to
|
||||
* be added to the declaration: const STRUCT_SECTION_ITERABLE(...);
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE(struct_type, varname) \
|
||||
STRUCT_SECTION_ITERABLE_ALTERNATE(struct_type, struct_type, varname)
|
||||
|
||||
/**
|
||||
* @brief Defines an array of elements for an iterable section.
|
||||
*
|
||||
* @see STRUCT_SECTION_ITERABLE
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_ARRAY(struct_type, varname, size) \
|
||||
STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(struct_type, struct_type, \
|
||||
varname, size)
|
||||
|
||||
/**
|
||||
* @brief Defines a new element for an iterable section with a custom name.
|
||||
*
|
||||
* The name can be used to customize how iterable section entries are sorted.
|
||||
* @see STRUCT_SECTION_ITERABLE()
|
||||
*/
|
||||
#define STRUCT_SECTION_ITERABLE_NAMED(struct_type, name, varname) \
|
||||
TYPE_SECTION_ITERABLE(struct struct_type, varname, struct_type, name)
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section (alternate).
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by STRUCT_SECTION_ITERABLE().
|
||||
* The linker must provide a _<SECNAME>_list_start symbol and a
|
||||
* _<SECNAME>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define STRUCT_SECTION_FOREACH_ALTERNATE(secname, struct_type, iterator) \
|
||||
TYPE_SECTION_FOREACH(struct struct_type, secname, iterator)
|
||||
|
||||
/**
|
||||
* @brief Iterate over a specified iterable section.
|
||||
*
|
||||
* @details
|
||||
* Iterator for structure instances gathered by STRUCT_SECTION_ITERABLE().
|
||||
* The linker must provide a _<struct_type>_list_start symbol and a
|
||||
* _<struct_type>_list_end symbol to mark the start and the end of the
|
||||
* list of struct objects to iterate over. This is normally done using
|
||||
* ITERABLE_SECTION_ROM() or ITERABLE_SECTION_RAM() in the linker script.
|
||||
*/
|
||||
#define STRUCT_SECTION_FOREACH(struct_type, iterator) \
|
||||
STRUCT_SECTION_FOREACH_ALTERNATE(struct_type, struct_type, iterator)
|
||||
|
||||
/**
|
||||
* @brief Get element from section.
|
||||
*
|
||||
* @note There is no protection against reading beyond the section.
|
||||
*
|
||||
* @param[in] struct_type Struct type.
|
||||
* @param[in] i Index.
|
||||
* @param[out] dst Pointer to location where pointer to element is written.
|
||||
*/
|
||||
#define STRUCT_SECTION_GET(struct_type, i, dst) \
|
||||
TYPE_SECTION_GET(struct struct_type, struct_type, i, dst)
|
||||
|
||||
/**
|
||||
* @brief Count elements in a section.
|
||||
*
|
||||
* @param[in] struct_type Struct type
|
||||
* @param[out] dst Pointer to location where result is written.
|
||||
*/
|
||||
#define STRUCT_SECTION_COUNT(struct_type, dst) \
|
||||
TYPE_SECTION_COUNT(struct struct_type, struct_type, dst);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/ /* end of struct_section_apis */
|
||||
|
||||
/** @brief Tag a symbol (e.g. function) to be kept in the binary even though it is not used.
|
||||
*
|
||||
* It prevents symbol from being removed by the linker garbage collector. It
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
* Header exposes API for registering LUNs.
|
||||
*/
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifndef ZEPHYR_INCLUDE_USB_CLASS_USBD_MSC_H_
|
||||
#define ZEPHYR_INCLUDE_USB_CLASS_USBD_MSC_H_
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <zephyr/drivers/usb/usb_dc.h>
|
||||
#include <zephyr/usb/usb_ch9.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/drivers/usb/uhc.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <string.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/kobject.h>
|
||||
#include <zephyr/syscall_handler.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <zephyr/wait_q.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
void k_heap_init(struct k_heap *h, void *mem, size_t bytes)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <ksched.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/check.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* @brief Initialize kernel memory slab subsystem.
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <zephyr/random/rand32.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||
|
||||
#ifdef CONFIG_THREAD_MONITOR
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <zephyr/kernel.h>
|
||||
#include <ksched.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
LOG_MODULE_REGISTER(p4wq, CONFIG_LOG_DEFAULT_LEVEL);
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
*/
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/shell/shell.h>
|
||||
#if CONFIG_SHELL_GETOPT
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
/* Referring below variables is not thread safe. They reflects getopt state
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <zephyr/drivers/sensor.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
LOG_MODULE_REGISTER(app);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/check.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/util_macro.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/check.h>
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <errno.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
#include <zephyr/bluetooth/hci.h>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include <zephyr/bluetooth/l2cap.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
enum l2cap_conn_list_action {
|
||||
BT_L2CAP_CHAN_LOOKUP,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/debug/stack.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/hci.h>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <zephyr/bluetooth/mesh.h>
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "mesh.h"
|
||||
#include "net.h"
|
||||
#include "app_keys.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <errno.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <stdint.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/mesh.h>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <zephyr/bluetooth/mesh.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "net.h"
|
||||
#include "rpl.h"
|
||||
#include "access.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <stdint.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/mesh.h>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#define BT_MESH_KEY_PRIMARY 0x0000
|
||||
|
||||
enum bt_mesh_key_evt {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/bluetooth/bluetooth.h>
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <zephyr/net/buf.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#define BT_MESH_NET_FLAG_KR BIT(0)
|
||||
#define BT_MESH_NET_FLAG_IVU BIT(1)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <zephyr/bluetooth/gatt.h>
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
#include <zephyr/bluetooth/services/ias.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#define LOG_LEVEL CONFIG_BT_IAS_LOG_LEVEL
|
||||
LOG_MODULE_REGISTER(ias);
|
||||
|
|
|
@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(emul);
|
|||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/emul.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <string.h>
|
||||
|
||||
const struct emul *emul_get_binding(const char *name)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <zephyr/input/input.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
LOG_MODULE_REGISTER(input, CONFIG_INPUT_LOG_LEVEL);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <zephyr/logging/log_ctrl.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/logging/log_internal.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef int (*log_backend_cmd_t)(const struct shell *sh,
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/atomic.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <ctype.h>
|
||||
#include <zephyr/logging/log_frontend.h>
|
||||
#include <zephyr/syscall_handler.h>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <zephyr/init.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/logging/log_link.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "log_cache.h"
|
||||
|
||||
LOG_MODULE_REGISTER(log_mgmt);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/mgmt/ec_host_cmd/ec_host_cmd.h>
|
||||
#include <zephyr/mgmt/ec_host_cmd/backend.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <string.h>
|
||||
|
||||
LOG_MODULE_REGISTER(host_cmd_handler, CONFIG_EC_HC_LOG_LEVEL);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/device.h>
|
||||
#include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
|
||||
#include <zephyr/mgmt/mcumgr/mgmt/handlers.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS
|
||||
|
|
|
@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(conn_mgr, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL);
|
|||
#include <zephyr/net/net_core.h>
|
||||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/net_mgmt.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/conn_mgr_connectivity.h>
|
||||
#include "conn_mgr_private.h"
|
||||
|
||||
|
|
|
@ -4,4 +4,6 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/linker/iterable_sections.h>
|
||||
|
||||
ITERABLE_SECTION_RAM(conn_mgr_conn_binding, 4)
|
||||
|
|
|
@ -9,6 +9,8 @@ LOG_MODULE_REGISTER(conn_mgr_conn, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL);
|
|||
|
||||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/conn_mgr_connectivity.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "conn_mgr_private.h"
|
||||
|
||||
int conn_mgr_if_connect(struct net_if *iface)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#define __CONN_MGR_PRV_H__
|
||||
|
||||
#include <zephyr/net/conn_mgr_connectivity.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#if defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4)
|
||||
#define CONN_MGR_IFACE_MAX MAX(CONFIG_NET_IF_MAX_IPV6_COUNT, \
|
||||
|
|
|
@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_if, CONFIG_NET_IF_LOG_LEVEL);
|
|||
#include <zephyr/net/net_mgmt.h>
|
||||
#include <zephyr/net/ethernet.h>
|
||||
#include <zephyr/net/virtual.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "net_private.h"
|
||||
#include "ipv4.h"
|
||||
|
|
|
@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(net_eth_bridge, CONFIG_NET_ETHERNET_BRIDGE_LOG_LEVEL);
|
|||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/ethernet.h>
|
||||
#include <zephyr/net/ethernet_bridge.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/sys/slist.h>
|
||||
|
||||
#include "bridge.h"
|
||||
|
|
|
@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
|
|||
|
||||
#include <zephyr/net/net_core.h>
|
||||
#include <zephyr/net/net_pkt.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/ppp.h>
|
||||
|
||||
#include "net_private.h"
|
||||
|
|
|
@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
|
|||
|
||||
#include <zephyr/net/net_core.h>
|
||||
#include <zephyr/net/net_pkt.h>
|
||||
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
#include <zephyr/net/ppp.h>
|
||||
|
||||
#include "net_private.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include <zephyr/net/ppp.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
/**
|
||||
* FSM flags that control how it operates.
|
||||
|
|
|
@ -13,8 +13,8 @@ LOG_MODULE_REGISTER(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
|
|||
#include <zephyr/net/net_if.h>
|
||||
#include <zephyr/net/net_pkt.h>
|
||||
#include <zephyr/net/net_mgmt.h>
|
||||
|
||||
#include <zephyr/net/ppp.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "net_private.h"
|
||||
#include "ipv4_autoconf_internal.h"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <zephyr/net/dns_sd.h>
|
||||
#include <zephyr/net/net_ip.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "dns_pack.h"
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/net/socket.h>
|
||||
#include <zephyr/sys/iterable_sections.h>
|
||||
|
||||
#include "sockets_internal.h"
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue