Skip to content

Commit 6aeafab

Browse files
AlessandroAmeriac
authored andcommitted
K64F: Add page allocator sections to linker script
These changes are backwards compatible. Targets that do not use the page allocator heap will have the same stack and heap sizes available.
1 parent eb9d124 commit 6aeafab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,29 @@ SECTIONS
311311
.heap :
312312
{
313313
. = ALIGN(8);
314+
__uvisor_heap_start = .;
314315
__end__ = .;
315316
PROVIDE(end = .);
316317
__HeapBase = .;
317318
. += HEAP_SIZE;
318319
__HeapLimit = .;
319320
__heap_limit = .; /* Add for _sbrk */
321+
__uvisor_heap_end = .;
320322
} > m_data_2
321323

322324
.stack :
323325
{
324326
. = ALIGN(8);
325327
. += STACK_SIZE;
328+
__StackTop = .;
329+
} > m_data_2
330+
331+
/* Heap space for the page allocator */
332+
.page_heap (NOLOAD) :
333+
{
334+
__uvisor_page_start = .;
335+
. = ORIGIN(m_data_2) + LENGTH(m_data_2) - 4;
336+
__uvisor_page_end = .;
326337
} > m_data_2
327338

328339
m_usb_bdt USB_RAM_START (NOLOAD) :
@@ -337,7 +348,6 @@ SECTIONS
337348
}
338349

339350
/* Initializes stack on the end of block */
340-
__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
341351
__StackLimit = __StackTop - STACK_SIZE;
342352
PROVIDE(__stack = __StackTop);
343353

0 commit comments

Comments
 (0)