23 lines
310 B
C
23 lines
310 B
C
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
extern void main(void);
|
|
|
|
extern uint8_t _bss_start[];
|
|
extern uint8_t _bss_end[];
|
|
|
|
void bss_clear(void) {
|
|
uint8_t *p = _bss_start;
|
|
while (p != _bss_end) {
|
|
*p = 0;
|
|
p++;
|
|
}
|
|
}
|
|
|
|
// ulib initialization goes here
|
|
void _premain(void) {
|
|
bss_clear();
|
|
main();
|
|
}
|
|
|