arm32: crt0 update for malloc
This commit is contained in:
parent
02986aed38
commit
886e19611e
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
extern void _end;
|
||||||
|
|
||||||
|
void malloc_addblock(void* addr, int size);
|
||||||
|
|
||||||
int entry();
|
int entry();
|
||||||
|
|
||||||
__attribute__((weak, naked, noinline, noreturn)) void _start() {
|
__attribute__((weak, naked, noinline, noreturn)) void _start() {
|
||||||
|
@ -8,6 +12,8 @@ __attribute__((weak, naked, noinline, noreturn)) void _start() {
|
||||||
asm("__bss_end__ = _end");
|
asm("__bss_end__ = _end");
|
||||||
// set stack pointer
|
// set stack pointer
|
||||||
asm("mov sp, #0x100000");
|
asm("mov sp, #0x100000");
|
||||||
|
// allocate heap block
|
||||||
|
malloc_addblock(&_end, (void*)0xf0000 - &_end);
|
||||||
// run main()
|
// run main()
|
||||||
entry();
|
entry();
|
||||||
// wait for next video frame
|
// wait for next video frame
|
||||||
|
|
Loading…
Reference in New Issue