zephyr/subsys/app_memory/app_memdomain.c
Andrew Boie 7adff462e7 app_shmem: overhaul partition specification
* K_APP_DMEM_SECTION/K_MEM_BMEM_SECTION macros now exist
  to specifically define the name of the sections for data
  and bss respectively.

* All boards now use the gen_app_partitions.py script, the
  padding hacks for non-power-of-two arches didn't work right
  in all cases. Linker scripts have been updated.

* The defined k_mem_partition is now completely initialized
  at build time. The region data structures now only exist
  to zero BSS.

Based on some work submitted by Adithya Baglody
<adithya.baglody@intel.com>

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00

25 lines
604 B
C

#include <zephyr.h>
#include <init.h>
#include <app_memory/app_memdomain.h>
#include <string.h>
#include <misc/__assert.h>
extern char __app_shmem_regions_start[];
extern char __app_shmem_regions_end[];
static int app_shmem_bss_zero(struct device *unused)
{
struct z_app_region *region, *end;
end = (struct z_app_region *)&__app_shmem_regions_end;
region = (struct z_app_region *)&__app_shmem_regions_start;
for ( ; region < end; region++) {
(void)memset(region->bss_start, 0, region->bss_size);
}
return 0;
}
SYS_INIT(app_shmem_bss_zero, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);