drivers/mm: Add API to query memory regions
Some systems may need to query the available memory regions in runtime. For those, this patch adds a simple API that memory management drivers can implement to provide such discovery. A small test also added to exercise the default, empty implementation. Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit is contained in:
parent
a7100af782
commit
edd524b4e3
6 changed files with 105 additions and 0 deletions
|
@ -469,3 +469,24 @@ out:
|
|||
|
||||
__weak FUNC_ALIAS(sys_mm_drv_simple_update_region_flags,
|
||||
sys_mm_drv_update_region_flags, int);
|
||||
|
||||
const struct sys_mm_drv_region *sys_mm_drv_simple_query_memory_regions(void)
|
||||
{
|
||||
const static struct sys_mm_drv_region empty[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
__weak FUNC_ALIAS(sys_mm_drv_simple_query_memory_regions,
|
||||
sys_mm_drv_query_memory_regions,
|
||||
const struct sys_mm_drv_region *);
|
||||
|
||||
void sys_mm_drv_simple_query_memory_regions_free(const struct sys_mm_drv_region *regions)
|
||||
{
|
||||
ARG_UNUSED(regions);
|
||||
}
|
||||
|
||||
__weak FUNC_ALIAS(sys_mm_drv_simple_query_memory_regions_free,
|
||||
sys_mm_drv_query_memory_regions_free, void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue