kernel/debug: Add debug message for heap settings
Add debug message for heap settings to verify all heaps and regions are set well.
@@ -64,7 +64,7 @@ extern const uint32_t g_idle_topstack;
*
* Description:
* This function prints the memory information for debug such as
- * the RAM configuration, Idle stack configuration, Heap configuration.
+ * the RAM configuration, Idle stack configuration, Heap settings.
*
* Inputs:
* None
@@ -76,13 +76,15 @@ extern const uint32_t g_idle_topstack;
* None
*
****************************************************************************/
-
void display_memory_information(void)
{
- /* Print RAM configuration */
int region_idx;
+ int heap_idx;
+ struct mm_heap_s *kheap = kmm_get_heap();
+
+ mllwdbg("--------------------RAM Configuration---------------------\n");
+ /* Print RAM configuration */
- mllwdbg("-------------------RAM Configuration--------------------\n");
for (region_idx = 0; region_idx < CONFIG_KMM_REGIONS; region_idx++) {
mllwdbg("Kernel RAM [%d] : start addr = 0x%x size = %u\n", region_idx, kregionx_start[region_idx], kregionx_size[region_idx]);
}
@@ -90,5 +92,22 @@ void display_memory_information(void)
/* Print Idle Stack configuration */
mllwdbg("Idle stack : base addr = 0x%x size = %u\n", g_idle_topstack, CONFIG_IDLETHREAD_STACKSIZE);
- mllwdbg("-------------------RAM Configuration--------------------\n");
+ mllwdbg("-----------------------------------------------------------\n");
+
+ mllwdbg("------------------------------ Heap Settings ------------------------------\n");
+
+ /* Print RAM configuration */
+
+ for (heap_idx = 0; heap_idx < CONFIG_KMM_NHEAPS; heap_idx++) {
+ mllwdbg("Heap[%d] : size = %u, number of regions = %d\n", heap_idx, kheap[heap_idx].mm_heapsize, kheap[heap_idx].mm_nregions);
+ region_idx = 0;
+#if CONFIG_KMM_REGIONS > 1
+ for (; region_idx < kheap[heap_idx].mm_nregions; region_idx++)
+#endif
+ {
+ mllwdbg(" Region[%d] : start addr = %8p, end addr = %8p, size = %u\n", region_idx, kheap[heap_idx].mm_heapstart[region_idx], kheap[heap_idx].mm_heapend[region_idx], ((uint32_t)kheap[heap_idx].mm_heapend[region_idx] - (uint32_t)kheap[heap_idx].mm_heapstart[region_idx]));
+
+ }
+ }
+ mllwdbg("---------------------------------------------------------------------------\n");
}
