void up_addregion(void) { /* Add the STM32F20xxx/STM32F40xxx CCM SRAM heap region. */ #ifndef CONFIG_STM32_CCMEXCLUDE mm_addregion((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START); #endif /* Add the external FSMC SRAM heap region. */ #ifdef CONFIG_STM32_FSMC_SRAM mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); #endif }
void up_addregion(void) { #if defined(CONFIG_LPC31_EXTSRAM0) && defined(CONFIG_LPC31_EXTSRAM0HEAP) mm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_LPC31_EXTSRAM0SIZE); #endif #if defined(CONFIG_LPC31_EXTSRAM1) && defined(CONFIG_LPC31_EXTSRAM1HEAP) mm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_LPC31_EXTSRAM1SIZE); #endif #if defined(CONFIG_LPC31_EXTSDRAM) && defined(CONFIG_LPC31_EXTSDRAMHEAP) mm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_LPC31_EXTSDRAMSIZE); #endif }
void mm_initialize(FAR struct mm_heap_s *heap, FAR void *heapstart, size_t heapsize) { int i; mlldbg("Heap: start=%p size=%u\n", heapstart, heapsize); /* The following two lines have cause problems for some older ZiLog * compilers in the past (but not the more recent). Life is easier if we * just the suppress them altogther for those tools. */ #ifndef __ZILOG__ CHECK_ALLOCNODE_SIZE; CHECK_FREENODE_SIZE; #endif /* Set up global variables */ heap->mm_heapsize = 0; #if CONFIG_MM_REGIONS > 1 heap->mm_nregions = 0; #endif /* Initialize the node array */ memset(heap->mm_nodelist, 0, sizeof(struct mm_freenode_s) * MM_NNODES); for (i = 1; i < MM_NNODES; i++) { heap->mm_nodelist[i-1].flink = &heap->mm_nodelist[i]; heap->mm_nodelist[i].blink = &heap->mm_nodelist[i-1]; } /* Initialize the malloc semaphore to one (to support one-at- * a-time access to private data sets). */ mm_seminitialize(heap); /* Add the initial region of memory to the heap */ mm_addregion(heap, heapstart, heapsize); }
void up_addregion(void) { /* Banks 0 and 1 are each 16Kb. If both are present, they occupy a * contiguous 32Kb memory region. * * If Ethernet is enabled, it will take some or all of bank 0 for packet * buffering and descriptor tables; If USB host is enabled, it will take * some or all of bank 1 for descriptor memory. The complex conditional * compilation above should boil this all down to a very simple check * here: * * Is any memory available in AHB SRAM for the heap? */ #ifdef LPC17_AHB_HEAPBASE /* Yes... Add the AHB SRAM heap region. */ mm_addregion((FAR void*)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE); #endif }
void up_addregion(void) { mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); }
void kmm_addregion(FAR void *heap_start, size_t heap_size) { return mm_addregion(&g_kmmheap, heap_start, heap_size); }
void up_addregion(void) { mm_addregion((FAR void*)UP_HEAP2_BASE, UP_HEAP2_END - UP_HEAP2_BASE); }
void umm_addregion(FAR void *heap_start, size_t heap_size) { mm_addregion(USR_HEAP, heap_start, heap_size); }