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:
Fabio Baltieri 2021-08-04 23:05:54 +01:00 committed by Christopher Friedt
commit f88a420d69
54 changed files with 188 additions and 190 deletions

View file

@ -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;