25 lines
387 B
C
25 lines
387 B
C
#include <alloc/liballoc.h>
|
|
#include <m/proc.h>
|
|
#include <stdint.h>
|
|
|
|
extern volatile uint8_t __bss_start[];
|
|
extern volatile uint8_t __bss_end[];
|
|
|
|
extern void app_main (void);
|
|
|
|
static void clear_bss (void) {
|
|
uint8_t* p = (uint8_t*)__bss_start;
|
|
while (p < __bss_end) {
|
|
*p++ = 0;
|
|
}
|
|
}
|
|
|
|
void __premain (void) {
|
|
clear_bss ();
|
|
liballoc_init ();
|
|
|
|
app_main ();
|
|
|
|
proc_quit ();
|
|
}
|