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 <fabiobaltieri@google.com>
This commit is contained in:
parent
34d2ca613f
commit
f88a420d69
54 changed files with 188 additions and 190 deletions
|
@ -38,8 +38,8 @@ SECTION_DATA_PROLOGUE(net_if_area,,SUBALIGN(4)) \
|
||||||
KEEP(*(SORT_BY_NAME(._net_if.static.*))); \
|
KEEP(*(SORT_BY_NAME(._net_if.static.*))); \
|
||||||
_net_if_list_end = .; \
|
_net_if_list_end = .; \
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) \
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) \
|
||||||
Z_ITERABLE_SECTION_RAM(net_if_dev, 4) \
|
ITERABLE_SECTION_RAM(net_if_dev, 4) \
|
||||||
Z_ITERABLE_SECTION_RAM(net_l2, 4) \
|
ITERABLE_SECTION_RAM(net_l2, 4) \
|
||||||
Z_ITERABLE_SECTION_RAM(eth_bridge, 4)
|
ITERABLE_SECTION_RAM(eth_bridge, 4)
|
||||||
|
|
||||||
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld>
|
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld>
|
||||||
|
|
|
@ -939,7 +939,7 @@ void bt_conn_cb_register(struct bt_conn_cb *cb);
|
||||||
* @param _name Name of callback structure.
|
* @param _name Name of callback structure.
|
||||||
*/
|
*/
|
||||||
#define BT_CONN_CB_DEFINE(_name) \
|
#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, \
|
_CONCAT(bt_conn_cb, \
|
||||||
_name))
|
_name))
|
||||||
|
|
||||||
|
|
|
@ -519,8 +519,8 @@ ssize_t bt_gatt_attr_read_service(struct bt_conn *conn,
|
||||||
*/
|
*/
|
||||||
#define BT_GATT_SERVICE_DEFINE(_name, ...) \
|
#define BT_GATT_SERVICE_DEFINE(_name, ...) \
|
||||||
const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
|
const struct bt_gatt_attr attr_##_name[] = { __VA_ARGS__ }; \
|
||||||
const Z_STRUCT_SECTION_ITERABLE(bt_gatt_service_static, _name) =\
|
const STRUCT_SECTION_ITERABLE(bt_gatt_service_static, _name) = \
|
||||||
BT_GATT_SERVICE(attr_##_name)
|
BT_GATT_SERVICE(attr_##_name)
|
||||||
|
|
||||||
#define _BT_GATT_ATTRS_ARRAY_DEFINE(n, _instances, _attrs_def) \
|
#define _BT_GATT_ATTRS_ARRAY_DEFINE(n, _instances, _attrs_def) \
|
||||||
static struct bt_gatt_attr attrs_##n[] = _attrs_def(_instances[n]);
|
static struct bt_gatt_attr attrs_##n[] = _attrs_def(_instances[n]);
|
||||||
|
|
|
@ -111,7 +111,7 @@ struct bt_mesh_hb_cb {
|
||||||
* @param _name Name of callback structure.
|
* @param _name Name of callback structure.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_HB_CB_DEFINE(_name) \
|
#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.
|
/** @brief Get the current Heartbeat publication parameters.
|
||||||
*
|
*
|
||||||
|
|
|
@ -598,10 +598,10 @@ struct bt_mesh_lpn_cb {
|
||||||
*
|
*
|
||||||
* @param _name Name of callback structure.
|
* @param _name Name of callback structure.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_LPN_CB_DEFINE(_name) \
|
#define BT_MESH_LPN_CB_DEFINE(_name) \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_lpn_cb, \
|
static const STRUCT_SECTION_ITERABLE(bt_mesh_lpn_cb, \
|
||||||
_CONCAT(bt_mesh_lpn_cb, \
|
_CONCAT(bt_mesh_lpn_cb, \
|
||||||
_name))
|
_name))
|
||||||
|
|
||||||
/** Friend Node callback functions. */
|
/** Friend Node callback functions. */
|
||||||
struct bt_mesh_friend_cb {
|
struct bt_mesh_friend_cb {
|
||||||
|
@ -651,10 +651,10 @@ struct bt_mesh_friend_cb {
|
||||||
*
|
*
|
||||||
* @param _name Name of callback structure.
|
* @param _name Name of callback structure.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_FRIEND_CB_DEFINE(_name) \
|
#define BT_MESH_FRIEND_CB_DEFINE(_name) \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_friend_cb, \
|
static const STRUCT_SECTION_ITERABLE(bt_mesh_friend_cb, \
|
||||||
_CONCAT(bt_mesh_friend_cb, \
|
_CONCAT(bt_mesh_friend_cb, \
|
||||||
_name))
|
_name))
|
||||||
|
|
||||||
/** @brief Terminate Friendship.
|
/** @brief Terminate Friendship.
|
||||||
*
|
*
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct bt_mesh_proxy_cb {
|
||||||
* @param _name Name of callback structure.
|
* @param _name Name of callback structure.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_PROXY_CB_DEFINE(_name) \
|
#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))
|
bt_mesh_proxy_cb, _CONCAT(bt_mesh_proxy_cb, _name))
|
||||||
|
|
||||||
/** @brief Enable advertising with Node Identity.
|
/** @brief Enable advertising with Node Identity.
|
||||||
|
|
|
@ -68,8 +68,7 @@ struct cfb_font {
|
||||||
* @param _lc Character mapped to last font element.
|
* @param _lc Character mapped to last font element.
|
||||||
*/
|
*/
|
||||||
#define FONT_ENTRY_DEFINE(_name, _width, _height, _caps, _data, _fc, _lc) \
|
#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, \
|
.data = _data, \
|
||||||
.caps = _caps, \
|
.caps = _caps, \
|
||||||
.width = _width, \
|
.width = _width, \
|
||||||
|
|
|
@ -671,7 +671,7 @@ struct _static_thread_data {
|
||||||
prio, options, delay) \
|
prio, options, delay) \
|
||||||
K_THREAD_STACK_DEFINE(_k_thread_stack_##name, stack_size); \
|
K_THREAD_STACK_DEFINE(_k_thread_stack_##name, stack_size); \
|
||||||
struct k_thread _k_thread_obj_##name; \
|
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, \
|
Z_THREAD_INITIALIZER(&_k_thread_obj_##name, \
|
||||||
_k_thread_stack_##name, stack_size, \
|
_k_thread_stack_##name, stack_size, \
|
||||||
entry, p1, p2, p3, prio, options, delay, \
|
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.
|
* @param stop_fn Function to invoke if the timer is stopped while running.
|
||||||
*/
|
*/
|
||||||
#define K_TIMER_DEFINE(name, expiry_fn, stop_fn) \
|
#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)
|
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.
|
* @param name Name of the queue.
|
||||||
*/
|
*/
|
||||||
#define K_QUEUE_DEFINE(name) \
|
#define K_QUEUE_DEFINE(name) \
|
||||||
Z_STRUCT_SECTION_ITERABLE(k_queue, name) = \
|
STRUCT_SECTION_ITERABLE(k_queue, name) = \
|
||||||
Z_QUEUE_INITIALIZER(name)
|
Z_QUEUE_INITIALIZER(name)
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
@ -2243,7 +2243,7 @@ struct k_fifo {
|
||||||
* @param name Name of the FIFO queue.
|
* @param name Name of the FIFO queue.
|
||||||
*/
|
*/
|
||||||
#define K_FIFO_DEFINE(name) \
|
#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)
|
Z_FIFO_INITIALIZER(name)
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
@ -2367,7 +2367,7 @@ struct k_lifo {
|
||||||
* @param name Name of the fifo.
|
* @param name Name of the fifo.
|
||||||
*/
|
*/
|
||||||
#define K_LIFO_DEFINE(name) \
|
#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)
|
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) \
|
#define K_STACK_DEFINE(name, stack_num_entries) \
|
||||||
stack_data_t __noinit \
|
stack_data_t __noinit \
|
||||||
_k_stack_buf_##name[stack_num_entries]; \
|
_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, \
|
Z_STACK_INITIALIZER(name, _k_stack_buf_##name, \
|
||||||
stack_num_entries)
|
stack_num_entries)
|
||||||
|
|
||||||
|
@ -2569,7 +2569,7 @@ struct k_mutex {
|
||||||
* @param name Name of the mutex.
|
* @param name Name of the mutex.
|
||||||
*/
|
*/
|
||||||
#define K_MUTEX_DEFINE(name) \
|
#define K_MUTEX_DEFINE(name) \
|
||||||
Z_STRUCT_SECTION_ITERABLE(k_mutex, name) = \
|
STRUCT_SECTION_ITERABLE(k_mutex, name) = \
|
||||||
Z_MUTEX_INITIALIZER(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.
|
* @param name Name of the condition variable.
|
||||||
*/
|
*/
|
||||||
#define K_CONDVAR_DEFINE(name) \
|
#define K_CONDVAR_DEFINE(name) \
|
||||||
Z_STRUCT_SECTION_ITERABLE(k_condvar, name) = \
|
STRUCT_SECTION_ITERABLE(k_condvar, name) = \
|
||||||
Z_CONDVAR_INITIALIZER(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.
|
* @param count_limit Maximum permitted semaphore count.
|
||||||
*/
|
*/
|
||||||
#define K_SEM_DEFINE(name, initial_count, count_limit) \
|
#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); \
|
Z_SEM_INITIALIZER(name, initial_count, count_limit); \
|
||||||
BUILD_ASSERT(((count_limit) != 0) && \
|
BUILD_ASSERT(((count_limit) != 0) && \
|
||||||
((initial_count) <= (count_limit)) && \
|
((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) \
|
#define K_MSGQ_DEFINE(q_name, q_msg_size, q_max_msgs, q_align) \
|
||||||
static char __noinit __aligned(q_align) \
|
static char __noinit __aligned(q_align) \
|
||||||
_k_fifo_buf_##q_name[(q_max_msgs) * (q_msg_size)]; \
|
_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, \
|
Z_MSGQ_INITIALIZER(q_name, _k_fifo_buf_##q_name, \
|
||||||
q_msg_size, q_max_msgs)
|
q_msg_size, q_max_msgs)
|
||||||
|
|
||||||
|
@ -4466,7 +4466,7 @@ struct k_mbox {
|
||||||
* @param name Name of the mailbox.
|
* @param name Name of the mailbox.
|
||||||
*/
|
*/
|
||||||
#define K_MBOX_DEFINE(name) \
|
#define K_MBOX_DEFINE(name) \
|
||||||
Z_STRUCT_SECTION_ITERABLE(k_mbox, name) = \
|
STRUCT_SECTION_ITERABLE(k_mbox, name) = \
|
||||||
Z_MBOX_INITIALIZER(name) \
|
Z_MBOX_INITIALIZER(name) \
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4620,9 +4620,9 @@ struct k_pipe {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define K_PIPE_DEFINE(name, pipe_buffer_size, pipe_align) \
|
#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]; \
|
_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)
|
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) \
|
#define K_MEM_SLAB_DEFINE(name, slab_block_size, slab_num_blocks, slab_align) \
|
||||||
char __noinit __aligned(WB_UP(slab_align)) \
|
char __noinit __aligned(WB_UP(slab_align)) \
|
||||||
_k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \
|
_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, \
|
Z_MEM_SLAB_INITIALIZER(name, _k_mem_slab_buf_##name, \
|
||||||
WB_UP(slab_block_size), slab_num_blocks)
|
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) \
|
#define K_HEAP_DEFINE(name, bytes) \
|
||||||
char __aligned(8) /* CHUNK_UNIT */ \
|
char __aligned(8) /* CHUNK_UNIT */ \
|
||||||
kheap_##name[MAX(bytes, Z_HEAP_MIN_SIZE)]; \
|
kheap_##name[MAX(bytes, Z_HEAP_MIN_SIZE)]; \
|
||||||
Z_STRUCT_SECTION_ITERABLE(k_heap, name) = { \
|
STRUCT_SECTION_ITERABLE(k_heap, name) = { \
|
||||||
.heap = { \
|
.heap = { \
|
||||||
.init_mem = kheap_##name, \
|
.init_mem = kheap_##name, \
|
||||||
.init_bytes = MAX(bytes, Z_HEAP_MIN_SIZE), \
|
.init_bytes = MAX(bytes, Z_HEAP_MIN_SIZE), \
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
#if defined(CONFIG_NETWORKING)
|
#if defined(CONFIG_NETWORKING)
|
||||||
#ifndef NETWORK_RAM_SECTIONS
|
#ifndef NETWORK_RAM_SECTIONS
|
||||||
#define NETWORK_RAM_SECTIONS \
|
#define NETWORK_RAM_SECTIONS \
|
||||||
Z_ITERABLE_SECTION_RAM(net_if, 4) \
|
ITERABLE_SECTION_RAM(net_if, 4) \
|
||||||
Z_ITERABLE_SECTION_RAM(net_if_dev, 4) \
|
ITERABLE_SECTION_RAM(net_if_dev, 4) \
|
||||||
Z_ITERABLE_SECTION_RAM(net_l2, 4) \
|
ITERABLE_SECTION_RAM(net_l2, 4) \
|
||||||
Z_ITERABLE_SECTION_RAM(eth_bridge, 4)
|
ITERABLE_SECTION_RAM(eth_bridge, 4)
|
||||||
#endif
|
#endif
|
||||||
#endif /* NETWORKING */
|
#endif /* NETWORKING */
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
__log_dynamic_end = .;
|
__log_dynamic_end = .;
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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
|
#ifdef CONFIG_USERSPACE
|
||||||
/* All kernel objects within are assumed to be either completely
|
/* All kernel objects within are assumed to be either completely
|
||||||
|
@ -66,18 +66,18 @@
|
||||||
_static_kernel_objects_begin = .;
|
_static_kernel_objects_begin = .;
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4)
|
||||||
Z_ITERABLE_SECTION_RAM_GC_ALLOWED(k_condvar, 4)
|
ITERABLE_SECTION_RAM_GC_ALLOWED(k_condvar, 4)
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_net_buf_pool_area,,SUBALIGN(4))
|
SECTION_DATA_PROLOGUE(_net_buf_pool_area,,SUBALIGN(4))
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
/* Build-time assignment of permissions to kernel objects to
|
/* Build-time assignment of permissions to kernel objects to
|
||||||
* threads declared with K_THREAD_DEFINE()
|
* threads declared with K_THREAD_DEFINE()
|
||||||
*/
|
*/
|
||||||
Z_ITERABLE_SECTION_ROM(z_object_assignment, 4)
|
ITERABLE_SECTION_ROM(z_object_assignment, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(app_shmem_regions,,)
|
SECTION_DATA_PROLOGUE(app_shmem_regions,,)
|
||||||
|
@ -102,53 +102,53 @@
|
||||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||||
|
|
||||||
#if defined(CONFIG_NET_SOCKETS)
|
#if defined(CONFIG_NET_SOCKETS)
|
||||||
Z_ITERABLE_SECTION_ROM(net_socket_register, 4)
|
ITERABLE_SECTION_ROM(net_socket_register, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NET_L2_PPP)
|
#if defined(CONFIG_NET_L2_PPP)
|
||||||
Z_ITERABLE_SECTION_ROM(ppp_protocol_handler, 4)
|
ITERABLE_SECTION_ROM(ppp_protocol_handler, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Z_ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4)
|
ITERABLE_SECTION_ROM(bt_l2cap_fixed_chan, 4)
|
||||||
|
|
||||||
#if defined(CONFIG_BT_BREDR)
|
#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
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CONN)
|
#if defined(CONFIG_BT_CONN)
|
||||||
Z_ITERABLE_SECTION_ROM(bt_conn_cb, 4)
|
ITERABLE_SECTION_ROM(bt_conn_cb, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Z_ITERABLE_SECTION_ROM(bt_gatt_service_static, 4)
|
ITERABLE_SECTION_ROM(bt_gatt_service_static, 4)
|
||||||
|
|
||||||
#if defined(CONFIG_BT_MESH)
|
#if defined(CONFIG_BT_MESH)
|
||||||
Z_ITERABLE_SECTION_ROM(bt_mesh_subnet_cb, 4)
|
ITERABLE_SECTION_ROM(bt_mesh_subnet_cb, 4)
|
||||||
Z_ITERABLE_SECTION_ROM(bt_mesh_app_key_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
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_MESH_FRIEND)
|
#if defined(CONFIG_BT_MESH_FRIEND)
|
||||||
Z_ITERABLE_SECTION_ROM(bt_mesh_friend_cb, 4)
|
ITERABLE_SECTION_ROM(bt_mesh_friend_cb, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_MESH_LOW_POWER)
|
#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
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_MESH_GATT_PROXY)
|
#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
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_EC_HOST_CMD)
|
#if defined(CONFIG_EC_HOST_CMD)
|
||||||
Z_ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4)
|
ITERABLE_SECTION_ROM(ec_host_cmd_handler, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SETTINGS)
|
#if defined(CONFIG_SETTINGS)
|
||||||
Z_ITERABLE_SECTION_ROM(settings_handler_static, 4)
|
ITERABLE_SECTION_ROM(settings_handler_static, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Z_ITERABLE_SECTION_ROM(k_p4wq_initparam, 4)
|
ITERABLE_SECTION_ROM(k_p4wq_initparam, 4)
|
||||||
|
|
||||||
#if defined(CONFIG_EMUL)
|
#if defined(CONFIG_EMUL)
|
||||||
SECTION_DATA_PROLOGUE(emulators_section,,)
|
SECTION_DATA_PROLOGUE(emulators_section,,)
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
#endif /* CONFIG_EMUL */
|
#endif /* CONFIG_EMUL */
|
||||||
|
|
||||||
#if defined(CONFIG_DNS_SD)
|
#if defined(CONFIG_DNS_SD)
|
||||||
Z_ITERABLE_SECTION_ROM(dns_sd_rec, 4)
|
ITERABLE_SECTION_ROM(dns_sd_rec, 4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_PCIE)
|
#if defined(CONFIG_PCIE)
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
__log_backends_end = .;
|
__log_backends_end = .;
|
||||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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,,)
|
SECTION_DATA_PROLOGUE(shell_root_cmds_sections,,)
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
__font_entry_end = .;
|
__font_entry_end = .;
|
||||||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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,,)
|
SECTION_DATA_PROLOGUE(zephyr_dbg_info,,)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ extern const struct log_backend __log_backends_end[];
|
||||||
.id = 0, \
|
.id = 0, \
|
||||||
.active = false, \
|
.active = false, \
|
||||||
}; \
|
}; \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(log_backend, _name) = \
|
static const STRUCT_SECTION_ITERABLE(log_backend, _name) = \
|
||||||
{ \
|
{ \
|
||||||
.api = &_api, \
|
.api = &_api, \
|
||||||
.cb = &UTIL_CAT(backend_cb_, _name), \
|
.cb = &UTIL_CAT(backend_cb_, _name), \
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct ec_host_cmd_handler {
|
||||||
*/
|
*/
|
||||||
#define EC_HOST_CMD_HANDLER(_function, _id, _version_mask, _request_type, \
|
#define EC_HOST_CMD_HANDLER(_function, _id, _version_mask, _request_type, \
|
||||||
_response_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, \
|
.id = _id, \
|
||||||
.handler = _function, \
|
.handler = _function, \
|
||||||
.version_mask = _version_mask, \
|
.version_mask = _version_mask, \
|
||||||
|
@ -100,7 +100,7 @@ struct ec_host_cmd_handler {
|
||||||
* supports. E.g. BIT(0) corresponse to version 0.
|
* supports. E.g. BIT(0) corresponse to version 0.
|
||||||
*/
|
*/
|
||||||
#define EC_HOST_CMD_HANDLER_UNBOUND(_function, _id, _version_mask) \
|
#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, \
|
.id = _id, \
|
||||||
.handler = _function, \
|
.handler = _function, \
|
||||||
.version_mask = _version_mask, \
|
.version_mask = _version_mask, \
|
||||||
|
|
|
@ -76,7 +76,7 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define DNS_SD_REGISTER_SERVICE(id, instance, service, proto, domain, \
|
#define DNS_SD_REGISTER_SERVICE(id, instance, service, proto, domain, \
|
||||||
text, port) \
|
text, port) \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(dns_sd_rec, id) = { \
|
static const STRUCT_SECTION_ITERABLE(dns_sd_rec, id) = { \
|
||||||
instance, \
|
instance, \
|
||||||
service, \
|
service, \
|
||||||
proto, \
|
proto, \
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct eth_bridge {
|
||||||
* @param name Name of the bridge object
|
* @param name Name of the bridge object
|
||||||
*/
|
*/
|
||||||
#define ETH_BRIDGE_INIT(name) \
|
#define ETH_BRIDGE_INIT(name) \
|
||||||
Z_STRUCT_SECTION_ITERABLE(eth_bridge, name) = \
|
STRUCT_SECTION_ITERABLE(eth_bridge, name) = \
|
||||||
ETH_BRIDGE_INITIALIZER(name)
|
ETH_BRIDGE_INITIALIZER(name)
|
||||||
|
|
||||||
struct eth_bridge_iface_context {
|
struct eth_bridge_iface_context {
|
||||||
|
|
|
@ -2210,7 +2210,7 @@ struct net_if_api {
|
||||||
((struct net_if *)&NET_IF_GET_NAME(dev_name, sfx))
|
((struct net_if *)&NET_IF_GET_NAME(dev_name, sfx))
|
||||||
|
|
||||||
#define NET_IF_INIT(dev_name, sfx, _l2, _mtu, _num_configs) \
|
#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)) = { \
|
NET_IF_DEV_GET_NAME(dev_name, sfx)) = { \
|
||||||
.dev = &(DEVICE_NAME_GET(dev_name)), \
|
.dev = &(DEVICE_NAME_GET(dev_name)), \
|
||||||
.l2 = &(NET_L2_GET_NAME(_l2)), \
|
.l2 = &(NET_L2_GET_NAME(_l2)), \
|
||||||
|
@ -2228,7 +2228,7 @@ struct net_if_api {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NET_IF_OFFLOAD_INIT(dev_name, sfx, _mtu) \
|
#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)) = { \
|
NET_IF_DEV_GET_NAME(dev_name, sfx)) = { \
|
||||||
.dev = &(DEVICE_NAME_GET(dev_name)), \
|
.dev = &(DEVICE_NAME_GET(dev_name)), \
|
||||||
.mtu = _mtu, \
|
.mtu = _mtu, \
|
||||||
|
|
|
@ -133,8 +133,8 @@ NET_L2_DECLARE_PUBLIC(CANBUS_L2);
|
||||||
#endif /* CONFIG_NET_L2_CANBUS */
|
#endif /* CONFIG_NET_L2_CANBUS */
|
||||||
|
|
||||||
#define NET_L2_INIT(_name, _recv_fn, _send_fn, _enable_fn, _get_flags_fn) \
|
#define NET_L2_INIT(_name, _recv_fn, _send_fn, _enable_fn, _get_flags_fn) \
|
||||||
const Z_STRUCT_SECTION_ITERABLE(net_l2, \
|
const STRUCT_SECTION_ITERABLE(net_l2, \
|
||||||
NET_L2_GET_NAME(_name)) = { \
|
NET_L2_GET_NAME(_name)) = { \
|
||||||
.recv = (_recv_fn), \
|
.recv = (_recv_fn), \
|
||||||
.send = (_send_fn), \
|
.send = (_send_fn), \
|
||||||
.enable = (_enable_fn), \
|
.enable = (_enable_fn), \
|
||||||
|
|
|
@ -884,7 +884,7 @@ struct net_socket_register {
|
||||||
(__net_socket_register_##socket_name)
|
(__net_socket_register_##socket_name)
|
||||||
|
|
||||||
#define NET_SOCKET_REGISTER(socket_name, _family, _is_supported, _handler) \
|
#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)) = { \
|
NET_SOCKET_GET_NAME(socket_name)) = { \
|
||||||
.family = _family, \
|
.family = _family, \
|
||||||
.is_supported = _is_supported, \
|
.is_supported = _is_supported, \
|
||||||
|
|
|
@ -199,8 +199,8 @@ struct settings_handler_static {
|
||||||
|
|
||||||
#define SETTINGS_STATIC_HANDLER_DEFINE(_hname, _tree, _get, _set, _commit, \
|
#define SETTINGS_STATIC_HANDLER_DEFINE(_hname, _tree, _get, _set, _commit, \
|
||||||
_export) \
|
_export) \
|
||||||
const Z_STRUCT_SECTION_ITERABLE(settings_handler_static, \
|
const STRUCT_SECTION_ITERABLE(settings_handler_static, \
|
||||||
settings_handler_ ## _hname) = { \
|
settings_handler_ ## _hname) = { \
|
||||||
.name = _tree, \
|
.name = _tree, \
|
||||||
.h_get = _get, \
|
.h_get = _get, \
|
||||||
.h_set = _set, \
|
.h_set = _set, \
|
||||||
|
|
|
@ -771,7 +771,7 @@ extern void z_shell_print_stream(const void *user_ctx, const char *data,
|
||||||
Z_SHELL_STATS_DEFINE(_name); \
|
Z_SHELL_STATS_DEFINE(_name); \
|
||||||
static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \
|
static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \
|
||||||
static struct k_thread _name##_thread; \
|
static struct k_thread _name##_thread; \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(shell, _name) = { \
|
static const STRUCT_SECTION_ITERABLE(shell, _name) = { \
|
||||||
.default_prompt = _prompt, \
|
.default_prompt = _prompt, \
|
||||||
.iface = _transport_iface, \
|
.iface = _transport_iface, \
|
||||||
.ctx = &UTIL_CAT(_name, _ctx), \
|
.ctx = &UTIL_CAT(_name, _ctx), \
|
||||||
|
|
|
@ -110,7 +110,7 @@ struct z_object_assignment {
|
||||||
#define K_THREAD_ACCESS_GRANT(name_, ...) \
|
#define K_THREAD_ACCESS_GRANT(name_, ...) \
|
||||||
static void * const _CONCAT(_object_list_, name_)[] = \
|
static void * const _CONCAT(_object_list_, name_)[] = \
|
||||||
{ __VA_ARGS__, NULL }; \
|
{ __VA_ARGS__, NULL }; \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(z_object_assignment, \
|
static const STRUCT_SECTION_ITERABLE(z_object_assignment, \
|
||||||
_CONCAT(_object_access_, name_)) = \
|
_CONCAT(_object_access_, name_)) = \
|
||||||
{ (&_k_thread_obj_ ## name_), \
|
{ (&_k_thread_obj_ ## name_), \
|
||||||
(_CONCAT(_object_list_, name_)) }
|
(_CONCAT(_object_list_, name_)) }
|
||||||
|
|
|
@ -100,8 +100,8 @@ struct k_p4wq_initparam {
|
||||||
n_threads, stack_sz); \
|
n_threads, stack_sz); \
|
||||||
static struct k_thread _p4threads_##name[n_threads]; \
|
static struct k_thread _p4threads_##name[n_threads]; \
|
||||||
static struct k_p4wq name; \
|
static struct k_p4wq name; \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
|
static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
|
||||||
_init_##name) = { \
|
_init_##name) = { \
|
||||||
.num = n_threads, \
|
.num = n_threads, \
|
||||||
.stack_size = stack_sz, \
|
.stack_size = stack_sz, \
|
||||||
.threads = _p4threads_##name, \
|
.threads = _p4threads_##name, \
|
||||||
|
@ -127,8 +127,8 @@ struct k_p4wq_initparam {
|
||||||
n_threads, stack_sz); \
|
n_threads, stack_sz); \
|
||||||
static struct k_thread _p4threads_##name[n_threads]; \
|
static struct k_thread _p4threads_##name[n_threads]; \
|
||||||
static struct k_p4wq name[n_threads]; \
|
static struct k_p4wq name[n_threads]; \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
|
static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
|
||||||
_init_##name) = { \
|
_init_##name) = { \
|
||||||
.num = n_threads, \
|
.num = n_threads, \
|
||||||
.stack_size = stack_sz, \
|
.stack_size = stack_sz, \
|
||||||
.threads = _p4threads_##name, \
|
.threads = _p4threads_##name, \
|
||||||
|
|
|
@ -71,7 +71,7 @@ struct sys_sem {
|
||||||
* are identical and can be treated as a k_sem in the boot initialization code
|
* are identical and can be treated as a k_sem in the boot initialization code
|
||||||
*/
|
*/
|
||||||
#define SYS_SEM_DEFINE(_name, _initial_count, _count_limit) \
|
#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, \
|
.kernel_sem = Z_SEM_INITIALIZER(_name.kernel_sem, \
|
||||||
_initial_count, _count_limit) \
|
_initial_count, _count_limit) \
|
||||||
}; \
|
}; \
|
||||||
|
|
|
@ -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)
|
static int statics_init(const struct device *unused)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(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);
|
k_heap_init(h, h->heap.init_mem, h->heap.init_bytes);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -57,7 +57,7 @@ static int init_mem_slab_module(const struct device *dev)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
ARG_UNUSED(dev);
|
ARG_UNUSED(dev);
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(k_mem_slab, slab) {
|
STRUCT_SECTION_FOREACH(k_mem_slab, slab) {
|
||||||
rc = create_free_list(slab);
|
rc = create_free_list(slab);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -44,7 +44,7 @@ static struct k_spinlock z_thread_monitor_lock;
|
||||||
#endif /* CONFIG_THREAD_MONITOR */
|
#endif /* CONFIG_THREAD_MONITOR */
|
||||||
|
|
||||||
#define _FOREACH_STATIC_THREAD(thread_data) \
|
#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)
|
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)
|
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++) {
|
for (int i = 0; pos->objects[i] != NULL; i++) {
|
||||||
k_object_access_grant(pos->objects[i],
|
k_object_access_grant(pos->objects[i],
|
||||||
pos->thread);
|
pos->thread);
|
||||||
|
|
|
@ -143,7 +143,7 @@ static int static_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(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++) {
|
for (int i = 0; i < pp->num; i++) {
|
||||||
uintptr_t ssz = K_THREAD_STACK_LEN(pp->stack_size);
|
uintptr_t ssz = K_THREAD_STACK_LEN(pp->stack_size);
|
||||||
struct k_p4wq *q = pp->flags & K_P4WQ_QUEUE_PER_THREAD ?
|
struct k_p4wq *q = pp->flags & K_P4WQ_QUEUE_PER_THREAD ?
|
||||||
|
|
|
@ -188,19 +188,19 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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("ITERABLE_SECTION_RAM")
|
||||||
#pragma push_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED")
|
#pragma push_macro("ITERABLE_SECTION_RAM_GC_ALLOWED")
|
||||||
#undef Z_ITERABLE_SECTION_RAM_GC_ALLOWED
|
#undef ITERABLE_SECTION_RAM_GC_ALLOWED
|
||||||
#define Z_ITERABLE_SECTION_RAM_GC_ALLOWED(x, y)
|
#define ITERABLE_SECTION_RAM_GC_ALLOWED(x, y)
|
||||||
#undef Z_ITERABLE_SECTION_RAM
|
#undef ITERABLE_SECTION_RAM
|
||||||
#define Z_ITERABLE_SECTION_RAM(x, y)
|
#define ITERABLE_SECTION_RAM(x, y)
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
/* Restore original value for symbols referenced by `common-ram.ld` */
|
/* Restore original value for symbols referenced by `common-ram.ld` */
|
||||||
_net_buf_pool_list = _esp_net_buf_pool_list;
|
_net_buf_pool_list = _esp_net_buf_pool_list;
|
||||||
#pragma pop_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED")
|
#pragma pop_macro("ITERABLE_SECTION_RAM_GC_ALLOWED")
|
||||||
#pragma pop_macro("Z_ITERABLE_SECTION_RAM")
|
#pragma pop_macro("ITERABLE_SECTION_RAM")
|
||||||
|
|
||||||
.dram0.data :
|
.dram0.data :
|
||||||
{
|
{
|
||||||
|
@ -355,10 +355,10 @@ _net_buf_pool_list = _esp_net_buf_pool_list;
|
||||||
_rodata_end = ABSOLUTE(.);
|
_rodata_end = ABSOLUTE(.);
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
#pragma push_macro("Z_ITERABLE_SECTION_ROM")
|
#pragma push_macro("ITERABLE_SECTION_ROM")
|
||||||
#pragma push_macro("ROMABLE_REGION")
|
#pragma push_macro("ROMABLE_REGION")
|
||||||
#undef Z_ITERABLE_SECTION_ROM
|
#undef ITERABLE_SECTION_ROM
|
||||||
#define Z_ITERABLE_SECTION_ROM(x,y)
|
#define ITERABLE_SECTION_ROM(x,y)
|
||||||
#undef ROMABLE_REGION
|
#undef ROMABLE_REGION
|
||||||
/* This is to workaround limitation of `esptool` which needs single `FLASH` data segment
|
/* 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
|
* 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_start = __esp_shell_root_cmds_start;
|
||||||
__shell_root_cmds_end = __esp_shell_root_cmds_end;
|
__shell_root_cmds_end = __esp_shell_root_cmds_end;
|
||||||
#pragma pop_macro("ROMABLE_REGION")
|
#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))
|
SECTION_PROLOGUE(_TEXT_SECTION_NAME, , ALIGN(4))
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,19 +183,19 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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("ITERABLE_SECTION_RAM")
|
||||||
#pragma push_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED")
|
#pragma push_macro("ITERABLE_SECTION_RAM_GC_ALLOWED")
|
||||||
#undef Z_ITERABLE_SECTION_RAM_GC_ALLOWED
|
#undef ITERABLE_SECTION_RAM_GC_ALLOWED
|
||||||
#define Z_ITERABLE_SECTION_RAM_GC_ALLOWED(x, y)
|
#define ITERABLE_SECTION_RAM_GC_ALLOWED(x, y)
|
||||||
#undef Z_ITERABLE_SECTION_RAM
|
#undef ITERABLE_SECTION_RAM
|
||||||
#define Z_ITERABLE_SECTION_RAM(x, y)
|
#define ITERABLE_SECTION_RAM(x, y)
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
/* Restore original value for symbols referenced by `common-ram.ld` */
|
/* Restore original value for symbols referenced by `common-ram.ld` */
|
||||||
_net_buf_pool_list = _esp_net_buf_pool_list;
|
_net_buf_pool_list = _esp_net_buf_pool_list;
|
||||||
#pragma pop_macro("Z_ITERABLE_SECTION_RAM_GC_ALLOWED")
|
#pragma pop_macro("ITERABLE_SECTION_RAM_GC_ALLOWED")
|
||||||
#pragma pop_macro("Z_ITERABLE_SECTION_RAM")
|
#pragma pop_macro("ITERABLE_SECTION_RAM")
|
||||||
|
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
if (cb->connected) {
|
||||||
cb->connected(conn, conn->err);
|
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) {
|
if (cb->disconnected) {
|
||||||
cb->disconnected(conn, conn->err);
|
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) {
|
if (cb->remote_info_available) {
|
||||||
cb->remote_info_available(conn, &remote_info);
|
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) {
|
if (cb->le_param_updated) {
|
||||||
cb->le_param_updated(conn, conn->le.interval,
|
cb->le_param_updated(conn, conn->le.interval,
|
||||||
conn->le.latency,
|
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) {
|
if (cb->le_data_len_updated) {
|
||||||
cb->le_data_len_updated(conn, &conn->le.data_len);
|
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) {
|
if (cb->le_phy_updated) {
|
||||||
cb->le_phy_updated(conn, &conn->le.phy);
|
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) {
|
if (!cb->le_param_req) {
|
||||||
continue;
|
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) {
|
if (cb->identity_resolved) {
|
||||||
cb->identity_resolved(conn, rpa, &conn->le.dst);
|
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) {
|
if (cb->security_changed) {
|
||||||
cb->security_changed(conn, conn->sec_level, err);
|
cb->security_changed(conn, conn->sec_level, err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1094,7 +1094,7 @@ static void bt_gatt_service_init(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_gatt_service_static, svc) {
|
STRUCT_SECTION_FOREACH(bt_gatt_service_static, svc) {
|
||||||
last_static_handle += svc->attr_count;
|
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;
|
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 */
|
/* Skip ahead if start is not within service attributes array */
|
||||||
if ((attr < &static_svc->attrs[0]) ||
|
if ((attr < &static_svc->attrs[0]) ||
|
||||||
(attr > &static_svc->attrs[static_svc->attr_count - 1])) {
|
(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) {
|
if (start_handle <= last_static_handle) {
|
||||||
uint16_t handle = 1;
|
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 */
|
/* Skip ahead if start is not within service handles */
|
||||||
if (handle + static_svc->attr_count < start_handle) {
|
if (handle + static_svc->attr_count < start_handle) {
|
||||||
handle += static_svc->attr_count;
|
handle += static_svc->attr_count;
|
||||||
|
|
|
@ -354,7 +354,7 @@ void bt_l2cap_connected(struct bt_conn *conn)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) {
|
STRUCT_SECTION_FOREACH(bt_l2cap_fixed_chan, fchan) {
|
||||||
struct bt_l2cap_le_chan *ch;
|
struct bt_l2cap_le_chan *ch;
|
||||||
|
|
||||||
if (fchan->accept(conn, &chan) < 0) {
|
if (fchan->accept(conn, &chan) < 0) {
|
||||||
|
|
|
@ -401,7 +401,7 @@ static uint8_t get_fixed_channels_mask(void)
|
||||||
uint8_t mask = 0U;
|
uint8_t mask = 0U;
|
||||||
|
|
||||||
/* this needs to be enhanced if AMP Test Manager support is added */
|
/* 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);
|
mask |= BIT(fchan->cid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ void bt_l2cap_br_connected(struct bt_conn *conn)
|
||||||
{
|
{
|
||||||
struct bt_l2cap_chan *chan;
|
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;
|
struct bt_l2cap_br_chan *ch;
|
||||||
|
|
||||||
if (!fchan->accept) {
|
if (!fchan->accept) {
|
||||||
|
|
|
@ -234,7 +234,7 @@ struct bt_l2cap_fixed_chan {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BT_L2CAP_CHANNEL_DEFINE(_name, _cid, _accept, _destroy) \
|
#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, \
|
.cid = _cid, \
|
||||||
.accept = _accept, \
|
.accept = _accept, \
|
||||||
.destroy = _destroy, \
|
.destroy = _destroy, \
|
||||||
|
@ -247,7 +247,7 @@ struct bt_l2cap_br_fixed_chan {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BT_L2CAP_BR_CHANNEL_DEFINE(_name, _cid, _accept) \
|
#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, \
|
.cid = _cid, \
|
||||||
.accept = _accept, \
|
.accept = _accept, \
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
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);
|
cb->evt_handler(app->app_idx, app->net_idx, evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ static void friend_clear(struct bt_mesh_friend *frnd)
|
||||||
seg->seg_count = 0U;
|
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) {
|
if (frnd->established && cb->terminated) {
|
||||||
cb->terminated(frnd->subnet->net_idx, frnd->lpn);
|
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);
|
friend_recv_delay(frnd);
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) {
|
STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) {
|
||||||
if (cb->polled) {
|
if (cb->polled) {
|
||||||
cb->polled(frnd->subnet->net_idx, frnd->lpn);
|
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);
|
BT_DBG("Friendship established with 0x%04x", frnd->lpn);
|
||||||
frnd->established = 1U;
|
frnd->established = 1U;
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) {
|
STRUCT_SECTION_FOREACH(bt_mesh_friend_cb, cb) {
|
||||||
if (cb->established) {
|
if (cb->established) {
|
||||||
cb->established(frnd->subnet->net_idx, frnd->lpn, frnd->recv_delay,
|
cb->established(frnd->subnet->net_idx, frnd->lpn, frnd->recv_delay,
|
||||||
frnd->poll_to);
|
frnd->poll_to);
|
||||||
|
|
|
@ -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 = BT_MESH_NODE_IDENTITY_RUNNING;
|
||||||
sub->node_id_start = k_uptime_get_32();
|
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) {
|
if (cb->identity_enabled) {
|
||||||
cb->identity_enabled(sub->net_idx);
|
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 = BT_MESH_NODE_IDENTITY_STOPPED;
|
||||||
sub->node_id_start = 0U;
|
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) {
|
if (cb->identity_disabled) {
|
||||||
cb->identity_disabled(sub->net_idx);
|
cb->identity_disabled(sub->net_idx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ static void notify_recv(uint8_t hops, uint16_t feat)
|
||||||
{
|
{
|
||||||
sub.remaining = sub_remaining();
|
sub.remaining = sub_remaining();
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) {
|
STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) {
|
||||||
if (cb->recv) {
|
if (cb->recv) {
|
||||||
cb->recv(&sub, hops, feat);
|
cb->recv(&sub, hops, feat);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ static void notify_sub_end(void)
|
||||||
{
|
{
|
||||||
sub.remaining = 0;
|
sub.remaining = 0;
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) {
|
STRUCT_SECTION_FOREACH(bt_mesh_hb_cb, cb) {
|
||||||
if (cb->sub_end) {
|
if (cb->sub_end) {
|
||||||
cb->sub_end(&sub);
|
cb->sub_end(&sub);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ static void clear_friendship(bool force, bool disable)
|
||||||
lpn->old_friend = lpn->frnd;
|
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) {
|
if (cb->terminated && lpn->frnd != BT_MESH_ADDR_UNASSIGNED) {
|
||||||
cb->terminated(lpn->sub->net_idx, lpn->frnd);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) {
|
STRUCT_SECTION_FOREACH(bt_mesh_lpn_cb, cb) {
|
||||||
if (cb->polled) {
|
if (cb->polled) {
|
||||||
cb->polled(lpn->sub->net_idx, lpn->frnd, !!(lpn->req_attempts));
|
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);
|
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) {
|
if (cb->established) {
|
||||||
cb->established(lpn->sub->net_idx, lpn->frnd,
|
cb->established(lpn->sub->net_idx, lpn->frnd,
|
||||||
lpn->queue_size, lpn->recv_win);
|
lpn->queue_size, lpn->recv_win);
|
||||||
|
|
|
@ -27,8 +27,8 @@ struct bt_mesh_app_key_cb {
|
||||||
* @param _handler Handler function, see @ref bt_mesh_app_key_cb::evt_handler.
|
* @param _handler Handler function, see @ref bt_mesh_app_key_cb::evt_handler.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_APP_KEY_CB_DEFINE(_handler) \
|
#define BT_MESH_APP_KEY_CB_DEFINE(_handler) \
|
||||||
static const Z_STRUCT_SECTION_ITERABLE(bt_mesh_app_key_cb, \
|
static const STRUCT_SECTION_ITERABLE(bt_mesh_app_key_cb, \
|
||||||
_CONCAT(bt_mesh_app_key_cb_, \
|
_CONCAT(bt_mesh_app_key_cb_, \
|
||||||
_handler)) = { \
|
_handler)) = { \
|
||||||
.evt_handler = (_handler), \
|
.evt_handler = (_handler), \
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
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);
|
cb->evt_handler(sub, evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct bt_mesh_subnet_cb {
|
||||||
* @param _handler Handler function, see @ref bt_mesh_subnet_cb::evt_handler.
|
* @param _handler Handler function, see @ref bt_mesh_subnet_cb::evt_handler.
|
||||||
*/
|
*/
|
||||||
#define BT_MESH_SUBNET_CB_DEFINE(_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)) = { \
|
bt_mesh_subnet_cb, _CONCAT(bt_mesh_subnet_cb_, _handler)) = { \
|
||||||
.evt_handler = (_handler), \
|
.evt_handler = (_handler), \
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
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) {
|
if (handler->id == rx_header->cmd_id) {
|
||||||
found_handler = handler;
|
found_handler = handler;
|
||||||
|
|
|
@ -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)
|
void net_if_stats_reset(struct net_if *iface)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_NET_STATISTICS_PER_INTERFACE)
|
#if defined(CONFIG_NET_STATISTICS_PER_INTERFACE)
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, tmp) {
|
STRUCT_SECTION_FOREACH(net_if, tmp) {
|
||||||
if (iface == tmp) {
|
if (iface == tmp) {
|
||||||
memset(&iface->stats, 0, sizeof(iface->stats));
|
memset(&iface->stats, 0, sizeof(iface->stats));
|
||||||
return;
|
return;
|
||||||
|
@ -387,7 +387,7 @@ void net_if_stats_reset_all(void)
|
||||||
#if defined(CONFIG_NET_STATISTICS_PER_INTERFACE)
|
#if defined(CONFIG_NET_STATISTICS_PER_INTERFACE)
|
||||||
k_mutex_lock(&lock, K_FOREVER);
|
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));
|
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)
|
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,
|
if (!memcmp(net_if_get_link_addr(iface)->addr, ll_addr->addr,
|
||||||
ll_addr->len)) {
|
ll_addr->len)) {
|
||||||
return iface;
|
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)
|
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) {
|
if (net_if_get_device(iface) == dev) {
|
||||||
return iface;
|
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)
|
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) &&
|
if (IS_ENABLED(CONFIG_NET_OFFLOAD) &&
|
||||||
!l2 && net_if_offload(iface)) {
|
!l2 && net_if_offload(iface)) {
|
||||||
return iface;
|
return iface;
|
||||||
|
@ -1288,7 +1288,7 @@ static void rs_timeout(struct k_work *work)
|
||||||
/* Did not receive RA yet. */
|
/* Did not receive RA yet. */
|
||||||
ipv6->rs_count++;
|
ipv6->rs_count++;
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, tmp) {
|
STRUCT_SECTION_FOREACH(net_if, tmp) {
|
||||||
if (tmp->config.ip.ipv6 == ipv6) {
|
if (tmp->config.ip.ipv6 == ipv6) {
|
||||||
iface = tmp;
|
iface = tmp;
|
||||||
break;
|
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);
|
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;
|
struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6;
|
||||||
int i;
|
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);
|
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;
|
struct net_if_ipv6 *ipv6 = iface->config.ip.ipv6;
|
||||||
int i;
|
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);
|
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;
|
struct net_if_ipv6 *ipv6 = tmp->config.ip.ipv6;
|
||||||
int i;
|
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);
|
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);
|
addr = net_if_ipv6_get_ll(tmp, state);
|
||||||
if (addr) {
|
if (addr) {
|
||||||
if (iface) {
|
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);
|
k_mutex_lock(&lock, K_FOREVER);
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, tmp) {
|
STRUCT_SECTION_FOREACH(net_if, tmp) {
|
||||||
if (iface && *iface && tmp != *iface) {
|
if (iface && *iface && tmp != *iface) {
|
||||||
continue;
|
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,
|
src = net_if_ipv6_get_best_match(dst_iface, dst,
|
||||||
&best_match);
|
&best_match);
|
||||||
} else {
|
} else {
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
struct in6_addr *addr;
|
struct in6_addr *addr;
|
||||||
|
|
||||||
addr = net_if_ipv6_get_best_match(iface, dst,
|
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) {
|
if (dst_iface) {
|
||||||
src = net_if_ipv6_get_ll(dst_iface, NET_ADDR_PREFERRED);
|
src = net_if_ipv6_get_ll(dst_iface, NET_ADDR_PREFERRED);
|
||||||
} else {
|
} else {
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
struct in6_addr *addr;
|
struct in6_addr *addr;
|
||||||
|
|
||||||
addr = net_if_ipv6_get_ll(iface,
|
addr = net_if_ipv6_get_ll(iface,
|
||||||
|
@ -3036,7 +3036,7 @@ bool net_if_ipv4_is_addr_bcast(struct net_if *iface,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
ret = ipv4_is_broadcast_address(iface, addr);
|
ret = ipv4_is_broadcast_address(iface, addr);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
goto out;
|
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);
|
k_mutex_lock(&lock, K_FOREVER);
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
ret = net_if_ipv4_addr_mask_cmp(iface, dst);
|
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,
|
src = net_if_ipv4_get_best_match(dst_iface, dst,
|
||||||
&best_match);
|
&best_match);
|
||||||
} else {
|
} else {
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
struct in_addr *addr;
|
struct in_addr *addr;
|
||||||
|
|
||||||
addr = net_if_ipv4_get_best_match(iface, dst,
|
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) {
|
if (dst_iface) {
|
||||||
src = net_if_ipv4_get_ll(dst_iface, NET_ADDR_PREFERRED);
|
src = net_if_ipv4_get_ll(dst_iface, NET_ADDR_PREFERRED);
|
||||||
} else {
|
} else {
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
struct in_addr *addr;
|
struct in_addr *addr;
|
||||||
|
|
||||||
addr = net_if_ipv4_get_ll(iface,
|
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);
|
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;
|
struct net_if_ipv4 *ipv4 = iface->config.ip.ipv4;
|
||||||
int i;
|
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);
|
k_mutex_lock(&lock, K_FOREVER);
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
if (ret && *ret && iface != *ret) {
|
if (ret && *ret && iface != *ret) {
|
||||||
continue;
|
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)
|
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);
|
cb(iface, user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4279,7 +4279,7 @@ void net_if_init(void)
|
||||||
|
|
||||||
net_tc_tx_init();
|
net_tc_tx_init();
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(net_if, iface) {
|
STRUCT_SECTION_FOREACH(net_if, iface) {
|
||||||
init_iface(iface);
|
init_iface(iface);
|
||||||
if_count++;
|
if_count++;
|
||||||
}
|
}
|
||||||
|
@ -4307,7 +4307,7 @@ void net_if_init(void)
|
||||||
*/
|
*/
|
||||||
if_count = 0;
|
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 (net_if_l2(iface) == &NET_L2_GET_NAME(ETHERNET)) {
|
||||||
if_count++;
|
if_count++;
|
||||||
}
|
}
|
||||||
|
@ -4329,7 +4329,7 @@ void net_if_post_init(void)
|
||||||
NET_DBG("");
|
NET_DBG("");
|
||||||
|
|
||||||
/* After TX is running, attempt to bring the interface up */
|
/* 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)) {
|
if (!net_if_flag_is_set(iface, NET_IF_NO_AUTO_START)) {
|
||||||
net_if_up(iface);
|
net_if_up(iface);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
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);
|
cb(br, user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ LOG_MODULE_DECLARE(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
|
||||||
|
|
||||||
static void lcp_up(struct ppp_context *ctx)
|
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) {
|
if (proto->protocol == PPP_LCP) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ static void do_network(struct ppp_context *ctx)
|
||||||
{
|
{
|
||||||
ppp_change_phase(ctx, PPP_NETWORK);
|
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->protocol == PPP_CCP || proto->protocol == PPP_ECP) {
|
||||||
if (proto->open) {
|
if (proto->open) {
|
||||||
proto->open(ctx);
|
proto->open(ctx);
|
||||||
|
@ -46,7 +46,7 @@ static void do_network(struct ppp_context *ctx)
|
||||||
*/
|
*/
|
||||||
/* TODO possible encryption stuff here*/
|
/* 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 ||
|
if (proto->protocol == PPP_CCP || proto->protocol == PPP_ECP ||
|
||||||
proto->protocol >= 0xC000) {
|
proto->protocol >= 0xC000) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -83,7 +83,7 @@ static void do_auth(struct ppp_context *ctx)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) {
|
STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) {
|
||||||
if (proto->protocol == auth_proto) {
|
if (proto->protocol == auth_proto) {
|
||||||
if (proto->open) {
|
if (proto->open) {
|
||||||
proto->open(ctx);
|
proto->open(ctx);
|
||||||
|
|
|
@ -55,7 +55,7 @@ void ppp_network_done(struct ppp_context *ctx, int proto)
|
||||||
|
|
||||||
void ppp_network_all_down(struct ppp_context *ctx)
|
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) {
|
if (proto->protocol != PPP_LCP && proto->lower_down) {
|
||||||
proto->lower_down(ctx);
|
proto->lower_down(ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ int ppp_config_info_req(struct ppp_fsm *fsm,
|
||||||
#define PPP_PROTOCOL_REGISTER(name, proto, init_func, proto_handler, \
|
#define PPP_PROTOCOL_REGISTER(name, proto, init_func, proto_handler, \
|
||||||
proto_lower_up, proto_lower_down, \
|
proto_lower_up, proto_lower_down, \
|
||||||
proto_open, proto_close) \
|
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)) = { \
|
PPP_PROTO_GET_NAME(name)) = { \
|
||||||
.protocol = proto, \
|
.protocol = proto, \
|
||||||
.init = init_func, \
|
.init = init_func, \
|
||||||
|
|
|
@ -95,7 +95,7 @@ static enum net_verdict process_ppp_msg(struct net_if *iface,
|
||||||
return NET_CONTINUE;
|
return NET_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) {
|
STRUCT_SECTION_FOREACH(ppp_protocol_handler, proto) {
|
||||||
if (proto->protocol != protocol) {
|
if (proto->protocol != protocol) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ static void ppp_startup(struct k_work *work)
|
||||||
|
|
||||||
NET_DBG("PPP %p startup for interface %p", ctx, ctx->iface);
|
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) {
|
if (proto->protocol == PPP_LCP) {
|
||||||
ppp_lcp = proto;
|
ppp_lcp = proto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DNS_SD_FOREACH(it) \
|
#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
|
* @brief Extract the Service, Protocol, and Domain from a DNS-SD PTR query
|
||||||
|
|
|
@ -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)
|
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 &&
|
if (sock_family->family != family &&
|
||||||
sock_family->family != AF_UNSPEC) {
|
sock_family->family != AF_UNSPEC) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -40,7 +40,7 @@ int settings_register(struct settings_handler *handler)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
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) {
|
if (strcmp(handler->name, ch->name) == 0) {
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ struct settings_handler_static *settings_parse_and_lookup(const char *name,
|
||||||
*next = NULL;
|
*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)) {
|
if (!settings_name_steq(name, ch->name, &tmpnext)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ int settings_commit_subtree(const char *subtree)
|
||||||
|
|
||||||
rc = 0;
|
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)) {
|
if (subtree && !settings_name_steq(ch->name, subtree, NULL)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ int settings_save(void)
|
||||||
}
|
}
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(settings_handler_static, ch) {
|
STRUCT_SECTION_FOREACH(settings_handler_static, ch) {
|
||||||
if (ch->h_export) {
|
if (ch->h_export) {
|
||||||
rc2 = ch->h_export(settings_save_one);
|
rc2 = ch->h_export(settings_save_one);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
|
|
|
@ -363,7 +363,7 @@ int shell_set_root_cmd(const char *cmd)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_STRUCT_SECTION_FOREACH(shell, sh) {
|
STRUCT_SECTION_FOREACH(shell, sh) {
|
||||||
sh->ctx->selected_cmd = entry;
|
sh->ctx->selected_cmd = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ struct tracing_backend {
|
||||||
* @param _api Tracing backend API.
|
* @param _api Tracing backend API.
|
||||||
*/
|
*/
|
||||||
#define TRACING_BACKEND_DEFINE(_name, _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), \
|
.name = STRINGIFY(_name), \
|
||||||
.api = &_api \
|
.api = &_api \
|
||||||
}
|
}
|
||||||
|
@ -92,7 +91,7 @@ static inline void tracing_backend_output(
|
||||||
*/
|
*/
|
||||||
static inline struct tracing_backend *tracing_backend_get(char *name)
|
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) {
|
if (strcmp(backend->name, name) == 0) {
|
||||||
return backend;
|
return backend;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue