Browse Source

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>
pull/58130/head
Gerard Marull-Paretas 2 years ago committed by Carles Cufí
parent
commit
dacb3dbfeb
  1. 1
      arch/x86/core/intel64/irq.c
  2. 2
      boards/arm/ip_k66f/linker.ld
  3. 1
      drivers/console/uart_mux.c
  4. 1
      drivers/pcie/host/pcie.c
  5. 1
      drivers/sensor/sensor_shell.c
  6. 1
      drivers/usb/uvb/uvb.c
  7. 2
      drivers/usb/uvb/uvb.h
  8. 7
      include/zephyr/arch/x86/intel64/arch.h
  9. 1
      include/zephyr/bluetooth/conn.h
  10. 1
      include/zephyr/bluetooth/gatt.h
  11. 1
      include/zephyr/bluetooth/mesh/heartbeat.h
  12. 1
      include/zephyr/bluetooth/mesh/main.h
  13. 1
      include/zephyr/bluetooth/mesh/proxy.h
  14. 1
      include/zephyr/bluetooth/services/ias.h
  15. 1
      include/zephyr/device.h
  16. 1
      include/zephyr/display/cfb.h
  17. 1
      include/zephyr/drivers/emul.h
  18. 1
      include/zephyr/drivers/pcie/pcie.h
  19. 1
      include/zephyr/drivers/sensor.h
  20. 1
      include/zephyr/input/input.h
  21. 1
      include/zephyr/kernel.h
  22. 2
      include/zephyr/linker/common-ram.ld
  23. 2
      include/zephyr/linker/common-rom/common-rom-bt.ld
  24. 2
      include/zephyr/linker/common-rom/common-rom-debug.ld
  25. 2
      include/zephyr/linker/common-rom/common-rom-kernel-devices.ld
  26. 2
      include/zephyr/linker/common-rom/common-rom-logging.ld
  27. 2
      include/zephyr/linker/common-rom/common-rom-misc.ld
  28. 2
      include/zephyr/linker/common-rom/common-rom-net.ld
  29. 145
      include/zephyr/linker/iterable_sections.h
  30. 136
      include/zephyr/linker/linker-defs.h
  31. 1
      include/zephyr/logging/log.h
  32. 1
      include/zephyr/logging/log_backend.h
  33. 1
      include/zephyr/logging/log_instance.h
  34. 1
      include/zephyr/logging/log_link.h
  35. 1
      include/zephyr/logging/log_msg.h
  36. 1
      include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h
  37. 1
      include/zephyr/mgmt/mcumgr/mgmt/handlers.h
  38. 1
      include/zephyr/net/buf.h
  39. 1
      include/zephyr/net/conn_mgr_connectivity.h
  40. 1
      include/zephyr/net/ethernet_bridge.h
  41. 2
      include/zephyr/net/http/service.h
  42. 2
      include/zephyr/net/net_if.h
  43. 1
      include/zephyr/net/net_l2.h
  44. 1
      include/zephyr/net/socket.h
  45. 1
      include/zephyr/pm/device.h
  46. 1
      include/zephyr/rtio/rtio.h
  47. 1
      include/zephyr/settings/settings.h
  48. 1
      include/zephyr/shell/shell.h
  49. 291
      include/zephyr/sys/iterable_sections.h
  50. 2
      include/zephyr/sys/kobject.h
  51. 1
      include/zephyr/sys/p4wq.h
  52. 1
      include/zephyr/sys/sem.h
  53. 270
      include/zephyr/toolchain/common.h
  54. 2
      include/zephyr/usb/class/usbd_msc.h
  55. 1
      include/zephyr/usb/usb_device.h
  56. 1
      include/zephyr/usb/usbd.h
  57. 2
      include/zephyr/usb/usbh.h
  58. 1
      include/zephyr/zbus/zbus.h
  59. 1
      kernel/device.c
  60. 1
      kernel/kheap.c
  61. 1
      kernel/mem_slab.c
  62. 2
      kernel/thread.c
  63. 1
      lib/os/p4wq.c
  64. 4
      lib/posix/getopt/getopt_common.c
  65. 1
      samples/sensor/sensor_shell/src/main.c
  66. 1
      subsys/bluetooth/host/conn.c
  67. 1
      subsys/bluetooth/host/gatt.c
  68. 1
      subsys/bluetooth/host/l2cap.c
  69. 1
      subsys/bluetooth/host/l2cap_br.c
  70. 1
      subsys/bluetooth/host/l2cap_internal.h
  71. 2
      subsys/bluetooth/mesh/adv_ext.c
  72. 2
      subsys/bluetooth/mesh/app_keys.c
  73. 2
      subsys/bluetooth/mesh/beacon.c
  74. 2
      subsys/bluetooth/mesh/friend.c
  75. 2
      subsys/bluetooth/mesh/heartbeat.c
  76. 2
      subsys/bluetooth/mesh/lpn.c
  77. 2
      subsys/bluetooth/mesh/mesh.h
  78. 2
      subsys/bluetooth/mesh/proxy_srv.c
  79. 2
      subsys/bluetooth/mesh/subnet.c
  80. 1
      subsys/bluetooth/mesh/subnet.h
  81. 1
      subsys/bluetooth/services/ias/ias.c
  82. 1
      subsys/emul/emul.c
  83. 1
      subsys/input/input.c
  84. 1
      subsys/logging/log_cmds.c
  85. 1
      subsys/logging/log_core.c
  86. 2
      subsys/logging/log_mgmt.c
  87. 1
      subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c
  88. 1
      subsys/mgmt/mcumgr/mgmt/src/mgmt.c
  89. 2
      subsys/net/conn_mgr/conn_mgr.c
  90. 2
      subsys/net/conn_mgr/conn_mgr.ld
  91. 2
      subsys/net/conn_mgr/conn_mgr_connectivity.c
  92. 1
      subsys/net/conn_mgr/conn_mgr_private.h
  93. 1
      subsys/net/ip/net_if.c
  94. 2
      subsys/net/l2/ethernet/bridge.c
  95. 2
      subsys/net/l2/ppp/link.c
  96. 2
      subsys/net/l2/ppp/network.c
  97. 1
      subsys/net/l2/ppp/ppp_internal.h
  98. 2
      subsys/net/l2/ppp/ppp_l2.c
  99. 1
      subsys/net/lib/dns/dns_sd.h
  100. 1
      subsys/net/lib/sockets/socket_dispatcher.c
  101. Some files were not shown because too many files have changed in this diff Show More

1
arch/x86/core/intel64/irq.c

@ -12,6 +12,7 @@ @@ -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);

2
boards/arm/ip_k66f/linker.ld

@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/linker/iterable_sections.h>
/**
* @file
* @brief Linker command/script file

1
drivers/console/uart_mux.c

@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(uart_mux, CONFIG_UART_MUX_LOG_LEVEL); @@ -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"

1
drivers/pcie/host/pcie.c

@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(pcie, LOG_LEVEL_ERR); @@ -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>

1
drivers/sensor/sensor_shell.c

@ -10,6 +10,7 @@ @@ -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 " \

1
drivers/usb/uvb/uvb.c

@ -8,6 +8,7 @@ @@ -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"

2
drivers/usb/uvb/uvb.h

@ -12,9 +12,9 @@ @@ -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" {

7
include/zephyr/arch/x86/intel64/arch.h

@ -8,6 +8,9 @@ @@ -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 { @@ -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 { @@ -122,6 +123,8 @@ struct x86_ssf {
#define X86_RESERVE_IRQ(irq_p, name)
#endif
#endif /* _ASMLANGUAGE */
/*
* All Intel64 interrupts are dynamically connected.
*/

1
include/zephyr/bluetooth/conn.h

@ -25,6 +25,7 @@ @@ -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" {

1
include/zephyr/bluetooth/gatt.h

@ -27,6 +27,7 @@ @@ -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" {

1
include/zephyr/bluetooth/mesh/heartbeat.h

@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
#include <stdint.h>
#include <zephyr/sys/iterable_sections.h>
#include <zephyr/sys/slist.h>
/**

1
include/zephyr/bluetooth/mesh/main.h

@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/iterable_sections.h>
/**
* @brief Provisioning

1
include/zephyr/bluetooth/mesh/proxy.h

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/iterable_sections.h>
/**
* @brief Proxy

1
include/zephyr/bluetooth/services/ias.h

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
*/
#include <zephyr/bluetooth/conn.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {

1
include/zephyr/device.h

@ -13,6 +13,7 @@ @@ -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>

1
include/zephyr/display/cfb.h

@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
#include <zephyr/device.h>
#include <zephyr/drivers/display.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {

1
include/zephyr/drivers/emul.h

@ -26,6 +26,7 @@ struct emul; @@ -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.

1
include/zephyr/drivers/pcie/pcie.h

@ -12,6 +12,7 @@ @@ -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" {

1
include/zephyr/drivers/sensor.h

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include <zephyr/types.h>
#include <zephyr/device.h>
#include <zephyr/sys/iterable_sections.h>
#include <errno.h>
#ifdef __cplusplus

1
include/zephyr/input/input.h

@ -18,6 +18,7 @@ @@ -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" {

1
include/zephyr/kernel.h

@ -21,6 +21,7 @@ @@ -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" {

2
include/zephyr/linker/common-ram.ld

@ -1,5 +1,7 @@ @@ -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 \

2
include/zephyr/linker/common-rom/common-rom-bt.ld

@ -1,5 +1,7 @@ @@ -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)

2
include/zephyr/linker/common-rom/common-rom-debug.ld

@ -1,5 +1,7 @@ @@ -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,,)

2
include/zephyr/linker/common-rom/common-rom-kernel-devices.ld

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
#include <zephyr/linker/iterable_sections.h>
SECTION_PROLOGUE(initlevel,,)
{
/*

2
include/zephyr/linker/common-rom/common-rom-logging.ld

@ -1,5 +1,7 @@ @@ -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)

2
include/zephyr/linker/common-rom/common-rom-misc.ld

@ -1,5 +1,7 @@ @@ -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

2
include/zephyr/linker/common-rom/common-rom-net.ld

@ -1,5 +1,7 @@ @@ -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

@ -0,0 +1,145 @@ @@ -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_ */

136
include/zephyr/linker/linker-defs.h

@ -37,142 +37,6 @@ @@ -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

1
include/zephyr/logging/log.h

@ -9,6 +9,7 @@ @@ -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" {

1
include/zephyr/logging/log_backend.h

@ -11,6 +11,7 @@ @@ -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" {

1
include/zephyr/logging/log_instance.h

@ -7,6 +7,7 @@ @@ -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" {

1
include/zephyr/logging/log_link.h

@ -10,6 +10,7 @@ @@ -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" {

1
include/zephyr/logging/log_msg.h

@ -10,6 +10,7 @@ @@ -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>

1
include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h

@ -17,6 +17,7 @@ @@ -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;

1
include/zephyr/mgmt/mcumgr/mgmt/handlers.h

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {

1
include/zephyr/net/buf.h

@ -14,6 +14,7 @@ @@ -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" {

1
include/zephyr/net/conn_mgr_connectivity.h

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
#include <zephyr/device.h>
#include <zephyr/net/net_if.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {

1
include/zephyr/net/ethernet_bridge.h

@ -16,6 +16,7 @@ @@ -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" {

2
include/zephyr/net/http/service.h

@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
#include <stdint.h>
#include <stddef.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {
#endif

2
include/zephyr/net/net_if.h

@ -21,7 +21,7 @@ @@ -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>

1
include/zephyr/net/net_l2.h

@ -15,6 +15,7 @@ @@ -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" {

1
include/zephyr/net/socket.h

@ -27,6 +27,7 @@ @@ -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

1
include/zephyr/pm/device.h

@ -10,6 +10,7 @@ @@ -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" {

1
include/zephyr/rtio/rtio.h

@ -36,6 +36,7 @@ @@ -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" {

1
include/zephyr/settings/settings.h

@ -11,6 +11,7 @@ @@ -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

1
include/zephyr/shell/shell.h

@ -15,6 +15,7 @@ @@ -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

@ -0,0 +1,291 @@ @@ -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_ */

2
include/zephyr/sys/kobject.h

@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
#include <stdint.h>
#include <stddef.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {
#endif

1
include/zephyr/sys/p4wq.h

@ -7,6 +7,7 @@ @@ -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 */

1
include/zephyr/sys/sem.h

@ -22,6 +22,7 @@ @@ -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" {

270
include/zephyr/toolchain/common.h

@ -195,276 +195,6 @@ @@ -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

2
include/zephyr/usb/class/usbd_msc.h

@ -11,6 +11,8 @@ @@ -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_

1
include/zephyr/usb/usb_device.h

@ -41,6 +41,7 @@ @@ -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" {

1
include/zephyr/usb/usbd.h

@ -20,6 +20,7 @@ @@ -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" {

2
include/zephyr/usb/usbh.h

@ -19,7 +19,7 @@ @@ -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" {

1
include/zephyr/zbus/zbus.h

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/iterable_sections.h>
#ifdef __cplusplus
extern "C" {

1
kernel/device.c

@ -7,6 +7,7 @@ @@ -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>

1
kernel/kheap.c

@ -9,6 +9,7 @@ @@ -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)
{

1
kernel/mem_slab.c

@ -14,6 +14,7 @@ @@ -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.

2
kernel/thread.c

@ -29,6 +29,8 @@ @@ -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

1
lib/os/p4wq.c

@ -9,6 +9,7 @@ @@ -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);

4
lib/posix/getopt/getopt_common.c

@ -5,6 +5,10 @@ @@ -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

1
samples/sensor/sensor_shell/src/main.c

@ -8,6 +8,7 @@ @@ -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);

1
subsys/bluetooth/host/conn.c

@ -13,6 +13,7 @@ @@ -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>

1
subsys/bluetooth/host/gatt.c

@ -13,6 +13,7 @@ @@ -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>

1
subsys/bluetooth/host/l2cap.c

@ -10,6 +10,7 @@ @@ -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>

1
subsys/bluetooth/host/l2cap_br.c

@ -11,6 +11,7 @@ @@ -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>

1
subsys/bluetooth/host/l2cap_internal.h

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
*/
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/sys/iterable_sections.h>
enum l2cap_conn_list_action {
BT_L2CAP_CHAN_LOOKUP,

2
subsys/bluetooth/mesh/adv_ext.c

@ -8,7 +8,7 @@ @@ -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>

2
subsys/bluetooth/mesh/app_keys.c

@ -9,6 +9,8 @@ @@ -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"

2
subsys/bluetooth/mesh/beacon.c

@ -8,7 +8,7 @@ @@ -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>

2
subsys/bluetooth/mesh/friend.c

@ -7,7 +7,7 @@ @@ -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>

2
subsys/bluetooth/mesh/heartbeat.c

@ -4,6 +4,8 @@ @@ -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"

2
subsys/bluetooth/mesh/lpn.c

@ -7,7 +7,7 @@ @@ -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>

2
subsys/bluetooth/mesh/mesh.h

@ -4,6 +4,8 @@ @@ -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 {

2
subsys/bluetooth/mesh/proxy_srv.c

@ -7,7 +7,7 @@ @@ -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>

2
subsys/bluetooth/mesh/subnet.c

@ -13,7 +13,7 @@ @@ -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>

1
subsys/bluetooth/mesh/subnet.h

@ -11,6 +11,7 @@ @@ -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)

1
subsys/bluetooth/services/ias/ias.c

@ -17,6 +17,7 @@ @@ -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);

1
subsys/emul/emul.c

@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(emul); @@ -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)

1
subsys/input/input.c

@ -7,6 +7,7 @@ @@ -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);

1
subsys/logging/log_cmds.c

@ -8,6 +8,7 @@ @@ -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,

1
subsys/logging/log_core.c

@ -15,6 +15,7 @@ @@ -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>

2
subsys/logging/log_mgmt.c

@ -9,6 +9,8 @@ @@ -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);

1
subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c

@ -9,6 +9,7 @@ @@ -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);

1
subsys/mgmt/mcumgr/mgmt/src/mgmt.c

@ -10,6 +10,7 @@ @@ -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

2
subsys/net/conn_mgr/conn_mgr.c

@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(conn_mgr, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL); @@ -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"

2
subsys/net/conn_mgr/conn_mgr.ld

@ -4,4 +4,6 @@ @@ -4,4 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/linker/iterable_sections.h>
ITERABLE_SECTION_RAM(conn_mgr_conn_binding, 4)

2
subsys/net/conn_mgr/conn_mgr_connectivity.c

@ -9,6 +9,8 @@ LOG_MODULE_REGISTER(conn_mgr_conn, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL); @@ -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)

1
subsys/net/conn_mgr/conn_mgr_private.h

@ -8,6 +8,7 @@ @@ -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, \

1
subsys/net/ip/net_if.c

@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_if, CONFIG_NET_IF_LOG_LEVEL); @@ -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"

2
subsys/net/l2/ethernet/bridge.c

@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(net_eth_bridge, CONFIG_NET_ETHERNET_BRIDGE_LOG_LEVEL); @@ -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"

2
subsys/net/l2/ppp/link.c

@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); @@ -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"

2
subsys/net/l2/ppp/network.c

@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); @@ -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"

1
subsys/net/l2/ppp/ppp_internal.h

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
*/
#include <zephyr/net/ppp.h>
#include <zephyr/sys/iterable_sections.h>
/**
* FSM flags that control how it operates.

2
subsys/net/l2/ppp/ppp_l2.c

@ -13,8 +13,8 @@ LOG_MODULE_REGISTER(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); @@ -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"

1
subsys/net/lib/dns/dns_sd.h

@ -13,6 +13,7 @@ @@ -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"

1
subsys/net/lib/sockets/socket_dispatcher.c

@ -6,6 +6,7 @@ @@ -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…
Cancel
Save