From 886e19611e58635b0302c7d1b1effb9d2c89bf0b Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Fri, 5 Jan 2024 12:23:54 -0500 Subject: [PATCH] arm32: crt0 update for malloc --- src/worker/lib/arm32/crt0.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/worker/lib/arm32/crt0.c b/src/worker/lib/arm32/crt0.c index 13c02637..541b6f19 100644 --- a/src/worker/lib/arm32/crt0.c +++ b/src/worker/lib/arm32/crt0.c @@ -1,4 +1,8 @@ +extern void _end; + +void malloc_addblock(void* addr, int size); + int entry(); __attribute__((weak, naked, noinline, noreturn)) void _start() { @@ -8,6 +12,8 @@ __attribute__((weak, naked, noinline, noreturn)) void _start() { asm("__bss_end__ = _end"); // set stack pointer asm("mov sp, #0x100000"); + // allocate heap block + malloc_addblock(&_end, (void*)0xf0000 - &_end); // run main() entry(); // wait for next video frame