From b2f7ea0523ea77dd123f4bf0610ce97cc3e90b5d Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 22 Sep 2023 15:03:34 -0700 Subject: [PATCH] soc: xtensa/intel_adsp/ace: fix _end location The symbol _end is used to indicate the start of heap in the common libc malloc code. On ACE, heap is in uncached area. However, _end was in the cached area while end of heap is in uncached area. This resulted in incorrect calculation of heap size. So move _end into uncached area so correct heap size can be calculated. Signed-off-by: Daniel Leung --- soc/xtensa/intel_adsp/ace/ace-link.ld | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soc/xtensa/intel_adsp/ace/ace-link.ld b/soc/xtensa/intel_adsp/ace/ace-link.ld index a4aaf6b8087..454893055e1 100644 --- a/soc/xtensa/intel_adsp/ace/ace-link.ld +++ b/soc/xtensa/intel_adsp/ace/ace-link.ld @@ -403,10 +403,13 @@ SECTIONS { _unused_ram_start_marker = .; *(.unused_ram_start_marker) *(.unused_ram_start_marker.*) - _end = .; z_mapped_end = .; } >ram + /* Heap start and end markers. Used with libc malloc code. */ + . = SEGSTART_UNCACHED; + _end = ALIGN(8); + . = SEGSTART_CACHED; . = L2_SRAM_BASE + L2_SRAM_SIZE; . = SEGSTART_UNCACHED; _heap_end = .;