k_mem_slab: track as a kernel object

We aren't going to allow any user mode access to the
k_mem_slab APIs, but in some cases (specifically in the
case of the I2S subsystem) we need to allow user mode
to assign a memory slab to a particular driver.

This will let us verfiy (in supervisor mode) that a provided
k_mem_slab pointer is really a k_mem_slab, and know its
initialization state, and have permissions assigned to it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2018-11-14 11:42:26 -08:00 committed by Anas Nashif
commit f253d0779d
2 changed files with 2 additions and 0 deletions

View file

@ -62,6 +62,7 @@ static int init_mem_slab_module(struct device *dev)
slab++) {
create_free_list(slab);
SYS_TRACING_OBJ_INIT(k_mem_slab, slab);
_k_object_init(slab);
}
return 0;
}

View file

@ -18,6 +18,7 @@ from elf_helper import ElfHelper, kobject_to_enum
kobjects = {
"k_alert": None,
"k_mem_slab": None,
"k_msgq": None,
"k_mutex": None,
"k_pipe": None,