hello everyone,
I want to rewrite the following cfg code with c code:
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x3200000;
heapMemParams.sectionName = "systemHeap";
heapMem0Params.instance.name = "heapMem01";
Program.global.heap0 = HeapMem.create(heapMemParams);
/* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;
here is my c code:
HeapMem_Params g_HeapParams[8] = {0};
HeapMem_Handle g_HeapHandle[8] = {0};
int g_CoreMemory[8] = {0x80000000, 0x83200000, 0x86400000, 0x89600000, 0x8C800000, 0x8FA00000, 0x92C00000, 0x95E00000 };
Error_Block eb;
Error_init(&eb);
HeapMem_Params_init(&g_HeapParams[DNUM]);
g_HeapParams[DNUM].size = 50*1024*1024;
g_HeapParams[DNUM].buf = (Ptr)g_CoreMemory[DNUM];
g_HeapParams[DNUM].instance->name = "heapMem01";
g_HeapHandle[DNUM] = HeapMem_create(&g_HeapParams[DNUM], &eb);
I can't find the sectionName field in the HeapMem_Params struct, but the cfg file has this filed.
And I also want to set the g_HeapHandle[DNUM] as the default heap in current core, and I don't know how to rewrite "Memory.defaultHeapInstance = Program.global.heap0;" with c code.
I just wan to dynamic create heap every core, and I set each heap‘s start address, and set a heap as a default heap
if current core has multi heaps.
Best Regards,
Si