From f88a420d690cb54b07d10f177413f50a8325b2f4 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 4 Aug 2021 23:05:54 +0100 Subject: [PATCH] toolchain: migrate iterable sections calls to the external API This migrates all the current iterable section usages to the external API, dropping the "Z_" prefix: Z_ITERABLE_SECTION_ROM Z_ITERABLE_SECTION_ROM_GC_ALLOWED Z_ITERABLE_SECTION_RAM Z_ITERABLE_SECTION_RAM_GC_ALLOWED Z_STRUCT_SECTION_ITERABLE Z_STRUCT_SECTION_ITERABLE_ALTERNATE Z_STRUCT_SECTION_FOREACH Signed-off-by: Fabio Baltieri --- boards/arm/ip_k66f/linker.ld | 6 +-- include/bluetooth/conn.h | 2 +- include/bluetooth/gatt.h | 4 +- include/bluetooth/mesh/heartbeat.h | 2 +- include/bluetooth/mesh/main.h | 16 +++---- include/bluetooth/mesh/proxy.h | 2 +- include/display/cfb.h | 3 +- include/kernel.h | 30 ++++++------ include/linker/common-ram.ld | 34 +++++++------- include/linker/common-rom.ld | 38 +++++++-------- include/logging/log_backend.h | 2 +- include/mgmt/ec_host_cmd.h | 4 +- include/net/dns_sd.h | 2 +- include/net/ethernet_bridge.h | 2 +- include/net/net_if.h | 4 +- include/net/net_l2.h | 4 +- include/net/socket.h | 2 +- include/settings/settings.h | 4 +- include/shell/shell.h | 2 +- include/sys/kobject.h | 2 +- include/sys/p4wq.h | 8 ++-- include/sys/sem.h | 2 +- kernel/kheap.c | 2 +- kernel/mem_slab.c | 2 +- kernel/thread.c | 4 +- lib/os/p4wq.c | 2 +- soc/xtensa/esp32/linker.ld | 26 +++++------ soc/xtensa/esp32s2/linker.ld | 18 ++++---- subsys/bluetooth/host/conn.c | 18 ++++---- subsys/bluetooth/host/gatt.c | 6 +-- subsys/bluetooth/host/l2cap.c | 2 +- subsys/bluetooth/host/l2cap_br.c | 4 +- subsys/bluetooth/host/l2cap_internal.h | 4 +- subsys/bluetooth/mesh/app_keys.c | 2 +- subsys/bluetooth/mesh/friend.c | 6 +-- subsys/bluetooth/mesh/gatt_services.c | 4 +- subsys/bluetooth/mesh/heartbeat.c | 4 +- subsys/bluetooth/mesh/lpn.c | 6 +-- subsys/bluetooth/mesh/mesh.h | 4 +- subsys/bluetooth/mesh/subnet.c | 2 +- subsys/bluetooth/mesh/subnet.h | 2 +- subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c | 2 +- subsys/net/ip/net_if.c | 46 +++++++++---------- subsys/net/l2/ethernet/bridge.c | 2 +- subsys/net/l2/ppp/link.c | 8 ++-- subsys/net/l2/ppp/network.c | 2 +- subsys/net/l2/ppp/ppp_internal.h | 2 +- subsys/net/l2/ppp/ppp_l2.c | 4 +- subsys/net/lib/dns/dns_sd.h | 2 +- subsys/net/lib/sockets/sockets.c | 2 +- subsys/settings/src/settings.c | 6 +-- subsys/settings/src/settings_store.c | 2 +- subsys/shell/shell_utils.c | 2 +- subsys/tracing/include/tracing_backend.h | 5 +- 54 files changed, 188 insertions(+), 190 deletions(-) diff --git a/boards/arm/ip_k66f/linker.ld b/boards/arm/ip_k66f/linker.ld index b8aa54b678b..9a620d509b2 100644 --- a/boards/arm/ip_k66f/linker.ld +++ b/boards/arm/ip_k66f/linker.ld @@ -38,8 +38,8 @@ SECTION_DATA_PROLOGUE(net_if_area,,SUBALIGN(4)) \ KEEP(*(SORT_BY_NAME(._net_if.static.*))); \ _net_if_list_end = .; \ } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) \ -Z_ITERABLE_SECTION_RAM(net_if_dev, 4) \ -Z_ITERABLE_SECTION_RAM(net_l2, 4) \ -Z_ITERABLE_SECTION_RAM(eth_bridge, 4) +ITERABLE_SECTION_RAM(net_if_dev, 4) \ +ITERABLE_SECTION_RAM(net_l2, 4) \ +ITERABLE_SECTION_RAM(eth_bridge, 4) #include diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index 300e3d704f9..27d0252b6cf 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -939,7 +939,7 @@ void bt_conn_cb_register(struct bt_conn_cb *cb); * @param _name Name of callback structure. */ #define BT_CONN_CB_DEFINE(_name) \ - static const Z_STRUCT_SECTION_ITERABLE(bt_conn_cb, \ + static const STRUCT_SECTION_ITERABLE(bt_conn_cb, \ _CONCAT(bt_conn_cb, \ _name)) diff --git a/include/bluetooth/gatt.h b/include/bluetooth/gatt.h index 301516a69ea..e648257e505 100644 --- a/include/bluetooth/gatt.h +++ b/include/bluetooth/gatt.h @@ -519,8 +519,8 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn, */ #define BT_GATT_SERVICE_DEFINE(_name, ...) \ const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \ - const Z_STRUCT_SECTION_ITERABLE(bt_gatt_service_static, _name) =\ - BT_GATT_SERVICE(attr_##_name) + const STRUCT_SECTION_ITERABLE(bt_gatt_service_static, _name) = \ + BT_GATT_SERVICE(attr_##_name) #define _BT_GATT_ATTRS_ARRAY_DEFINE(n, _instances, _attrs_def) \ static struct bt_gatt_attr attrs_##n[] = _attrs_def(_instances[n]); diff --git a/include/bluetooth/mesh/heartbeat.h b/include/bluetooth/mesh/heartbeat.h index 7a37ccec24f..b607bc01b92 100644 --- a/include/bluetooth/mesh/heartbeat.h +++ b/include/bluetooth/mesh/heartbeat.h @@ -111,7 +111,7 @@ struct bt_mesh_hb_cb { * @param _name Name of callback structure. */ #define BT_MESH_HB_CB_DEFINE(_name) \ - static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_hb_cb, _name) + static const STRUCT_SECTION_ITERABLE(bt_mesh_hb_cb, _name) /** @brief Get the current Heartbeat publication parameters. * diff --git a/include/bluetooth/mesh/main.h b/include/bluetooth/mesh/main.h index 64355decf82..5853adb7775 100644 --- a/include/bluetooth/mesh/main.h +++ b/include/bluetooth/mesh/main.h @@ -598,10 +598,10 @@ struct bt_mesh_lpn_cb { * * @param _name Name of callback structure. */ -#define BT_MESH_LPN_CB_DEFINE(_name) \ - static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_lpn_cb, \ - _CONCAT(bt_mesh_lpn_cb, \ - _name)) +#define BT_MESH_LPN_CB_DEFINE(_name) \ + static const STRUCT_SECTION_ITERABLE(bt_mesh_lpn_cb, \ + _CONCAT(bt_mesh_lpn_cb, \ + _name)) /** Friend Node callback functions. */ struct bt_mesh_friend_cb { @@ -651,10 +651,10 @@ struct bt_mesh_friend_cb { * * @param _name Name of callback structure. */ -#define BT_MESH_FRIEND_CB_DEFINE(_name) \ - static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_friend_cb, \ - _CONCAT(bt_mesh_friend_cb, \ - _name)) +#define BT_MESH_FRIEND_CB_DEFINE(_name) \ + static const STRUCT_SECTION_ITERABLE(bt_mesh_friend_cb, \ + _CONCAT(bt_mesh_friend_cb, \ + _name)) /** @brief Terminate Friendship. * diff --git a/include/bluetooth/mesh/proxy.h b/include/bluetooth/mesh/proxy.h index b3389a4eeb5..24d2b2713a0 100644 --- a/include/bluetooth/mesh/proxy.h +++ b/include/bluetooth/mesh/proxy.h @@ -50,7 +50,7 @@ struct bt_mesh_proxy_cb { * @param _name Name of callback structure. */ #define BT_MESH_PROXY_CB_DEFINE(_name) \ - static const Z_STRUCT_SECTION_ITERABLE( \ + static const STRUCT_SECTION_ITERABLE( \ bt_mesh_proxy_cb, _CONCAT(bt_mesh_proxy_cb, _name)) /** @brief Enable advertising with Node Identity. diff --git a/include/display/cfb.h b/include/display/cfb.h index 7c36ea150f4..2fdf0f1785a 100644 --- a/include/display/cfb.h +++ b/include/display/cfb.h @@ -68,8 +68,7 @@ struct cfb_font { * @param _lc Character mapped to last font element. */ #define FONT_ENTRY_DEFINE(_name, _width, _height, _caps, _data, _fc, _lc) \ - static const Z_STRUCT_SECTION_ITERABLE(cfb_font, _name) = \ - { \ + static const STRUCT_SECTION_ITERABLE(cfb_font, _name) = { \ .data = _data, \ .caps = _caps, \ .width = _width, \ diff --git a/include/kernel.h b/include/kernel.h index 4c2aea5f0f5..3a254313241 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -671,7 +671,7 @@ struct _static_thread_data { prio, options, delay) \ K_THREAD_STACK_DEFINE(_k_thread_stack_##name, stack_size); \ struct k_thread _k_thread_obj_##name; \ - Z_STRUCT_SECTION_ITERABLE(_static_thread_data, _k_thread_data_##name) =\ + STRUCT_SECTION_ITERABLE(_static_thread_data, _k_thread_data_##name) = \ Z_THREAD_INITIALIZER(&_k_thread_obj_##name, \ _k_thread_stack_##name, stack_size, \ entry, p1, p2, p3, prio, options, delay, \ @@ -1352,7 +1352,7 @@ typedef void (*k_timer_stop_t)(struct k_timer *timer); * @param stop_fn Function to invoke if the timer is stopped while running. */ #define K_TIMER_DEFINE(name, expiry_fn, stop_fn) \ - Z_STRUCT_SECTION_ITERABLE(k_timer, name) = \ + STRUCT_SECTION_ITERABLE(k_timer, name) = \ Z_TIMER_INITIALIZER(name, expiry_fn, stop_fn) /** @@ -1921,7 +1921,7 @@ __syscall void *k_queue_peek_tail(struct k_queue *queue); * @param name Name of the queue. */ #define K_QUEUE_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE(k_queue, name) = \ + STRUCT_SECTION_ITERABLE(k_queue, name) = \ Z_QUEUE_INITIALIZER(name) /** @} */ @@ -2243,7 +2243,7 @@ struct k_fifo { * @param name Name of the FIFO queue. */ #define K_FIFO_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE_ALTERNATE(k_queue, k_fifo, name) = \ + STRUCT_SECTION_ITERABLE_ALTERNATE(k_queue, k_fifo, name) = \ Z_FIFO_INITIALIZER(name) /** @} */ @@ -2367,7 +2367,7 @@ struct k_lifo { * @param name Name of the fifo. */ #define K_LIFO_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE_ALTERNATE(k_queue, k_lifo, name) = \ + STRUCT_SECTION_ITERABLE_ALTERNATE(k_queue, k_lifo, name) = \ Z_LIFO_INITIALIZER(name) /** @} */ @@ -2501,7 +2501,7 @@ __syscall int k_stack_pop(struct k_stack *stack, stack_data_t *data, #define K_STACK_DEFINE(name, stack_num_entries) \ stack_data_t __noinit \ _k_stack_buf_##name[stack_num_entries]; \ - Z_STRUCT_SECTION_ITERABLE(k_stack, name) = \ + STRUCT_SECTION_ITERABLE(k_stack, name) = \ Z_STACK_INITIALIZER(name, _k_stack_buf_##name, \ stack_num_entries) @@ -2569,7 +2569,7 @@ struct k_mutex { * @param name Name of the mutex. */ #define K_MUTEX_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE(k_mutex, name) = \ + STRUCT_SECTION_ITERABLE(k_mutex, name) = \ Z_MUTEX_INITIALIZER(name) /** @@ -2708,7 +2708,7 @@ __syscall int k_condvar_wait(struct k_condvar *condvar, struct k_mutex *mutex, * @param name Name of the condition variable. */ #define K_CONDVAR_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE(k_condvar, name) = \ + STRUCT_SECTION_ITERABLE(k_condvar, name) = \ Z_CONDVAR_INITIALIZER(name) /** * @} @@ -2851,7 +2851,7 @@ static inline unsigned int z_impl_k_sem_count_get(struct k_sem *sem) * @param count_limit Maximum permitted semaphore count. */ #define K_SEM_DEFINE(name, initial_count, count_limit) \ - Z_STRUCT_SECTION_ITERABLE(k_sem, name) = \ + STRUCT_SECTION_ITERABLE(k_sem, name) = \ Z_SEM_INITIALIZER(name, initial_count, count_limit); \ BUILD_ASSERT(((count_limit) != 0) && \ ((initial_count) <= (count_limit)) && \ @@ -4214,7 +4214,7 @@ struct k_msgq_attrs { #define K_MSGQ_DEFINE(q_name, q_msg_size, q_max_msgs, q_align) \ static char __noinit __aligned(q_align) \ _k_fifo_buf_##q_name[(q_max_msgs) * (q_msg_size)]; \ - Z_STRUCT_SECTION_ITERABLE(k_msgq, q_name) = \ + STRUCT_SECTION_ITERABLE(k_msgq, q_name) = \ Z_MSGQ_INITIALIZER(q_name, _k_fifo_buf_##q_name, \ q_msg_size, q_max_msgs) @@ -4466,7 +4466,7 @@ struct k_mbox { * @param name Name of the mailbox. */ #define K_MBOX_DEFINE(name) \ - Z_STRUCT_SECTION_ITERABLE(k_mbox, name) = \ + STRUCT_SECTION_ITERABLE(k_mbox, name) = \ Z_MBOX_INITIALIZER(name) \ /** @@ -4620,9 +4620,9 @@ struct k_pipe { * */ #define K_PIPE_DEFINE(name, pipe_buffer_size, pipe_align) \ - static unsigned char __noinit __aligned(pipe_align) \ + static unsigned char __noinit __aligned(pipe_align) \ _k_pipe_buf_##name[pipe_buffer_size]; \ - Z_STRUCT_SECTION_ITERABLE(k_pipe, name) = \ + STRUCT_SECTION_ITERABLE(k_pipe, name) = \ Z_PIPE_INITIALIZER(name, _k_pipe_buf_##name, pipe_buffer_size) /** @@ -4800,7 +4800,7 @@ struct k_mem_slab { #define K_MEM_SLAB_DEFINE(name, slab_block_size, slab_num_blocks, slab_align) \ char __noinit __aligned(WB_UP(slab_align)) \ _k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \ - Z_STRUCT_SECTION_ITERABLE(k_mem_slab, name) = \ + STRUCT_SECTION_ITERABLE(k_mem_slab, name) = \ Z_MEM_SLAB_INITIALIZER(name, _k_mem_slab_buf_##name, \ WB_UP(slab_block_size), slab_num_blocks) @@ -5025,7 +5025,7 @@ void k_heap_free(struct k_heap *h, void *mem); #define K_HEAP_DEFINE(name, bytes) \ char __aligned(8) /* CHUNK_UNIT */ \ kheap_##name[MAX(bytes, Z_HEAP_MIN_SIZE)]; \ - Z_STRUCT_SECTION_ITERABLE(k_heap, name) = { \ + STRUCT_SECTION_ITERABLE(k_heap, name) = { \ .heap = { \ .init_mem = kheap_##name, \ .init_bytes = MAX(bytes, Z_HEAP_MIN_SIZE), \ diff --git a/include/linker/common-ram.ld b/include/linker/common-ram.ld index a324f4dbcad..6148f518d76 100644 --- a/include/linker/common-ram.ld +++ b/include/linker/common-ram.ld @@ -3,10 +3,10 @@ #if defined(CONFIG_NETWORKING) #ifndef NETWORK_RAM_SECTIONS #define NETWORK_RAM_SECTIONS \ - Z_ITERABLE_SECTION_RAM(net_if, 4) \ - Z_ITERABLE_SECTION_RAM(net_if_dev, 4) \ - Z_ITERABLE_SECTION_RAM(net_l2, 4) \ - Z_ITERABLE_SECTION_RAM(eth_bridge, 4) + ITERABLE_SECTION_RAM(net_if, 4) \ + ITERABLE_SECTION_RAM(net_if_dev, 4) \ + ITERABLE_SECTION_RAM(net_l2, 4) \ + ITERABLE_SECTION_RAM(eth_bridge, 4) #endif #endif /* NETWORKING */ @@ -53,7 +53,7 @@ __log_dynamic_end = .; } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - Z_ITERABLE_SECTION_RAM(_static_thread_data, 4) + ITERABLE_SECTION_RAM(_static_thread_data, 4) #ifdef CONFIG_USERSPACE /* All kernel objects within are assumed to be either completely @@ -66,18 +66,18 @@ _static_kernel_objects_begin = .; #endif /* CONFIG_USERSPACE */ - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4) - Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_condvar, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4) + ITERABLE_SECTION_RAM_GC_ALLOWED(k_condvar, 4) SECTION_DATA_PROLOGUE(_net_buf_pool_area,,SUBALIGN(4)) { diff --git a/include/linker/common-rom.ld b/include/linker/common-rom.ld index 7557a79e7bc..f02601f91e7 100644 --- a/include/linker/common-rom.ld +++ b/include/linker/common-rom.ld @@ -91,7 +91,7 @@ /* Build-time assignment of permissions to kernel objects to * threads declared with K_THREAD_DEFINE() */ - Z_ITERABLE_SECTION_ROM(z_object_assignment, 4) + ITERABLE_SECTION_ROM(z_object_assignment, 4) #endif SECTION_DATA_PROLOGUE(app_shmem_regions,,) @@ -102,53 +102,53 @@ } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) #if defined(CONFIG_NET_SOCKETS) - Z_ITERABLE_SECTION_ROM(net_socket_register, 4) + ITERABLE_SECTION_ROM(net_socket_register, 4) #endif #if defined(CONFIG_NET_L2_PPP) - Z_ITERABLE_SECTION_ROM(ppp_protocol_handler, 4) + ITERABLE_SECTION_ROM(ppp_protocol_handler, 4) #endif - Z_ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4) + ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4) #if defined(CONFIG_BT_BREDR) - Z_ITERABLE_SECTION_ROM(bt_l2cap_br_fixed_chan, 4) + ITERABLE_SECTION_ROM(bt_l2cap_br_fixed_chan, 4) #endif #if defined(CONFIG_BT_CONN) - Z_ITERABLE_SECTION_ROM(bt_conn_cb, 4) + ITERABLE_SECTION_ROM(bt_conn_cb, 4) #endif - Z_ITERABLE_SECTION_ROM(bt_gatt_service_static, 4) + ITERABLE_SECTION_ROM(bt_gatt_service_static, 4) #if defined(CONFIG_BT_MESH) - Z_ITERABLE_SECTION_ROM(bt_mesh_subnet_cb, 4) - Z_ITERABLE_SECTION_ROM(bt_mesh_app_key_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_subnet_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_app_key_cb, 4) - Z_ITERABLE_SECTION_ROM(bt_mesh_hb_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_hb_cb, 4) #endif #if defined(CONFIG_BT_MESH_FRIEND) - Z_ITERABLE_SECTION_ROM(bt_mesh_friend_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_friend_cb, 4) #endif #if defined(CONFIG_BT_MESH_LOW_POWER) - Z_ITERABLE_SECTION_ROM(bt_mesh_lpn_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_lpn_cb, 4) #endif #if defined(CONFIG_BT_MESH_GATT_PROXY) - Z_ITERABLE_SECTION_ROM(bt_mesh_proxy_cb, 4) + ITERABLE_SECTION_ROM(bt_mesh_proxy_cb, 4) #endif #if defined(CONFIG_EC_HOST_CMD) - Z_ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4) + ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4) #endif #if defined(CONFIG_SETTINGS) - Z_ITERABLE_SECTION_ROM(settings_handler_static, 4) + ITERABLE_SECTION_ROM(settings_handler_static, 4) #endif - Z_ITERABLE_SECTION_ROM(k_p4wq_initparam, 4) + ITERABLE_SECTION_ROM(k_p4wq_initparam, 4) #if defined(CONFIG_EMUL) SECTION_DATA_PROLOGUE(emulators_section,,) @@ -160,7 +160,7 @@ #endif /* CONFIG_EMUL */ #if defined(CONFIG_DNS_SD) - Z_ITERABLE_SECTION_ROM(dns_sd_rec, 4) + ITERABLE_SECTION_ROM(dns_sd_rec, 4) #endif #if defined(CONFIG_PCIE) @@ -193,7 +193,7 @@ __log_backends_end = .; } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - Z_ITERABLE_SECTION_ROM(shell, 4) + ITERABLE_SECTION_ROM(shell, 4) SECTION_DATA_PROLOGUE(shell_root_cmds_sections,,) { @@ -209,7 +209,7 @@ __font_entry_end = .; } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - Z_ITERABLE_SECTION_ROM(tracing_backend, 4) + ITERABLE_SECTION_ROM(tracing_backend, 4) SECTION_DATA_PROLOGUE(zephyr_dbg_info,,) { diff --git a/include/logging/log_backend.h b/include/logging/log_backend.h index 6cea3856a68..b9270482c52 100644 --- a/include/logging/log_backend.h +++ b/include/logging/log_backend.h @@ -86,7 +86,7 @@ extern const struct log_backend __log_backends_end[]; .id = 0, \ .active = false, \ }; \ - static const Z_STRUCT_SECTION_ITERABLE(log_backend, _name) = \ + static const STRUCT_SECTION_ITERABLE(log_backend, _name) = \ { \ .api = &_api, \ .cb = &UTIL_CAT(backend_cb_, _name), \ diff --git a/include/mgmt/ec_host_cmd.h b/include/mgmt/ec_host_cmd.h index c5884a69763..1f874bc8d89 100644 --- a/include/mgmt/ec_host_cmd.h +++ b/include/mgmt/ec_host_cmd.h @@ -79,7 +79,7 @@ struct ec_host_cmd_handler { */ #define EC_HOST_CMD_HANDLER(_function, _id, _version_mask, _request_type, \ _response_type) \ - const Z_STRUCT_SECTION_ITERABLE(ec_host_cmd_handler, __cmd##_id) = { \ + const STRUCT_SECTION_ITERABLE(ec_host_cmd_handler, __cmd##_id) = { \ .id = _id, \ .handler = _function, \ .version_mask = _version_mask, \ @@ -100,7 +100,7 @@ struct ec_host_cmd_handler { * supports. E.g. BIT(0) corresponse to version 0. */ #define EC_HOST_CMD_HANDLER_UNBOUND(_function, _id, _version_mask) \ - const Z_STRUCT_SECTION_ITERABLE(ec_host_cmd_handler, __cmd##_id) = { \ + const STRUCT_SECTION_ITERABLE(ec_host_cmd_handler, __cmd##_id) = { \ .id = _id, \ .handler = _function, \ .version_mask = _version_mask, \ diff --git a/include/net/dns_sd.h b/include/net/dns_sd.h index 9b281149336..ae2fe2aed0f 100644 --- a/include/net/dns_sd.h +++ b/include/net/dns_sd.h @@ -76,7 +76,7 @@ extern "C" { */ #define DNS_SD_REGISTER_SERVICE(id, instance, service, proto, domain, \ text, port) \ - static const Z_STRUCT_SECTION_ITERABLE(dns_sd_rec, id) = { \ + static const STRUCT_SECTION_ITERABLE(dns_sd_rec, id) = { \ instance, \ service, \ proto, \ diff --git a/include/net/ethernet_bridge.h b/include/net/ethernet_bridge.h index ad546c56d0a..f92a6b8b70d 100644 --- a/include/net/ethernet_bridge.h +++ b/include/net/ethernet_bridge.h @@ -51,7 +51,7 @@ struct eth_bridge { * @param name Name of the bridge object */ #define ETH_BRIDGE_INIT(name) \ - Z_STRUCT_SECTION_ITERABLE(eth_bridge, name) = \ + STRUCT_SECTION_ITERABLE(eth_bridge, name) = \ ETH_BRIDGE_INITIALIZER(name) struct eth_bridge_iface_context { diff --git a/include/net/net_if.h b/include/net/net_if.h index 8cd1a2a3742..e6c21884c22 100644 --- a/include/net/net_if.h +++ b/include/net/net_if.h @@ -2210,7 +2210,7 @@ struct net_if_api { ((struct net_if *)&NET_IF_GET_NAME(dev_name, sfx)) #define NET_IF_INIT(dev_name, sfx, _l2, _mtu, _num_configs) \ - static Z_STRUCT_SECTION_ITERABLE(net_if_dev, \ + static STRUCT_SECTION_ITERABLE(net_if_dev, \ NET_IF_DEV_GET_NAME(dev_name, sfx)) = { \ .dev = &(DEVICE_NAME_GET(dev_name)), \ .l2 = &(NET_L2_GET_NAME(_l2)), \ @@ -2228,7 +2228,7 @@ struct net_if_api { } #define NET_IF_OFFLOAD_INIT(dev_name, sfx, _mtu) \ - static Z_STRUCT_SECTION_ITERABLE(net_if_dev, \ + static STRUCT_SECTION_ITERABLE(net_if_dev, \ NET_IF_DEV_GET_NAME(dev_name, sfx)) = { \ .dev = &(DEVICE_NAME_GET(dev_name)), \ .mtu = _mtu, \ diff --git a/include/net/net_l2.h b/include/net/net_l2.h index cbbe48473c6..515249f0be2 100644 --- a/include/net/net_l2.h +++ b/include/net/net_l2.h @@ -133,8 +133,8 @@ NET_L2_DECLARE_PUBLIC(CANBUS_L2); #endif /* CONFIG_NET_L2_CANBUS */ #define NET_L2_INIT(_name, _recv_fn, _send_fn, _enable_fn, _get_flags_fn) \ - const Z_STRUCT_SECTION_ITERABLE(net_l2, \ - NET_L2_GET_NAME(_name)) = { \ + const STRUCT_SECTION_ITERABLE(net_l2, \ + NET_L2_GET_NAME(_name)) = { \ .recv = (_recv_fn), \ .send = (_send_fn), \ .enable = (_enable_fn), \ diff --git a/include/net/socket.h b/include/net/socket.h index e3f57c63e15..2ef26ab730c 100644 --- a/include/net/socket.h +++ b/include/net/socket.h @@ -884,7 +884,7 @@ struct net_socket_register { (__net_socket_register_##socket_name) #define NET_SOCKET_REGISTER(socket_name, _family, _is_supported, _handler) \ - static const Z_STRUCT_SECTION_ITERABLE(net_socket_register, \ + static const STRUCT_SECTION_ITERABLE(net_socket_register, \ NET_SOCKET_GET_NAME(socket_name)) = { \ .family = _family, \ .is_supported = _is_supported, \ diff --git a/include/settings/settings.h b/include/settings/settings.h index ef570821041..4127ecc5de6 100644 --- a/include/settings/settings.h +++ b/include/settings/settings.h @@ -199,8 +199,8 @@ struct settings_handler_static { #define SETTINGS_STATIC_HANDLER_DEFINE(_hname, _tree, _get, _set, _commit, \ _export) \ - const Z_STRUCT_SECTION_ITERABLE(settings_handler_static, \ - settings_handler_ ## _hname) = { \ + const STRUCT_SECTION_ITERABLE(settings_handler_static, \ + settings_handler_ ## _hname) = { \ .name = _tree, \ .h_get = _get, \ .h_set = _set, \ diff --git a/include/shell/shell.h b/include/shell/shell.h index ee3e7a8f722..0af25a3ee77 100644 --- a/include/shell/shell.h +++ b/include/shell/shell.h @@ -771,7 +771,7 @@ extern void z_shell_print_stream(const void *user_ctx, const char *data, Z_SHELL_STATS_DEFINE(_name); \ static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \ static struct k_thread _name##_thread; \ - static const Z_STRUCT_SECTION_ITERABLE(shell, _name) = { \ + static const STRUCT_SECTION_ITERABLE(shell, _name) = { \ .default_prompt = _prompt, \ .iface = _transport_iface, \ .ctx = &UTIL_CAT(_name, _ctx), \ diff --git a/include/sys/kobject.h b/include/sys/kobject.h index 09f6655357c..2485ac9127a 100644 --- a/include/sys/kobject.h +++ b/include/sys/kobject.h @@ -110,7 +110,7 @@ struct z_object_assignment { #define K_THREAD_ACCESS_GRANT(name_, ...) \ static void * const _CONCAT(_object_list_, name_)[] = \ { __VA_ARGS__, NULL }; \ - static const Z_STRUCT_SECTION_ITERABLE(z_object_assignment, \ + static const STRUCT_SECTION_ITERABLE(z_object_assignment, \ _CONCAT(_object_access_, name_)) = \ { (&_k_thread_obj_ ## name_), \ (_CONCAT(_object_list_, name_)) } diff --git a/include/sys/p4wq.h b/include/sys/p4wq.h index 09358123520..9b8e9533e1a 100644 --- a/include/sys/p4wq.h +++ b/include/sys/p4wq.h @@ -100,8 +100,8 @@ struct k_p4wq_initparam { n_threads, stack_sz); \ static struct k_thread _p4threads_##name[n_threads]; \ static struct k_p4wq name; \ - static const Z_STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \ - _init_##name) = { \ + static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \ + _init_##name) = { \ .num = n_threads, \ .stack_size = stack_sz, \ .threads = _p4threads_##name, \ @@ -127,8 +127,8 @@ struct k_p4wq_initparam { n_threads, stack_sz); \ static struct k_thread _p4threads_##name[n_threads]; \ static struct k_p4wq name[n_threads]; \ - static const Z_STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \ - _init_##name) = { \ + static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \ + _init_##name) = { \ .num = n_threads, \ .stack_size = stack_sz, \ .threads = _p4threads_##name, \ diff --git a/include/sys/sem.h b/include/sys/sem.h index ccf30efb002..808580a49e1 100644 --- a/include/sys/sem.h +++ b/include/sys/sem.h @@ -71,7 +71,7 @@ struct sys_sem { * are identical and can be treated as a k_sem in the boot initialization code */ #define SYS_SEM_DEFINE(_name, _initial_count, _count_limit) \ - Z_STRUCT_SECTION_ITERABLE_ALTERNATE(k_sem, sys_sem, _name) = { \ + STRUCT_SECTION_ITERABLE_ALTERNATE(k_sem, sys_sem, _name) = { \ .kernel_sem = Z_SEM_INITIALIZER(_name.kernel_sem, \ _initial_count, _count_limit) \ }; \ diff --git a/kernel/kheap.c b/kernel/kheap.c index 8726342aef6..daa34f36a73 100644 --- a/kernel/kheap.c +++ b/kernel/kheap.c @@ -20,7 +20,7 @@ void k_heap_init(struct k_heap *h, void *mem, size_t bytes) static int statics_init(const struct device *unused) { ARG_UNUSED(unused); - Z_STRUCT_SECTION_FOREACH(k_heap, h) { + STRUCT_SECTION_FOREACH(k_heap, h) { k_heap_init(h, h->heap.init_mem, h->heap.init_bytes); } return 0; diff --git a/kernel/mem_slab.c b/kernel/mem_slab.c index e1b53a506e6..ab64eff3b1e 100644 --- a/kernel/mem_slab.c +++ b/kernel/mem_slab.c @@ -57,7 +57,7 @@ static int init_mem_slab_module(const struct device *dev) int rc = 0; ARG_UNUSED(dev); - Z_STRUCT_SECTION_FOREACH(k_mem_slab, slab) { + STRUCT_SECTION_FOREACH(k_mem_slab, slab) { rc = create_free_list(slab); if (rc < 0) { goto out; diff --git a/kernel/thread.c b/kernel/thread.c index b69664f7fea..206374a3c6b 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -44,7 +44,7 @@ static struct k_spinlock z_thread_monitor_lock; #endif /* CONFIG_THREAD_MONITOR */ #define _FOREACH_STATIC_THREAD(thread_data) \ - Z_STRUCT_SECTION_FOREACH(_static_thread_data, thread_data) + STRUCT_SECTION_FOREACH(_static_thread_data, thread_data) void k_thread_foreach(k_thread_user_cb_t user_cb, void *user_data) { @@ -711,7 +711,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, static void grant_static_access(void) { - Z_STRUCT_SECTION_FOREACH(z_object_assignment, pos) { + STRUCT_SECTION_FOREACH(z_object_assignment, pos) { for (int i = 0; pos->objects[i] != NULL; i++) { k_object_access_grant(pos->objects[i], pos->thread); diff --git a/lib/os/p4wq.c b/lib/os/p4wq.c index c2b811ff152..8424ddaacd6 100644 --- a/lib/os/p4wq.c +++ b/lib/os/p4wq.c @@ -143,7 +143,7 @@ static int static_init(const struct device *dev) { ARG_UNUSED(dev); - Z_STRUCT_SECTION_FOREACH(k_p4wq_initparam, pp) { + STRUCT_SECTION_FOREACH(k_p4wq_initparam, pp) { for (int i = 0; i < pp->num; i++) { uintptr_t ssz = K_THREAD_STACK_LEN(pp->stack_size); struct k_p4wq *q = pp->flags & K_P4WQ_QUEUE_PER_THREAD ? diff --git a/soc/xtensa/esp32/linker.ld b/soc/xtensa/esp32/linker.ld index 76be1f7bcae..d1c0fedd615 100644 --- a/soc/xtensa/esp32/linker.ld +++ b/soc/xtensa/esp32/linker.ld @@ -188,19 +188,19 @@ SECTIONS } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - Z_ITERABLE_SECTION_RAM(_static_thread_data, 4) + ITERABLE_SECTION_RAM(_static_thread_data, 4) -#pragma push_macro("Z_ITERABLE_SECTION_RAM") -#pragma push_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED") -#undef Z_ITERABLE_SECTION_RAM_GC_ALLOWED -#define Z_ITERABLE_SECTION_RAM_GC_ALLOWED(x, y) -#undef Z_ITERABLE_SECTION_RAM -#define Z_ITERABLE_SECTION_RAM(x, y) +#pragma push_macro("ITERABLE_SECTION_RAM") +#pragma push_macro("ITERABLE_SECTION_RAM_GC_ALLOWED") +#undef ITERABLE_SECTION_RAM_GC_ALLOWED +#define ITERABLE_SECTION_RAM_GC_ALLOWED(x, y) +#undef ITERABLE_SECTION_RAM +#define ITERABLE_SECTION_RAM(x, y) #include /* Restore original value for symbols referenced by `common-ram.ld` */ _net_buf_pool_list = _esp_net_buf_pool_list; -#pragma pop_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED") -#pragma pop_macro("Z_ITERABLE_SECTION_RAM") +#pragma pop_macro("ITERABLE_SECTION_RAM_GC_ALLOWED") +#pragma pop_macro("ITERABLE_SECTION_RAM") .dram0.data : { @@ -355,10 +355,10 @@ _net_buf_pool_list = _esp_net_buf_pool_list; _rodata_end = ABSOLUTE(.); } GROUP_LINK_IN(ROMABLE_REGION) -#pragma push_macro("Z_ITERABLE_SECTION_ROM") +#pragma push_macro("ITERABLE_SECTION_ROM") #pragma push_macro("ROMABLE_REGION") -#undef Z_ITERABLE_SECTION_ROM -#define Z_ITERABLE_SECTION_ROM(x,y) +#undef ITERABLE_SECTION_ROM +#define ITERABLE_SECTION_ROM(x,y) #undef ROMABLE_REGION /* This is to workaround limitation of `esptool` which needs single `FLASH` data segment * which is already defined above. In case, `common-rom.ld` creates additional segments @@ -373,7 +373,7 @@ __log_backends_end = __esp_log_backends_end; __shell_root_cmds_start = __esp_shell_root_cmds_start; __shell_root_cmds_end = __esp_shell_root_cmds_end; #pragma pop_macro("ROMABLE_REGION") -#pragma pop_macro("Z_ITERABLE_SECTION_ROM") +#pragma pop_macro("ITERABLE_SECTION_ROM") SECTION_PROLOGUE(_TEXT_SECTION_NAME, , ALIGN(4)) { diff --git a/soc/xtensa/esp32s2/linker.ld b/soc/xtensa/esp32s2/linker.ld index 760d7b6e4a3..f05534666b8 100644 --- a/soc/xtensa/esp32s2/linker.ld +++ b/soc/xtensa/esp32s2/linker.ld @@ -183,19 +183,19 @@ SECTIONS } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) - Z_ITERABLE_SECTION_RAM(_static_thread_data, 4) + ITERABLE_SECTION_RAM(_static_thread_data, 4) -#pragma push_macro("Z_ITERABLE_SECTION_RAM") -#pragma push_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED") -#undef Z_ITERABLE_SECTION_RAM_GC_ALLOWED -#define Z_ITERABLE_SECTION_RAM_GC_ALLOWED(x, y) -#undef Z_ITERABLE_SECTION_RAM -#define Z_ITERABLE_SECTION_RAM(x, y) +#pragma push_macro("ITERABLE_SECTION_RAM") +#pragma push_macro("ITERABLE_SECTION_RAM_GC_ALLOWED") +#undef ITERABLE_SECTION_RAM_GC_ALLOWED +#define ITERABLE_SECTION_RAM_GC_ALLOWED(x, y) +#undef ITERABLE_SECTION_RAM +#define ITERABLE_SECTION_RAM(x, y) #include /* Restore original value for symbols referenced by `common-ram.ld` */ _net_buf_pool_list = _esp_net_buf_pool_list; -#pragma pop_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED") -#pragma pop_macro("Z_ITERABLE_SECTION_RAM") +#pragma pop_macro("ITERABLE_SECTION_RAM_GC_ALLOWED") +#pragma pop_macro("ITERABLE_SECTION_RAM") #include diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index b82a7c46848..ef748840d9a 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1196,7 +1196,7 @@ static void notify_connected(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->connected) { cb->connected(conn, conn->err); } @@ -1217,7 +1217,7 @@ static void notify_disconnected(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->disconnected) { cb->disconnected(conn, conn->err); } @@ -1243,7 +1243,7 @@ void notify_remote_info(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->remote_info_available) { cb->remote_info_available(conn, &remote_info); } @@ -1274,7 +1274,7 @@ void notify_le_param_updated(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->le_param_updated) { cb->le_param_updated(conn, conn->le.interval, conn->le.latency, @@ -1294,7 +1294,7 @@ void notify_le_data_len_updated(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->le_data_len_updated) { cb->le_data_len_updated(conn, &conn->le.data_len); } @@ -1313,7 +1313,7 @@ void notify_le_phy_updated(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->le_phy_updated) { cb->le_phy_updated(conn, &conn->le.phy); } @@ -1346,7 +1346,7 @@ bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (!cb->le_param_req) { continue; } @@ -1790,7 +1790,7 @@ void bt_conn_identity_resolved(struct bt_conn *conn) } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->identity_resolved) { cb->identity_resolved(conn, rpa, &conn->le.dst); } @@ -1895,7 +1895,7 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err, } } - Z_STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_conn_cb, cb) { if (cb->security_changed) { cb->security_changed(conn, conn->sec_level, err); } diff --git a/subsys/bluetooth/host/gatt.c b/subsys/bluetooth/host/gatt.c index f9334052b3b..1e7e121c206 100644 --- a/subsys/bluetooth/host/gatt.c +++ b/subsys/bluetooth/host/gatt.c @@ -1094,7 +1094,7 @@ static void bt_gatt_service_init(void) return; } - Z_STRUCT_SECTION_FOREACH(bt_gatt_service_static, svc) { + STRUCT_SECTION_FOREACH(bt_gatt_service_static, svc) { last_static_handle += svc->attr_count; } } @@ -1391,7 +1391,7 @@ uint16_t bt_gatt_attr_get_handle(const struct bt_gatt_attr *attr) return attr->handle; } - Z_STRUCT_SECTION_FOREACH(bt_gatt_service_static, static_svc) { + STRUCT_SECTION_FOREACH(bt_gatt_service_static, static_svc) { /* Skip ahead if start is not within service attributes array */ if ((attr < &static_svc->attrs[0]) || (attr > &static_svc->attrs[static_svc->attr_count - 1])) { @@ -1587,7 +1587,7 @@ void bt_gatt_foreach_attr_type(uint16_t start_handle, uint16_t end_handle, if (start_handle <= last_static_handle) { uint16_t handle = 1; - Z_STRUCT_SECTION_FOREACH(bt_gatt_service_static, static_svc) { + STRUCT_SECTION_FOREACH(bt_gatt_service_static, static_svc) { /* Skip ahead if start is not within service handles */ if (handle + static_svc->attr_count < start_handle) { handle += static_svc->attr_count; diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index de413737e18..29431288151 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -354,7 +354,7 @@ void bt_l2cap_connected(struct bt_conn *conn) return; } - Z_STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) { + STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) { struct bt_l2cap_le_chan *ch; if (fchan->accept(conn, &chan) < 0) { diff --git a/subsys/bluetooth/host/l2cap_br.c b/subsys/bluetooth/host/l2cap_br.c index e3946c08c54..8e027120972 100644 --- a/subsys/bluetooth/host/l2cap_br.c +++ b/subsys/bluetooth/host/l2cap_br.c @@ -401,7 +401,7 @@ static uint8_t get_fixed_channels_mask(void) uint8_t mask = 0U; /* this needs to be enhanced if AMP Test Manager support is added */ - Z_STRUCT_SECTION_FOREACH(bt_l2cap_br_fixed_chan, fchan) { + STRUCT_SECTION_FOREACH(bt_l2cap_br_fixed_chan, fchan) { mask |= BIT(fchan->cid); } @@ -466,7 +466,7 @@ void bt_l2cap_br_connected(struct bt_conn *conn) { struct bt_l2cap_chan *chan; - Z_STRUCT_SECTION_FOREACH(bt_l2cap_br_fixed_chan, fchan) { + STRUCT_SECTION_FOREACH(bt_l2cap_br_fixed_chan, fchan) { struct bt_l2cap_br_chan *ch; if (!fchan->accept) { diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index ff9f324c4ca..03331027bc9 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -234,7 +234,7 @@ struct bt_l2cap_fixed_chan { }; #define BT_L2CAP_CHANNEL_DEFINE(_name, _cid, _accept, _destroy) \ - const Z_STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, _name) = { \ + const STRUCT_SECTION_ITERABLE(bt_l2cap_fixed_chan, _name) = { \ .cid = _cid, \ .accept = _accept, \ .destroy = _destroy, \ @@ -247,7 +247,7 @@ struct bt_l2cap_br_fixed_chan { }; #define BT_L2CAP_BR_CHANNEL_DEFINE(_name, _cid, _accept) \ - const Z_STRUCT_SECTION_ITERABLE(bt_l2cap_br_fixed_chan, _name) = { \ + const STRUCT_SECTION_ITERABLE(bt_l2cap_br_fixed_chan, _name) = { \ .cid = _cid, \ .accept = _accept, \ } diff --git a/subsys/bluetooth/mesh/app_keys.c b/subsys/bluetooth/mesh/app_keys.c index d932f9617b4..2762672175b 100644 --- a/subsys/bluetooth/mesh/app_keys.c +++ b/subsys/bluetooth/mesh/app_keys.c @@ -175,7 +175,7 @@ static void update_app_key_settings(uint16_t app_idx, bool store) static void app_key_evt(struct app_key *app, enum bt_mesh_key_evt evt) { - Z_STRUCT_SECTION_FOREACH(bt_mesh_app_key_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_app_key_cb, cb) { cb->evt_handler(app->app_idx, app->net_idx, evt); } } diff --git a/subsys/bluetooth/mesh/friend.c b/subsys/bluetooth/mesh/friend.c index 993325a1255..568d455d974 100644 --- a/subsys/bluetooth/mesh/friend.c +++ b/subsys/bluetooth/mesh/friend.c @@ -176,7 +176,7 @@ static void friend_clear(struct bt_mesh_friend *frnd) seg->seg_count = 0U; } - Z_STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { if (frnd->established && cb->terminated) { cb->terminated(frnd->subnet->net_idx, frnd->lpn); } @@ -709,7 +709,7 @@ int bt_mesh_friend_poll(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) friend_recv_delay(frnd); - Z_STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { if (cb->polled) { cb->polled(frnd->subnet->net_idx, frnd->lpn); } @@ -719,7 +719,7 @@ int bt_mesh_friend_poll(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) BT_DBG("Friendship established with 0x%04x", frnd->lpn); frnd->established = 1U; - Z_STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) { if (cb->established) { cb->established(frnd->subnet->net_idx, frnd->lpn, frnd->recv_delay, frnd->poll_to); diff --git a/subsys/bluetooth/mesh/gatt_services.c b/subsys/bluetooth/mesh/gatt_services.c index 3207e7dd26e..07339b8ad2a 100644 --- a/subsys/bluetooth/mesh/gatt_services.c +++ b/subsys/bluetooth/mesh/gatt_services.c @@ -376,7 +376,7 @@ static void node_id_start(struct bt_mesh_subnet *sub) sub->node_id = BT_MESH_NODE_IDENTITY_RUNNING; sub->node_id_start = k_uptime_get_32(); - Z_STRUCT_SECTION_FOREACH(bt_mesh_proxy_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_proxy_cb, cb) { if (cb->identity_enabled) { cb->identity_enabled(sub->net_idx); } @@ -396,7 +396,7 @@ void bt_mesh_proxy_identity_stop(struct bt_mesh_subnet *sub) sub->node_id = BT_MESH_NODE_IDENTITY_STOPPED; sub->node_id_start = 0U; - Z_STRUCT_SECTION_FOREACH(bt_mesh_proxy_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_proxy_cb, cb) { if (cb->identity_disabled) { cb->identity_disabled(sub->net_idx); } diff --git a/subsys/bluetooth/mesh/heartbeat.c b/subsys/bluetooth/mesh/heartbeat.c index d9a5b1f8e00..f7c22ecba4c 100644 --- a/subsys/bluetooth/mesh/heartbeat.c +++ b/subsys/bluetooth/mesh/heartbeat.c @@ -60,7 +60,7 @@ static void notify_recv(uint8_t hops, uint16_t feat) { sub.remaining = sub_remaining(); - Z_STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) { if (cb->recv) { cb->recv(&sub, hops, feat); } @@ -71,7 +71,7 @@ static void notify_sub_end(void) { sub.remaining = 0; - Z_STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) { if (cb->sub_end) { cb->sub_end(&sub); } diff --git a/subsys/bluetooth/mesh/lpn.c b/subsys/bluetooth/mesh/lpn.c index 978718d5777..786b03e8dbf 100644 --- a/subsys/bluetooth/mesh/lpn.c +++ b/subsys/bluetooth/mesh/lpn.c @@ -240,7 +240,7 @@ static void clear_friendship(bool force, bool disable) lpn->old_friend = lpn->frnd; } - Z_STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { if (cb->terminated && lpn->frnd != BT_MESH_ADDR_UNASSIGNED) { cb->terminated(lpn->sub->net_idx, lpn->frnd); } @@ -356,7 +356,7 @@ static void req_sent(uint16_t duration, int err, void *user_data) return; } - Z_STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { if (cb->polled) { cb->polled(lpn->sub->net_idx, lpn->frnd, !!(lpn->req_attempts)); } @@ -1007,7 +1007,7 @@ int bt_mesh_lpn_friend_update(struct bt_mesh_net_rx *rx, bt_mesh_hb_feature_changed(BT_MESH_FEAT_LOW_POWER); - Z_STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) { if (cb->established) { cb->established(lpn->sub->net_idx, lpn->frnd, lpn->queue_size, lpn->recv_win); diff --git a/subsys/bluetooth/mesh/mesh.h b/subsys/bluetooth/mesh/mesh.h index 6dcbd2a32df..6e16ff15b70 100644 --- a/subsys/bluetooth/mesh/mesh.h +++ b/subsys/bluetooth/mesh/mesh.h @@ -27,8 +27,8 @@ struct bt_mesh_app_key_cb { * @param _handler Handler function, see @ref bt_mesh_app_key_cb::evt_handler. */ #define BT_MESH_APP_KEY_CB_DEFINE(_handler) \ - static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_app_key_cb, \ - _CONCAT(bt_mesh_app_key_cb_, \ + static const STRUCT_SECTION_ITERABLE(bt_mesh_app_key_cb, \ + _CONCAT(bt_mesh_app_key_cb_, \ _handler)) = { \ .evt_handler = (_handler), \ } diff --git a/subsys/bluetooth/mesh/subnet.c b/subsys/bluetooth/mesh/subnet.c index be90bbd37e9..04b8e8a6744 100644 --- a/subsys/bluetooth/mesh/subnet.c +++ b/subsys/bluetooth/mesh/subnet.c @@ -67,7 +67,7 @@ static struct bt_mesh_subnet subnets[CONFIG_BT_MESH_SUBNET_COUNT] = { static void subnet_evt(struct bt_mesh_subnet *sub, enum bt_mesh_key_evt evt) { - Z_STRUCT_SECTION_FOREACH(bt_mesh_subnet_cb, cb) { + STRUCT_SECTION_FOREACH(bt_mesh_subnet_cb, cb) { cb->evt_handler(sub, evt); } } diff --git a/subsys/bluetooth/mesh/subnet.h b/subsys/bluetooth/mesh/subnet.h index d0f43837013..ee61dc50182 100644 --- a/subsys/bluetooth/mesh/subnet.h +++ b/subsys/bluetooth/mesh/subnet.h @@ -79,7 +79,7 @@ struct bt_mesh_subnet_cb { * @param _handler Handler function, see @ref bt_mesh_subnet_cb::evt_handler. */ #define BT_MESH_SUBNET_CB_DEFINE(_handler) \ - static const Z_STRUCT_SECTION_ITERABLE( \ + static const STRUCT_SECTION_ITERABLE( \ bt_mesh_subnet_cb, _CONCAT(bt_mesh_subnet_cb_, _handler)) = { \ .evt_handler = (_handler), \ } 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 a598041d559..1bab0941622 100644 --- a/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c +++ b/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c @@ -116,7 +116,7 @@ static void handle_host_cmds_entry(void *arg1, void *arg2, void *arg3) const struct ec_host_cmd_handler *found_handler = NULL; - Z_STRUCT_SECTION_FOREACH(ec_host_cmd_handler, handler) + STRUCT_SECTION_FOREACH(ec_host_cmd_handler, handler) { if (handler->id == rx_header->cmd_id) { found_handler = handler; diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index dddd0a68ccd..b27487898cc 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -371,7 +371,7 @@ void net_if_queue_tx(struct net_if *iface, struct net_pkt *pkt) void net_if_stats_reset(struct net_if *iface) { #if defined(CONFIG_NET_STATISTICS_PER_INTERFACE) - Z_STRUCT_SECTION_FOREACH(net_if, tmp) { + STRUCT_SECTION_FOREACH(net_if, tmp) { if (iface == tmp) { memset(&iface->stats, 0, sizeof(iface->stats)); return; @@ -387,7 +387,7 @@ void net_if_stats_reset_all(void) #if defined(CONFIG_NET_STATISTICS_PER_INTERFACE) k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { memset(&iface->stats, 0, sizeof(iface->stats)); } @@ -524,7 +524,7 @@ int net_if_set_link_addr_locked(struct net_if *iface, struct net_if *net_if_get_by_link_addr(struct net_linkaddr *ll_addr) { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (!memcmp(net_if_get_link_addr(iface)->addr, ll_addr->addr, ll_addr->len)) { return iface; @@ -536,7 +536,7 @@ struct net_if *net_if_get_by_link_addr(struct net_linkaddr *ll_addr) struct net_if *net_if_lookup_by_dev(const struct device *dev) { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (net_if_get_device(iface) == dev) { return iface; } @@ -583,7 +583,7 @@ struct net_if *net_if_get_default(void) struct net_if *net_if_get_first_by_type(const struct net_l2 *l2) { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (IS_ENABLED(CONFIG_NET_OFFLOAD) && !l2 && net_if_offload(iface)) { return iface; @@ -1288,7 +1288,7 @@ static void rs_timeout(struct k_work *work) /* Did not receive RA yet. */ ipv6->rs_count++; - Z_STRUCT_SECTION_FOREACH(net_if, tmp) { + STRUCT_SECTION_FOREACH(net_if, tmp) { if (tmp->config.ip.ipv6 == ipv6) { iface = tmp; break; @@ -1381,7 +1381,7 @@ struct net_if_addr *net_if_ipv6_addr_lookup(const struct in6_addr *addr, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6; int i; @@ -1921,7 +1921,7 @@ struct net_if_mcast_addr *net_if_ipv6_maddr_lookup(const struct in6_addr *maddr, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6; int i; @@ -2355,7 +2355,7 @@ bool net_if_ipv6_addr_onlink(struct net_if **iface, struct in6_addr *addr) k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, tmp) { + STRUCT_SECTION_FOREACH(net_if, tmp) { struct net_if_ipv6 *ipv6 = tmp->config.ip.ipv6; int i; @@ -2529,7 +2529,7 @@ struct in6_addr *net_if_ipv6_get_ll_addr(enum net_addr_state state, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, tmp) { + STRUCT_SECTION_FOREACH(net_if, tmp) { addr = net_if_ipv6_get_ll(tmp, state); if (addr) { if (iface) { @@ -2578,7 +2578,7 @@ struct in6_addr *net_if_ipv6_get_global_addr(enum net_addr_state state, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, tmp) { + STRUCT_SECTION_FOREACH(net_if, tmp) { if (iface && *iface && tmp != *iface) { continue; } @@ -2666,7 +2666,7 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface, src = net_if_ipv6_get_best_match(dst_iface, dst, &best_match); } else { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct in6_addr *addr; addr = net_if_ipv6_get_best_match(iface, dst, @@ -2681,7 +2681,7 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface, if (dst_iface) { src = net_if_ipv6_get_ll(dst_iface, NET_ADDR_PREFERRED); } else { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct in6_addr *addr; addr = net_if_ipv6_get_ll(iface, @@ -3036,7 +3036,7 @@ bool net_if_ipv4_is_addr_bcast(struct net_if *iface, goto out; } - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { ret = ipv4_is_broadcast_address(iface, addr); if (ret) { goto out; @@ -3055,7 +3055,7 @@ struct net_if *net_if_ipv4_select_src_iface(const struct in_addr *dst) k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { bool ret; ret = net_if_ipv4_addr_mask_cmp(iface, dst); @@ -3193,7 +3193,7 @@ const struct in_addr *net_if_ipv4_select_src_addr(struct net_if *dst_iface, src = net_if_ipv4_get_best_match(dst_iface, dst, &best_match); } else { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct in_addr *addr; addr = net_if_ipv4_get_best_match(iface, dst, @@ -3208,7 +3208,7 @@ const struct in_addr *net_if_ipv4_select_src_addr(struct net_if *dst_iface, if (dst_iface) { src = net_if_ipv4_get_ll(dst_iface, NET_ADDR_PREFERRED); } else { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct in_addr *addr; addr = net_if_ipv4_get_ll(iface, @@ -3244,7 +3244,7 @@ struct net_if_addr *net_if_ipv4_addr_lookup(const struct in_addr *addr, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4; int i; @@ -3710,7 +3710,7 @@ struct net_if_mcast_addr *net_if_ipv4_maddr_lookup(const struct in_addr *maddr, k_mutex_lock(&lock, K_FOREVER); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (ret && *ret && iface != *ret) { continue; } @@ -3949,7 +3949,7 @@ int net_if_get_by_iface(struct net_if *iface) void net_if_foreach(net_if_cb_t cb, void *user_data) { - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { cb(iface, user_data); } } @@ -4279,7 +4279,7 @@ void net_if_init(void) net_tc_tx_init(); - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { init_iface(iface); if_count++; } @@ -4307,7 +4307,7 @@ void net_if_init(void) */ if_count = 0; - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (net_if_l2(iface) == &NET_L2_GET_NAME(ETHERNET)) { if_count++; } @@ -4329,7 +4329,7 @@ void net_if_post_init(void) NET_DBG(""); /* After TX is running, attempt to bring the interface up */ - Z_STRUCT_SECTION_FOREACH(net_if, iface) { + STRUCT_SECTION_FOREACH(net_if, iface) { if (!net_if_flag_is_set(iface, NET_IF_NO_AUTO_START)) { net_if_up(iface); } diff --git a/subsys/net/l2/ethernet/bridge.c b/subsys/net/l2/ethernet/bridge.c index 2df15dba44a..b467c85f1ef 100644 --- a/subsys/net/l2/ethernet/bridge.c +++ b/subsys/net/l2/ethernet/bridge.c @@ -22,7 +22,7 @@ extern struct eth_bridge _eth_bridge_list_end[]; void net_eth_bridge_foreach(eth_bridge_cb_t cb, void *user_data) { - Z_STRUCT_SECTION_FOREACH(eth_bridge, br) { + STRUCT_SECTION_FOREACH(eth_bridge, br) { cb(br, user_data); } } diff --git a/subsys/net/l2/ppp/link.c b/subsys/net/l2/ppp/link.c index dd6d9cc8087..48f7b24711d 100644 --- a/subsys/net/l2/ppp/link.c +++ b/subsys/net/l2/ppp/link.c @@ -18,7 +18,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL); static void lcp_up(struct ppp_context *ctx) { - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol == PPP_LCP) { continue; } @@ -33,7 +33,7 @@ static void do_network(struct ppp_context *ctx) { ppp_change_phase(ctx, PPP_NETWORK); - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol == PPP_CCP || proto->protocol == PPP_ECP) { if (proto->open) { proto->open(ctx); @@ -46,7 +46,7 @@ static void do_network(struct ppp_context *ctx) */ /* TODO possible encryption stuff here*/ - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol == PPP_CCP || proto->protocol == PPP_ECP || proto->protocol >= 0xC000) { continue; @@ -83,7 +83,7 @@ static void do_auth(struct ppp_context *ctx) return; } - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol == auth_proto) { if (proto->open) { proto->open(ctx); diff --git a/subsys/net/l2/ppp/network.c b/subsys/net/l2/ppp/network.c index d368f757c17..790e85a611f 100644 --- a/subsys/net/l2/ppp/network.c +++ b/subsys/net/l2/ppp/network.c @@ -55,7 +55,7 @@ void ppp_network_done(struct ppp_context *ctx, int proto) void ppp_network_all_down(struct ppp_context *ctx) { - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol != PPP_LCP && proto->lower_down) { proto->lower_down(ctx); } diff --git a/subsys/net/l2/ppp/ppp_internal.h b/subsys/net/l2/ppp/ppp_internal.h index 765a68b1eaf..8c682c638b3 100644 --- a/subsys/net/l2/ppp/ppp_internal.h +++ b/subsys/net/l2/ppp/ppp_internal.h @@ -90,7 +90,7 @@ int ppp_config_info_req(struct ppp_fsm *fsm, #define PPP_PROTOCOL_REGISTER(name, proto, init_func, proto_handler, \ proto_lower_up, proto_lower_down, \ proto_open, proto_close) \ - static const Z_STRUCT_SECTION_ITERABLE(ppp_protocol_handler, \ + static const STRUCT_SECTION_ITERABLE(ppp_protocol_handler, \ PPP_PROTO_GET_NAME(name)) = { \ .protocol = proto, \ .init = init_func, \ diff --git a/subsys/net/l2/ppp/ppp_l2.c b/subsys/net/l2/ppp/ppp_l2.c index 82d0e9925ed..ff6eb31d83c 100644 --- a/subsys/net/l2/ppp/ppp_l2.c +++ b/subsys/net/l2/ppp/ppp_l2.c @@ -95,7 +95,7 @@ static enum net_verdict process_ppp_msg(struct net_if *iface, return NET_CONTINUE; } - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol != protocol) { continue; } @@ -414,7 +414,7 @@ static void ppp_startup(struct k_work *work) NET_DBG("PPP %p startup for interface %p", ctx, ctx->iface); - Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { + STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) { if (proto->protocol == PPP_LCP) { ppp_lcp = proto; } diff --git a/subsys/net/lib/dns/dns_sd.h b/subsys/net/lib/dns/dns_sd.h index 3e594806dfb..d73b31a698a 100644 --- a/subsys/net/lib/dns/dns_sd.h +++ b/subsys/net/lib/dns/dns_sd.h @@ -30,7 +30,7 @@ extern "C" { #endif #define DNS_SD_FOREACH(it) \ - Z_STRUCT_SECTION_FOREACH(dns_sd_rec, it) + STRUCT_SECTION_FOREACH(dns_sd_rec, it) /** * @brief Extract the Service, Protocol, and Domain from a DNS-SD PTR query diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index e14ecdc930d..6ff33c41b85 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -208,7 +208,7 @@ int zsock_socket_internal(int family, int type, int proto) int z_impl_zsock_socket(int family, int type, int proto) { - Z_STRUCT_SECTION_FOREACH(net_socket_register, sock_family) { + STRUCT_SECTION_FOREACH(net_socket_register, sock_family) { if (sock_family->family != family && sock_family->family != AF_UNSPEC) { continue; diff --git a/subsys/settings/src/settings.c b/subsys/settings/src/settings.c index 5c8df59453a..73f447ee86e 100644 --- a/subsys/settings/src/settings.c +++ b/subsys/settings/src/settings.c @@ -40,7 +40,7 @@ int settings_register(struct settings_handler *handler) { int rc = 0; - Z_STRUCT_SECTION_FOREACH(settings_handler_static, ch) { + STRUCT_SECTION_FOREACH(settings_handler_static, ch) { if (strcmp(handler->name, ch->name) == 0) { return -EEXIST; } @@ -145,7 +145,7 @@ struct settings_handler_static *settings_parse_and_lookup(const char *name, *next = NULL; } - Z_STRUCT_SECTION_FOREACH(settings_handler_static, ch) { + STRUCT_SECTION_FOREACH(settings_handler_static, ch) { if (!settings_name_steq(name, ch->name, &tmpnext)) { continue; } @@ -241,7 +241,7 @@ int settings_commit_subtree(const char *subtree) rc = 0; - Z_STRUCT_SECTION_FOREACH(settings_handler_static, ch) { + STRUCT_SECTION_FOREACH(settings_handler_static, ch) { if (subtree && !settings_name_steq(ch->name, subtree, NULL)) { continue; } diff --git a/subsys/settings/src/settings_store.c b/subsys/settings/src/settings_store.c index dda56d76213..56ee7b42c89 100644 --- a/subsys/settings/src/settings_store.c +++ b/subsys/settings/src/settings_store.c @@ -131,7 +131,7 @@ int settings_save(void) } rc = 0; - Z_STRUCT_SECTION_FOREACH(settings_handler_static, ch) { + STRUCT_SECTION_FOREACH(settings_handler_static, ch) { if (ch->h_export) { rc2 = ch->h_export(settings_save_one); if (!rc) { diff --git a/subsys/shell/shell_utils.c b/subsys/shell/shell_utils.c index 132dc6e6970..57683704566 100644 --- a/subsys/shell/shell_utils.c +++ b/subsys/shell/shell_utils.c @@ -363,7 +363,7 @@ int shell_set_root_cmd(const char *cmd) return -EINVAL; } - Z_STRUCT_SECTION_FOREACH(shell, sh) { + STRUCT_SECTION_FOREACH(shell, sh) { sh->ctx->selected_cmd = entry; } diff --git a/subsys/tracing/include/tracing_backend.h b/subsys/tracing/include/tracing_backend.h index 2b4eb172be5..e38225d9520 100644 --- a/subsys/tracing/include/tracing_backend.h +++ b/subsys/tracing/include/tracing_backend.h @@ -47,8 +47,7 @@ struct tracing_backend { * @param _api Tracing backend API. */ #define TRACING_BACKEND_DEFINE(_name, _api) \ - static const Z_STRUCT_SECTION_ITERABLE(tracing_backend, _name) = \ - { \ + static const STRUCT_SECTION_ITERABLE(tracing_backend, _name) = { \ .name = STRINGIFY(_name), \ .api = &_api \ } @@ -92,7 +91,7 @@ static inline void tracing_backend_output( */ static inline struct tracing_backend *tracing_backend_get(char *name) { - Z_STRUCT_SECTION_FOREACH(tracing_backend, backend) { + STRUCT_SECTION_FOREACH(tracing_backend, backend) { if (strcmp(backend->name, name) == 0) { return backend; }