linker generated list: provide an iterator to simplify list access
Given that the section name and boundary simbols can be inferred from the struct object name, it makes sense to create an iterator that abstracts away the access details and reduce the possibility for mistakes. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
b1d3742ce2
commit
aa9228854f
14 changed files with 34 additions and 80 deletions
|
@ -14,9 +14,6 @@
|
|||
#include <ksched.h>
|
||||
#include <init.h>
|
||||
|
||||
extern struct k_mem_slab _k_mem_slab_list_start[];
|
||||
extern struct k_mem_slab _k_mem_slab_list_end[];
|
||||
|
||||
static struct k_spinlock lock;
|
||||
|
||||
#ifdef CONFIG_OBJECT_TRACING
|
||||
|
@ -57,11 +54,7 @@ static int init_mem_slab_module(struct device *dev)
|
|||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
struct k_mem_slab *slab;
|
||||
|
||||
for (slab = _k_mem_slab_list_start;
|
||||
slab < _k_mem_slab_list_end;
|
||||
slab++) {
|
||||
Z_STRUCT_SECTION_FOREACH(k_mem_slab, slab) {
|
||||
create_free_list(slab);
|
||||
SYS_TRACING_OBJ_INIT(k_mem_slab, slab);
|
||||
z_object_init(slab);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue