static void framework_pre_init(void) { memcpy((void *)(framework_info->data_ram_start), (void *)(framework_info->data_flash_begin), framework_info->data_ram_end - framework_info->data_ram_start); memset((void *)(framework_info->bss_start), 0, framework_info->bss_end - framework_info->bss_start); krhino_add_mm_region(g_kmm_head, (void *)(framework_info->heap_start), framework_info->heap_end - framework_info->heap_start); krhino_mm_leak_region_init((void *)(framework_info->data_ram_start), (void *)(framework_info->data_ram_end)); krhino_mm_leak_region_init((void *)(framework_info->bss_start), (void *)(framework_info->bss_end)); }
void k_mm_init(void) { uint32_t e = 0; /* init memory region */ (void)krhino_init_mm_head(&g_kmm_head, g_mm_region[0].start, g_mm_region[0].len); for (e = 1 ; e < g_region_num ; e++) { krhino_add_mm_region(g_kmm_head, g_mm_region[e].start, g_mm_region[e].len); } #if (RHINO_CONFIG_MM_LEAKCHECK > 0 ) aos_mm_leak_region_init(); #endif }