diff --git a/arch/x86/core/intel64/irq.c b/arch/x86/core/intel64/irq.c index 65cbf3dd6b3..a7304271746 100644 --- a/arch/x86/core/intel64/irq.c +++ b/arch/x86/core/intel64/irq.c @@ -12,6 +12,7 @@ #include #include #include +#include #include LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); diff --git a/boards/arm/ip_k66f/linker.ld b/boards/arm/ip_k66f/linker.ld index 7d138ab4e7f..e1005cd32b7 100644 --- a/boards/arm/ip_k66f/linker.ld +++ b/boards/arm/ip_k66f/linker.ld @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + /** * @file * @brief Linker command/script file diff --git a/drivers/console/uart_mux.c b/drivers/console/uart_mux.c index eb4a46a1030..ba882b038ee 100644 --- a/drivers/console/uart_mux.c +++ b/drivers/console/uart_mux.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(uart_mux, CONFIG_UART_MUX_LOG_LEVEL); #include #include #include +#include #include "gsm_mux.h" diff --git a/drivers/pcie/host/pcie.c b/drivers/pcie/host/pcie.c index 266bc241e73..5f19d704bad 100644 --- a/drivers/pcie/host/pcie.c +++ b/drivers/pcie/host/pcie.c @@ -13,6 +13,7 @@ LOG_MODULE_REGISTER(pcie, LOG_LEVEL_ERR); #include #include #include +#include #if CONFIG_PCIE_MSI #include diff --git a/drivers/sensor/sensor_shell.c b/drivers/sensor/sensor_shell.c index 7366ec816c9..d6fe10065d7 100644 --- a/drivers/sensor/sensor_shell.c +++ b/drivers/sensor/sensor_shell.c @@ -10,6 +10,7 @@ #include #include #include +#include #define SENSOR_GET_HELP \ "Get sensor data. Channel names are optional. All channels are read " \ diff --git a/drivers/usb/uvb/uvb.c b/drivers/usb/uvb/uvb.c index d56c1fa88bb..b5901f654f2 100644 --- a/drivers/usb/uvb/uvb.c +++ b/drivers/usb/uvb/uvb.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "uvb.h" diff --git a/drivers/usb/uvb/uvb.h b/drivers/usb/uvb/uvb.h index 763ae5536af..a9fcfed816a 100644 --- a/drivers/usb/uvb/uvb.h +++ b/drivers/usb/uvb/uvb.h @@ -12,9 +12,9 @@ #ifndef ZEPHYR_INCLUDE_UVB #define ZEPHYR_INCLUDE_UVB -#include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/arch/x86/intel64/arch.h b/include/zephyr/arch/x86/intel64/arch.h index 1b81aaac715..c176e4e0bb0 100644 --- a/include/zephyr/arch/x86/intel64/arch.h +++ b/include/zephyr/arch/x86/intel64/arch.h @@ -8,6 +8,9 @@ #include #include +#if defined(CONFIG_PCIE) && !defined(_ASMLANGUAGE) +#include +#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. */ diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 1ee7cda5f17..e7258fbcf77 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index cec5a9b87ad..940416cceb6 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/bluetooth/mesh/heartbeat.h b/include/zephyr/bluetooth/mesh/heartbeat.h index 597c39800ce..d30a9f5e0ca 100644 --- a/include/zephyr/bluetooth/mesh/heartbeat.h +++ b/include/zephyr/bluetooth/mesh/heartbeat.h @@ -12,6 +12,7 @@ #include +#include #include /** diff --git a/include/zephyr/bluetooth/mesh/main.h b/include/zephyr/bluetooth/mesh/main.h index 00309b352f8..96f2b343a70 100644 --- a/include/zephyr/bluetooth/mesh/main.h +++ b/include/zephyr/bluetooth/mesh/main.h @@ -14,6 +14,7 @@ #include #include +#include /** * @brief Provisioning diff --git a/include/zephyr/bluetooth/mesh/proxy.h b/include/zephyr/bluetooth/mesh/proxy.h index b42db35e0fc..60a397b9484 100644 --- a/include/zephyr/bluetooth/mesh/proxy.h +++ b/include/zephyr/bluetooth/mesh/proxy.h @@ -13,6 +13,7 @@ #include #include +#include /** * @brief Proxy diff --git a/include/zephyr/bluetooth/services/ias.h b/include/zephyr/bluetooth/services/ias.h index d8fe92cf8dc..2056694f321 100644 --- a/include/zephyr/bluetooth/services/ias.h +++ b/include/zephyr/bluetooth/services/ias.h @@ -18,6 +18,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/device.h b/include/zephyr/device.h index 05d36cddf0e..49a562ab331 100644 --- a/include/zephyr/device.h +++ b/include/zephyr/device.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/include/zephyr/display/cfb.h b/include/zephyr/display/cfb.h index e80053994bd..0d0da059d25 100644 --- a/include/zephyr/display/cfb.h +++ b/include/zephyr/display/cfb.h @@ -14,6 +14,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/drivers/emul.h b/include/zephyr/drivers/emul.h index 244228743a2..5f48ee7f57d 100644 --- a/include/zephyr/drivers/emul.h +++ b/include/zephyr/drivers/emul.h @@ -26,6 +26,7 @@ struct emul; #include #include #include +#include /** * The types of supported buses. diff --git a/include/zephyr/drivers/pcie/pcie.h b/include/zephyr/drivers/pcie/pcie.h index 3d50ecfc19c..b6ad2209d14 100644 --- a/include/zephyr/drivers/pcie/pcie.h +++ b/include/zephyr/drivers/pcie/pcie.h @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/drivers/sensor.h b/include/zephyr/drivers/sensor.h index 6cce60864e4..7913447677a 100644 --- a/include/zephyr/drivers/sensor.h +++ b/include/zephyr/drivers/sensor.h @@ -21,6 +21,7 @@ #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/input/input.h b/include/zephyr/input/input.h index 14b12b67681..41546722c35 100644 --- a/include/zephyr/input/input.h +++ b/include/zephyr/input/input.h @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/kernel.h b/include/zephyr/kernel.h index 106b9dc70bd..6844b5fb162 100644 --- a/include/zephyr/kernel.h +++ b/include/zephyr/kernel.h @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/linker/common-ram.ld b/include/zephyr/linker/common-ram.ld index 5caecdb1aef..b4f67293610 100644 --- a/include/zephyr/linker/common-ram.ld +++ b/include/zephyr/linker/common-ram.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + #if defined(CONFIG_NETWORKING) #ifndef NETWORK_RAM_SECTIONS #define NETWORK_RAM_SECTIONS \ diff --git a/include/zephyr/linker/common-rom/common-rom-bt.ld b/include/zephyr/linker/common-rom/common-rom-bt.ld index ecd9ae05e3d..c8f5375b2be 100644 --- a/include/zephyr/linker/common-rom/common-rom-bt.ld +++ b/include/zephyr/linker/common-rom/common-rom-bt.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4) #if defined(CONFIG_BT_BREDR) diff --git a/include/zephyr/linker/common-rom/common-rom-debug.ld b/include/zephyr/linker/common-rom/common-rom-debug.ld index 1dd9af263df..6617e52d4e6 100644 --- a/include/zephyr/linker/common-rom/common-rom-debug.ld +++ b/include/zephyr/linker/common-rom/common-rom-debug.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + ITERABLE_SECTION_ROM(tracing_backend, 4) SECTION_DATA_PROLOGUE(zephyr_dbg_info,,) diff --git a/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld b/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld index 091522d5cf0..3c677cd0bad 100644 --- a/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld +++ b/include/zephyr/linker/common-rom/common-rom-kernel-devices.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + SECTION_PROLOGUE(initlevel,,) { /* diff --git a/include/zephyr/linker/common-rom/common-rom-logging.ld b/include/zephyr/linker/common-rom/common-rom-logging.ld index 5a470aa5539..f39fed01b21 100644 --- a/include/zephyr/linker/common-rom/common-rom-logging.ld +++ b/include/zephyr/linker/common-rom/common-rom-logging.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + ITERABLE_SECTION_ROM(log_strings, 4) ITERABLE_SECTION_ROM(log_const, 4) diff --git a/include/zephyr/linker/common-rom/common-rom-misc.ld b/include/zephyr/linker/common-rom/common-rom-misc.ld index 448d74f4b12..dd6907d3441 100644 --- a/include/zephyr/linker/common-rom/common-rom-misc.ld +++ b/include/zephyr/linker/common-rom/common-rom-misc.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + #if defined(CONFIG_EC_HOST_CMD) ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4) #endif diff --git a/include/zephyr/linker/common-rom/common-rom-net.ld b/include/zephyr/linker/common-rom/common-rom-net.ld index a01c94cc21b..e535f5f1fd0 100644 --- a/include/zephyr/linker/common-rom/common-rom-net.ld +++ b/include/zephyr/linker/common-rom/common-rom-net.ld @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ +#include + #if defined(CONFIG_NET_SOCKETS) ITERABLE_SECTION_ROM(net_socket_register, 4) #endif diff --git a/include/zephyr/linker/iterable_sections.h b/include/zephyr/linker/iterable_sections.h new file mode 100644 index 00000000000..2bc1f870b42 --- /dev/null +++ b/include/zephyr/linker/iterable_sections.h @@ -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_ */ diff --git a/include/zephyr/linker/linker-defs.h b/include/zephyr/linker/linker-defs.h index c1b53089737..e851b744e89 100644 --- a/include/zephyr/linker/linker-defs.h +++ b/include/zephyr/linker/linker-defs.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 diff --git a/include/zephyr/logging/log.h b/include/zephyr/logging/log.h index ba31c9fa01a..ea82991654e 100644 --- a/include/zephyr/logging/log.h +++ b/include/zephyr/logging/log.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/logging/log_backend.h b/include/zephyr/logging/log_backend.h index 85a511175d9..5aac379ce08 100644 --- a/include/zephyr/logging/log_backend.h +++ b/include/zephyr/logging/log_backend.h @@ -11,6 +11,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/logging/log_instance.h b/include/zephyr/logging/log_instance.h index 6636c88923f..8eca2b46a71 100644 --- a/include/zephyr/logging/log_instance.h +++ b/include/zephyr/logging/log_instance.h @@ -7,6 +7,7 @@ #define ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_ #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/logging/log_link.h b/include/zephyr/logging/log_link.h index f1cbaee258d..1e98874cb79 100644 --- a/include/zephyr/logging/log_link.h +++ b/include/zephyr/logging/log_link.h @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/logging/log_msg.h b/include/zephyr/logging/log_msg.h index 6d171cbc6ab..07c240ee56d 100644 --- a/include/zephyr/logging/log_msg.h +++ b/include/zephyr/logging/log_msg.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h b/include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h index 42058fc5847..9fe5965a493 100644 --- a/include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h +++ b/include/zephyr/mgmt/ec_host_cmd/ec_host_cmd.h @@ -17,6 +17,7 @@ #include #include #include +#include struct ec_host_cmd { struct ec_host_cmd_rx_ctx rx_ctx; diff --git a/include/zephyr/mgmt/mcumgr/mgmt/handlers.h b/include/zephyr/mgmt/mcumgr/mgmt/handlers.h index f646bb6c4c7..be575a5c85f 100644 --- a/include/zephyr/mgmt/mcumgr/mgmt/handlers.h +++ b/include/zephyr/mgmt/mcumgr/mgmt/handlers.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/net/buf.h b/include/zephyr/net/buf.h index c39f3dd561c..91d0f601183 100644 --- a/include/zephyr/net/buf.h +++ b/include/zephyr/net/buf.h @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/net/conn_mgr_connectivity.h b/include/zephyr/net/conn_mgr_connectivity.h index cad0bdfb4d5..34b885d8632 100644 --- a/include/zephyr/net/conn_mgr_connectivity.h +++ b/include/zephyr/net/conn_mgr_connectivity.h @@ -15,6 +15,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/net/ethernet_bridge.h b/include/zephyr/net/ethernet_bridge.h index 5228edb0c45..aa86f63a561 100644 --- a/include/zephyr/net/ethernet_bridge.h +++ b/include/zephyr/net/ethernet_bridge.h @@ -16,6 +16,7 @@ #define ZEPHYR_INCLUDE_NET_ETHERNET_BRIDGE_H_ #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/net/http/service.h b/include/zephyr/net/http/service.h index 49b3085b5bb..a7af97cb500 100644 --- a/include/zephyr/net/http/service.h +++ b/include/zephyr/net/http/service.h @@ -10,6 +10,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/include/zephyr/net/net_if.h b/include/zephyr/net/net_if.h index 4344f4c25e0..cedfe9f1db5 100644 --- a/include/zephyr/net/net_if.h +++ b/include/zephyr/net/net_if.h @@ -21,7 +21,7 @@ #include #include - +#include #include #include #include diff --git a/include/zephyr/net/net_l2.h b/include/zephyr/net/net_l2.h index 98ce34d2aef..dc443e0a3f5 100644 --- a/include/zephyr/net/net_l2.h +++ b/include/zephyr/net/net_l2.h @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 1209bc0cc73..5a28e42ca3b 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/pm/device.h b/include/zephyr/pm/device.h index 062ce6e7e78..2c6734a95b4 100644 --- a/include/zephyr/pm/device.h +++ b/include/zephyr/pm/device.h @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/rtio/rtio.h b/include/zephyr/rtio/rtio.h index 1af4e553bec..d15383e8f99 100644 --- a/include/zephyr/rtio/rtio.h +++ b/include/zephyr/rtio/rtio.h @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/settings/settings.h b/include/zephyr/settings/settings.h index 0f187f71b90..a95bb74410a 100644 --- a/include/zephyr/settings/settings.h +++ b/include/zephyr/settings/settings.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/include/zephyr/shell/shell.h b/include/zephyr/shell/shell.h index 3a29b46c10c..2c874ff0f0c 100644 --- a/include/zephyr/shell/shell.h +++ b/include/zephyr/shell/shell.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #if defined CONFIG_SHELL_GETOPT diff --git a/include/zephyr/sys/iterable_sections.h b/include/zephyr/sys/iterable_sections.h new file mode 100644 index 00000000000..47b217cd9a3 --- /dev/null +++ b/include/zephyr/sys/iterable_sections.h @@ -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 +#include + +#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 '__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 __list_start symbol and a + * __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 __list_start symbol and a + * __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 __list_start symbol and a + * __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_ */ diff --git a/include/zephyr/sys/kobject.h b/include/zephyr/sys/kobject.h index 73bf00830a5..fa630375428 100644 --- a/include/zephyr/sys/kobject.h +++ b/include/zephyr/sys/kobject.h @@ -9,6 +9,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/include/zephyr/sys/p4wq.h b/include/zephyr/sys/p4wq.h index 095031fbf82..8ddb8f0d7a7 100644 --- a/include/zephyr/sys/p4wq.h +++ b/include/zephyr/sys/p4wq.h @@ -7,6 +7,7 @@ #define ZEPHYR_INCLUDE_SYS_P4WQ_H_ #include +#include /* Zephyr Pooled Parallel Preemptible Priority-based Work Queues */ diff --git a/include/zephyr/sys/sem.h b/include/zephyr/sys/sem.h index 2b40ee341e7..d4e93df4ffc 100644 --- a/include/zephyr/sys/sem.h +++ b/include/zephyr/sys/sem.h @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/toolchain/common.h b/include/zephyr/toolchain/common.h index 8bfe4503fa0..ea6c0db5f4e 100644 --- a/include/zephyr/toolchain/common.h +++ b/include/zephyr/toolchain/common.h @@ -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 '__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 __list_start symbol and a - * __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 __list_start symbol and a - * __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 __list_start symbol and a - * __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 diff --git a/include/zephyr/usb/class/usbd_msc.h b/include/zephyr/usb/class/usbd_msc.h index b2e69284c80..a8e9b1a9179 100644 --- a/include/zephyr/usb/class/usbd_msc.h +++ b/include/zephyr/usb/class/usbd_msc.h @@ -11,6 +11,8 @@ * Header exposes API for registering LUNs. */ +#include + #ifndef ZEPHYR_INCLUDE_USB_CLASS_USBD_MSC_H_ #define ZEPHYR_INCLUDE_USB_CLASS_USBD_MSC_H_ diff --git a/include/zephyr/usb/usb_device.h b/include/zephyr/usb/usb_device.h index 89eff501e32..0de535365ee 100644 --- a/include/zephyr/usb/usb_device.h +++ b/include/zephyr/usb/usb_device.h @@ -41,6 +41,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/usb/usbd.h b/include/zephyr/usb/usbd.h index b4e151b0cbb..34b1c6437ef 100644 --- a/include/zephyr/usb/usbd.h +++ b/include/zephyr/usb/usbd.h @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/usb/usbh.h b/include/zephyr/usb/usbh.h index 5ee45d7e5d7..a1f5e00581e 100644 --- a/include/zephyr/usb/usbh.h +++ b/include/zephyr/usb/usbh.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/zephyr/zbus/zbus.h b/include/zephyr/zbus/zbus.h index 75f66e5bd97..615f358a8d5 100644 --- a/include/zephyr/zbus/zbus.h +++ b/include/zephyr/zbus/zbus.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/kernel/device.c b/kernel/device.c index ce2851eb537..3aa237716ad 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/kernel/kheap.c b/kernel/kheap.c index 196b395ff85..161621a0884 100644 --- a/kernel/kheap.c +++ b/kernel/kheap.c @@ -9,6 +9,7 @@ #include #include #include +#include void k_heap_init(struct k_heap *h, void *mem, size_t bytes) { diff --git a/kernel/mem_slab.c b/kernel/mem_slab.c index d1b3b979657..7f98eb579f6 100644 --- a/kernel/mem_slab.c +++ b/kernel/mem_slab.c @@ -14,6 +14,7 @@ #include #include #include +#include /** * @brief Initialize kernel memory slab subsystem. diff --git a/kernel/thread.c b/kernel/thread.c index 277b8eb4642..fb578eb48d8 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -29,6 +29,8 @@ #include #include #include +#include + LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); #ifdef CONFIG_THREAD_MONITOR diff --git a/lib/os/p4wq.c b/lib/os/p4wq.c index ada5e3e2c21..d5e97476812 100644 --- a/lib/os/p4wq.c +++ b/lib/os/p4wq.c @@ -9,6 +9,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(p4wq, CONFIG_LOG_DEFAULT_LEVEL); diff --git a/lib/posix/getopt/getopt_common.c b/lib/posix/getopt/getopt_common.c index cec16cbf97e..f31915fdfbf 100644 --- a/lib/posix/getopt/getopt_common.c +++ b/lib/posix/getopt/getopt_common.c @@ -5,6 +5,10 @@ */ #include #include +#if CONFIG_SHELL_GETOPT +#include +#endif + #include "getopt.h" /* Referring below variables is not thread safe. They reflects getopt state diff --git a/samples/sensor/sensor_shell/src/main.c b/samples/sensor/sensor_shell/src/main.c index 235cc58982c..61f22734092 100644 --- a/samples/sensor/sensor_shell/src/main.c +++ b/samples/sensor/sensor_shell/src/main.c @@ -8,6 +8,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(app); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 04b1e337f6c..b6d95b83ebd 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index 7a0fe9fd79c..e9ca32bd0a6 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 41e0a6a363a..566f719d91f 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/subsys/bluetooth/host/l2cap_br.c b/subsys/bluetooth/host/l2cap_br.c index 1c4136303c1..3d64887a182 100644 --- a/subsys/bluetooth/host/l2cap_br.c +++ b/subsys/bluetooth/host/l2cap_br.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 2a54dbeec72..9fdab336fa9 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -9,6 +9,7 @@ */ #include +#include enum l2cap_conn_list_action { BT_L2CAP_CHAN_LOOKUP, diff --git a/subsys/bluetooth/mesh/adv_ext.c b/subsys/bluetooth/mesh/adv_ext.c index cf34fd648e4..7f640cda8d0 100644 --- a/subsys/bluetooth/mesh/adv_ext.c +++ b/subsys/bluetooth/mesh/adv_ext.c @@ -8,7 +8,7 @@ #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/app_keys.c b/subsys/bluetooth/mesh/app_keys.c index 9b3b3b98767..f7a6045742e 100644 --- a/subsys/bluetooth/mesh/app_keys.c +++ b/subsys/bluetooth/mesh/app_keys.c @@ -9,6 +9,8 @@ #include #include #include +#include + #include "mesh.h" #include "net.h" #include "app_keys.h" diff --git a/subsys/bluetooth/mesh/beacon.c b/subsys/bluetooth/mesh/beacon.c index fc4f6e491bc..161ee8488e9 100644 --- a/subsys/bluetooth/mesh/beacon.c +++ b/subsys/bluetooth/mesh/beacon.c @@ -8,7 +8,7 @@ #include #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/friend.c b/subsys/bluetooth/mesh/friend.c index 097fac13f3e..69de0bb2264 100644 --- a/subsys/bluetooth/mesh/friend.c +++ b/subsys/bluetooth/mesh/friend.c @@ -7,7 +7,7 @@ #include #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/heartbeat.c b/subsys/bluetooth/mesh/heartbeat.c index 503a0994d55..08a309b7484 100644 --- a/subsys/bluetooth/mesh/heartbeat.c +++ b/subsys/bluetooth/mesh/heartbeat.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ #include +#include + #include "net.h" #include "rpl.h" #include "access.h" diff --git a/subsys/bluetooth/mesh/lpn.c b/subsys/bluetooth/mesh/lpn.c index 36ca3ee35b5..9947dc07964 100644 --- a/subsys/bluetooth/mesh/lpn.c +++ b/subsys/bluetooth/mesh/lpn.c @@ -7,7 +7,7 @@ #include #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/mesh.h b/subsys/bluetooth/mesh/mesh.h index 59abd2bb4aa..d297f43a6da 100644 --- a/subsys/bluetooth/mesh/mesh.h +++ b/subsys/bluetooth/mesh/mesh.h @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + #define BT_MESH_KEY_PRIMARY 0x0000 enum bt_mesh_key_evt { diff --git a/subsys/bluetooth/mesh/proxy_srv.c b/subsys/bluetooth/mesh/proxy_srv.c index 79e70fffadb..94abab58fa3 100644 --- a/subsys/bluetooth/mesh/proxy_srv.c +++ b/subsys/bluetooth/mesh/proxy_srv.c @@ -7,7 +7,7 @@ #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c index 085da0432ad..3baed0792d6 100644 --- a/subsys/bluetooth/mesh/subnet.c +++ b/subsys/bluetooth/mesh/subnet.c @@ -13,7 +13,7 @@ #include #include #include - +#include #include #include #include diff --git a/subsys/bluetooth/mesh/subnet.h b/subsys/bluetooth/mesh/subnet.h index 93c6d31e894..99d89438691 100644 --- a/subsys/bluetooth/mesh/subnet.h +++ b/subsys/bluetooth/mesh/subnet.h @@ -11,6 +11,7 @@ #include #include #include +#include #define BT_MESH_NET_FLAG_KR BIT(0) #define BT_MESH_NET_FLAG_IVU BIT(1) diff --git a/subsys/bluetooth/services/ias/ias.c b/subsys/bluetooth/services/ias/ias.c index 19299c3f66d..4bbf8a3a7e3 100644 --- a/subsys/bluetooth/services/ias/ias.c +++ b/subsys/bluetooth/services/ias/ias.c @@ -17,6 +17,7 @@ #include #include #include +#include #define LOG_LEVEL CONFIG_BT_IAS_LOG_LEVEL LOG_MODULE_REGISTER(ias); diff --git a/subsys/emul/emul.c b/subsys/emul/emul.c index d92a3ffbb8d..15299381a38 100644 --- a/subsys/emul/emul.c +++ b/subsys/emul/emul.c @@ -11,6 +11,7 @@ LOG_MODULE_REGISTER(emul); #include #include +#include #include const struct emul *emul_get_binding(const char *name) diff --git a/subsys/input/input.c b/subsys/input/input.c index fce77352f64..5e9f45d8de7 100644 --- a/subsys/input/input.c +++ b/subsys/input/input.c @@ -7,6 +7,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(input, CONFIG_INPUT_LOG_LEVEL); diff --git a/subsys/logging/log_cmds.c b/subsys/logging/log_cmds.c index d07dade5ffd..372d28ee0aa 100644 --- a/subsys/logging/log_cmds.c +++ b/subsys/logging/log_cmds.c @@ -8,6 +8,7 @@ #include #include #include +#include #include typedef int (*log_backend_cmd_t)(const struct shell *sh, diff --git a/subsys/logging/log_core.c b/subsys/logging/log_core.c index a9c05dbca5a..2e54dc87832 100644 --- a/subsys/logging/log_core.c +++ b/subsys/logging/log_core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/subsys/logging/log_mgmt.c b/subsys/logging/log_mgmt.c index 75eed38c474..1f3e3594760 100644 --- a/subsys/logging/log_mgmt.c +++ b/subsys/logging/log_mgmt.c @@ -9,6 +9,8 @@ #include #include #include +#include + #include "log_cache.h" LOG_MODULE_REGISTER(log_mgmt); diff --git a/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c b/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c index 912adf10551..13e12af55a5 100644 --- a/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c +++ b/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c @@ -9,6 +9,7 @@ #include #include #include +#include #include LOG_MODULE_REGISTER(host_cmd_handler, CONFIG_EC_HC_LOG_LEVEL); diff --git a/subsys/mgmt/mcumgr/mgmt/src/mgmt.c b/subsys/mgmt/mcumgr/mgmt/src/mgmt.c index 030a6ce55a3..e83d948dca9 100644 --- a/subsys/mgmt/mcumgr/mgmt/src/mgmt.c +++ b/subsys/mgmt/mcumgr/mgmt/src/mgmt.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #ifdef CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS diff --git a/subsys/net/conn_mgr/conn_mgr.c b/subsys/net/conn_mgr/conn_mgr.c index 624ade7c549..b202c874566 100644 --- a/subsys/net/conn_mgr/conn_mgr.c +++ b/subsys/net/conn_mgr/conn_mgr.c @@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(conn_mgr, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL); #include #include #include - +#include #include #include "conn_mgr_private.h" diff --git a/subsys/net/conn_mgr/conn_mgr.ld b/subsys/net/conn_mgr/conn_mgr.ld index 352dde5c647..ed09ad0c396 100644 --- a/subsys/net/conn_mgr/conn_mgr.ld +++ b/subsys/net/conn_mgr/conn_mgr.ld @@ -4,4 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include + ITERABLE_SECTION_RAM(conn_mgr_conn_binding, 4) diff --git a/subsys/net/conn_mgr/conn_mgr_connectivity.c b/subsys/net/conn_mgr/conn_mgr_connectivity.c index 2cc075074fb..8fae71acec1 100644 --- a/subsys/net/conn_mgr/conn_mgr_connectivity.c +++ b/subsys/net/conn_mgr/conn_mgr_connectivity.c @@ -9,6 +9,8 @@ LOG_MODULE_REGISTER(conn_mgr_conn, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL); #include #include +#include + #include "conn_mgr_private.h" int conn_mgr_if_connect(struct net_if *iface) diff --git a/subsys/net/conn_mgr/conn_mgr_private.h b/subsys/net/conn_mgr/conn_mgr_private.h index b21e61bf0aa..9e147653828 100644 --- a/subsys/net/conn_mgr/conn_mgr_private.h +++ b/subsys/net/conn_mgr/conn_mgr_private.h @@ -8,6 +8,7 @@ #define __CONN_MGR_PRV_H__ #include +#include #if defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) #define CONN_MGR_IFACE_MAX MAX(CONFIG_NET_IF_MAX_IPV6_COUNT, \ diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index 868099eb744..5da2a664678 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_if, CONFIG_NET_IF_LOG_LEVEL); #include #include #include +#include #include "net_private.h" #include "ipv4.h" diff --git a/subsys/net/l2/ethernet/bridge.c b/subsys/net/l2/ethernet/bridge.c index 0f7c4d66a96..8fe4f8ef989 100644 --- a/subsys/net/l2/ethernet/bridge.c +++ b/subsys/net/l2/ethernet/bridge.c @@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(net_eth_bridge, CONFIG_NET_ETHERNET_BRIDGE_LOG_LEVEL); #include #include #include - +#include #include #include "bridge.h" diff --git a/subsys/net/l2/ppp/link.c b/subsys/net/l2/ppp/link.c index e2eddc26fff..29f4ad6f40c 100644 --- a/subsys/net/l2/ppp/link.c +++ b/subsys/net/l2/ppp/link.c @@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); #include #include - +#include #include #include "net_private.h" diff --git a/subsys/net/l2/ppp/network.c b/subsys/net/l2/ppp/network.c index bf63b7c4f98..02bba7d8628 100644 --- a/subsys/net/l2/ppp/network.c +++ b/subsys/net/l2/ppp/network.c @@ -9,7 +9,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); #include #include - +#include #include #include "net_private.h" diff --git a/subsys/net/l2/ppp/ppp_internal.h b/subsys/net/l2/ppp/ppp_internal.h index 91a41f9571f..0603f1e27b8 100644 --- a/subsys/net/l2/ppp/ppp_internal.h +++ b/subsys/net/l2/ppp/ppp_internal.h @@ -11,6 +11,7 @@ */ #include +#include /** * FSM flags that control how it operates. diff --git a/subsys/net/l2/ppp/ppp_l2.c b/subsys/net/l2/ppp/ppp_l2.c index 3f48665213b..6e08825f8b0 100644 --- a/subsys/net/l2/ppp/ppp_l2.c +++ b/subsys/net/l2/ppp/ppp_l2.c @@ -13,8 +13,8 @@ LOG_MODULE_REGISTER(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); #include #include #include - #include +#include #include "net_private.h" #include "ipv4_autoconf_internal.h" diff --git a/subsys/net/lib/dns/dns_sd.h b/subsys/net/lib/dns/dns_sd.h index 60ee6992b99..a28062a3e3a 100644 --- a/subsys/net/lib/dns/dns_sd.h +++ b/subsys/net/lib/dns/dns_sd.h @@ -13,6 +13,7 @@ #include #include +#include #include "dns_pack.h" diff --git a/subsys/net/lib/sockets/socket_dispatcher.c b/subsys/net/lib/sockets/socket_dispatcher.c index df30defd8d2..c3290564beb 100644 --- a/subsys/net/lib/sockets/socket_dispatcher.c +++ b/subsys/net/lib/sockets/socket_dispatcher.c @@ -6,6 +6,7 @@ #include #include +#include #include "sockets_internal.h" diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 9e86a56ef10..b3011e07937 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -22,6 +22,7 @@ LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL); #include #include #include +#include #if defined(CONFIG_SOCKS) #include "socks.h" diff --git a/subsys/pm/device.c b/subsys/pm/device.c index ccfedd32074..9b89a43ee20 100644 --- a/subsys/pm/device.c +++ b/subsys/pm/device.c @@ -7,6 +7,7 @@ #include #include #include +#include #include LOG_MODULE_REGISTER(pm_device, CONFIG_PM_DEVICE_LOG_LEVEL); diff --git a/subsys/rtio/rtio_init.c b/subsys/rtio/rtio_init.c index 6c95986936c..a6b1db0611c 100644 --- a/subsys/rtio/rtio_init.c +++ b/subsys/rtio/rtio_init.c @@ -6,6 +6,7 @@ #include #include #include +#include #ifdef CONFIG_USERSPACE K_APPMEM_PARTITION_DEFINE(rtio_partition); diff --git a/subsys/settings/src/settings.c b/subsys/settings/src/settings.c index 0afb2ad7042..e2072234fa9 100644 --- a/subsys/settings/src/settings.c +++ b/subsys/settings/src/settings.c @@ -14,7 +14,7 @@ #include #include "settings_priv.h" #include - +#include #include LOG_MODULE_REGISTER(settings, CONFIG_SETTINGS_LOG_LEVEL); diff --git a/subsys/settings/src/settings_store.c b/subsys/settings/src/settings_store.c index f658bdd0bfb..d47b24f064b 100644 --- a/subsys/settings/src/settings_store.c +++ b/subsys/settings/src/settings_store.c @@ -13,7 +13,7 @@ #include #include #include - +#include #include #include "settings_priv.h" diff --git a/subsys/shell/shell_cmds.c b/subsys/shell/shell_cmds.c index 4454fb31b17..a806f6187a3 100644 --- a/subsys/shell/shell_cmds.c +++ b/subsys/shell/shell_cmds.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ #include +#include + #include "shell_utils.h" #include "shell_help.h" #include "shell_ops.h" diff --git a/subsys/shell/shell_utils.c b/subsys/shell/shell_utils.c index e50c568e0ac..3e577c8b59f 100644 --- a/subsys/shell/shell_utils.c +++ b/subsys/shell/shell_utils.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include "shell_utils.h" #include "shell_wildcard.h" diff --git a/subsys/sip_svc/sip_svc_data.ld b/subsys/sip_svc/sip_svc_data.ld index 35a2dfbb7a0..02516ee1e52 100644 --- a/subsys/sip_svc/sip_svc_data.ld +++ b/subsys/sip_svc/sip_svc_data.ld @@ -1 +1,3 @@ +#include + ITERABLE_SECTION_RAM(sip_svc_controller, 4) diff --git a/subsys/sip_svc/sip_svc_subsys.c b/subsys/sip_svc/sip_svc_subsys.c index 48bba7496a7..7bf5d52e133 100644 --- a/subsys/sip_svc/sip_svc_subsys.c +++ b/subsys/sip_svc/sip_svc_subsys.c @@ -110,6 +110,7 @@ #include #include #include +#include #include "sip_svc_id_mgr.h" #include diff --git a/subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h b/subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h index 548a56123be..dc512372297 100644 --- a/subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h +++ b/subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h @@ -15,6 +15,7 @@ #include #include +#include #include #ifdef __cplusplus diff --git a/subsys/testsuite/ztest/include/zephyr/ztest_test_new.h b/subsys/testsuite/ztest/include/zephyr/ztest_test_new.h index b3e8c4d6aeb..995171d4f88 100644 --- a/subsys/testsuite/ztest/include/zephyr/ztest_test_new.h +++ b/subsys/testsuite/ztest/include/zephyr/ztest_test_new.h @@ -15,6 +15,7 @@ #include #include +#include #include #if defined(CONFIG_USERSPACE) diff --git a/subsys/tracing/include/tracing_backend.h b/subsys/tracing/include/tracing_backend.h index be2b8bc6090..d43245d56ae 100644 --- a/subsys/tracing/include/tracing_backend.h +++ b/subsys/tracing/include/tracing_backend.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/subsys/tracing/tracing_tracking.c b/subsys/tracing/tracing_tracking.c index 08948a6ff4f..bb4553a9f14 100644 --- a/subsys/tracing/tracing_tracking.c +++ b/subsys/tracing/tracing_tracking.c @@ -8,6 +8,7 @@ #include #include #include +#include struct k_timer *_track_list_k_timer; struct k_spinlock _track_list_k_timer_lock; diff --git a/subsys/usb/device/usb_descriptor.c b/subsys/usb/device/usb_descriptor.c index 5533828bc92..7c2ac37d94a 100644 --- a/subsys/usb/device/usb_descriptor.c +++ b/subsys/usb/device/usb_descriptor.c @@ -13,7 +13,7 @@ #include #include "usb_descriptor.h" #include - +#include #include LOG_MODULE_REGISTER(usb_descriptor, CONFIG_USB_DEVICE_LOG_LEVEL); diff --git a/subsys/usb/device/usb_device.c b/subsys/usb/device/usb_device.c index 41bcb852657..5baac77c373 100644 --- a/subsys/usb/device/usb_device.c +++ b/subsys/usb/device/usb_device.c @@ -67,7 +67,7 @@ #include #include #include - +#include #include LOG_MODULE_REGISTER(usb_device, CONFIG_USB_DEVICE_LOG_LEVEL); diff --git a/subsys/usb/device_next/class/usbd_msc.c b/subsys/usb/device_next/class/usbd_msc.c index bc6a5e2bf23..5e61fc29b46 100644 --- a/subsys/usb/device_next/class/usbd_msc.c +++ b/subsys/usb/device_next/class/usbd_msc.c @@ -11,7 +11,7 @@ #include #include #include - +#include #include #include "usbd_msc_scsi.h" diff --git a/subsys/usb/device_next/class/usbd_msc.ld b/subsys/usb/device_next/class/usbd_msc.ld index ed5e11dd627..bf06af14dfc 100644 --- a/subsys/usb/device_next/class/usbd_msc.ld +++ b/subsys/usb/device_next/class/usbd_msc.ld @@ -1 +1,3 @@ +#include + ITERABLE_SECTION_ROM(usbd_msc_lun, 4) diff --git a/subsys/usb/device_next/usbd_class.c b/subsys/usb/device_next/usbd_class.c index 95ba6122081..7470acc5f93 100644 --- a/subsys/usb/device_next/usbd_class.c +++ b/subsys/usb/device_next/usbd_class.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "usbd_device.h" #include "usbd_class_api.h" diff --git a/subsys/usb/device_next/usbd_core.c b/subsys/usb/device_next/usbd_core.c index 542a1d30033..48cc0a69dcd 100644 --- a/subsys/usb/device_next/usbd_core.c +++ b/subsys/usb/device_next/usbd_core.c @@ -8,7 +8,7 @@ #include #include #include - +#include #include #include diff --git a/subsys/usb/device_next/usbd_data.ld b/subsys/usb/device_next/usbd_data.ld index a1966db8a20..78c09d0f383 100644 --- a/subsys/usb/device_next/usbd_data.ld +++ b/subsys/usb/device_next/usbd_data.ld @@ -1,2 +1,4 @@ +#include + ITERABLE_SECTION_RAM(usbd_contex, 4) ITERABLE_SECTION_RAM(usbd_class_node, 4) diff --git a/subsys/usb/device_next/usbd_shell.c b/subsys/usb/device_next/usbd_shell.c index 4560335e9e1..f93e096770e 100644 --- a/subsys/usb/device_next/usbd_shell.c +++ b/subsys/usb/device_next/usbd_shell.c @@ -12,6 +12,7 @@ #include #include #include +#include const struct shell *ctx_shell; diff --git a/subsys/usb/host/usbh_core.c b/subsys/usb/host/usbh_core.c index 00950ac51ad..efbf3a84985 100644 --- a/subsys/usb/host/usbh_core.c +++ b/subsys/usb/host/usbh_core.c @@ -9,7 +9,7 @@ #include #include #include "usbh_internal.h" - +#include #include LOG_MODULE_REGISTER(uhs, CONFIG_USBH_LOG_LEVEL); diff --git a/subsys/usb/host/usbh_data.ld b/subsys/usb/host/usbh_data.ld index 64503daae89..f04fd236fca 100644 --- a/subsys/usb/host/usbh_data.ld +++ b/subsys/usb/host/usbh_data.ld @@ -1,2 +1,4 @@ +#include + ITERABLE_SECTION_RAM(usbh_contex, 4) ITERABLE_SECTION_RAM(usbh_class_data, 4) diff --git a/subsys/zbus/zbus.ld b/subsys/zbus/zbus.ld index 734d7b3eed5..ffeab1a3165 100644 --- a/subsys/zbus/zbus.ld +++ b/subsys/zbus/zbus.ld @@ -1,2 +1,4 @@ +#include + ITERABLE_SECTION_RAM(zbus_channel, 4) ITERABLE_SECTION_RAM(zbus_observer, 4) diff --git a/subsys/zbus/zbus_iterable_sections.c b/subsys/zbus/zbus_iterable_sections.c index 1b0a7b93f19..48b3212e596 100644 --- a/subsys/zbus/zbus_iterable_sections.c +++ b/subsys/zbus/zbus_iterable_sections.c @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include +#include #include LOG_MODULE_DECLARE(zbus, CONFIG_ZBUS_LOG_LEVEL); diff --git a/tests/bluetooth/audio/mocks/src/gatt.c b/tests/bluetooth/audio/mocks/src/gatt.c index 03fab73391f..445098dfc70 100644 --- a/tests/bluetooth/audio/mocks/src/gatt.c +++ b/tests/bluetooth/audio/mocks/src/gatt.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "gatt.h" diff --git a/tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c b/tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c index 6bbbf00b153..03ea30c6cb9 100644 --- a/tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c +++ b/tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c @@ -8,6 +8,7 @@ #include #include #include +#include #define I2S_DEV_NODE_RX DT_ALIAS(i2s_node0) #ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES diff --git a/tests/misc/iterable_sections/sections-ram.ld b/tests/misc/iterable_sections/sections-ram.ld index 57b14506cf6..c7c86a8d97c 100644 --- a/tests/misc/iterable_sections/sections-ram.ld +++ b/tests/misc/iterable_sections/sections-ram.ld @@ -1,3 +1,5 @@ +#include + ITERABLE_SECTION_RAM(test_ram, 4) ITERABLE_SECTION_RAM(test_ram2, 4) ITERABLE_SECTION_RAM(test_ram_named, 4) diff --git a/tests/misc/iterable_sections/sections-rom.ld b/tests/misc/iterable_sections/sections-rom.ld index 38542934c25..c837cbfbc4b 100644 --- a/tests/misc/iterable_sections/sections-rom.ld +++ b/tests/misc/iterable_sections/sections-rom.ld @@ -1,3 +1,5 @@ +#include + ITERABLE_SECTION_ROM(test_rom, 4) ITERABLE_SECTION_ROM(test_rom2, 4) ITERABLE_SECTION_ROM(test_rom_named, 4) diff --git a/tests/misc/iterable_sections/src/main.c b/tests/misc/iterable_sections/src/main.c index 3d9691cc78a..e5d697b8a80 100644 --- a/tests/misc/iterable_sections/src/main.c +++ b/tests/misc/iterable_sections/src/main.c @@ -5,6 +5,7 @@ */ #include +#include struct test_ram { int i; diff --git a/tests/net/lib/http_server/common/sections-rom.ld b/tests/net/lib/http_server/common/sections-rom.ld index 893e9bd8c96..437e4bcb65b 100644 --- a/tests/net/lib/http_server/common/sections-rom.ld +++ b/tests/net/lib/http_server/common/sections-rom.ld @@ -1,2 +1,4 @@ +#include + ITERABLE_SECTION_ROM(http_resource_desc_service_A, 4) ITERABLE_SECTION_ROM(http_resource_desc_service_B, 4) diff --git a/tests/subsys/logging/log_core_additional/src/log_test.c b/tests/subsys/logging/log_core_additional/src/log_test.c index 34cb712c771..256582d9eeb 100644 --- a/tests/subsys/logging/log_core_additional/src/log_test.c +++ b/tests/subsys/logging/log_core_additional/src/log_test.c @@ -19,6 +19,7 @@ #include #include #include +#include #define TEST_MESSAGE "test msg" diff --git a/tests/subsys/usb/desc_sections/src/desc_sections.c b/tests/subsys/usb/desc_sections/src/desc_sections.c index 56df5776b44..6297d9fc885 100644 --- a/tests/subsys/usb/desc_sections/src/desc_sections.c +++ b/tests/subsys/usb/desc_sections/src/desc_sections.c @@ -10,7 +10,7 @@ #include #include #include - +#include #include LOG_MODULE_REGISTER(test_main, LOG_LEVEL_DBG);