arch/at91sam3x8e: clean up

This commit is contained in:
Felix Kopp 2021-01-05 14:41:51 +01:00
parent dee9ce667f
commit ef25cd9fbb
No known key found for this signature in database
GPG key ID: C478BA0A85F75728

View file

@ -1,11 +1,14 @@
/* SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: BSD-3-Clause */
/* See the end of this file for copyright, licensing, and warranty information. */ /* See the end of this file for copyright, licensing, and warranty information. */
#include <stddef.h> #include <arch/at91sam3x8e/hardware.h>
#include <stdint.h>
#include <arch/at91sam3x8e/interrupt.h> #include <arch/at91sam3x8e/interrupt.h>
#include <ardix/malloc.h> #include <ardix/malloc.h>
#include <ardix/string.h> #include <ardix/string.h>
#include <stddef.h>
#include <stdint.h>
#include <toolchain.h> #include <toolchain.h>
/* from flash.ld */ /* from flash.ld */
@ -23,29 +26,16 @@ extern uint32_t _eheap; /* heap end */
/* implementation in init/main.c */ /* implementation in init/main.c */
void do_bootstrap(void); void do_bootstrap(void);
/* implementation in sys.c */
void sys_init(void);
__naked void irq_reset(void) __naked void irq_reset(void)
{ {
sys_init(); sys_init();
memmove( memmove(&_srelocate, &_etext, (size_t)(&_erelocate) - (size_t)(&_srelocate));
&_srelocate, memset(&_szero, 0, (size_t)(&_ezero) - (size_t)(&_szero));
&_etext,
(size_t)(&_erelocate) - (size_t)(&_srelocate)
);
memset(
&_szero,
0,
(size_t)(&_ezero) - (size_t)(&_szero)
);
/* There is no userspace yet, so the Kernel gets the entire heap for now */ /* There is no userspace yet, so the Kernel gets the entire heap for now */
malloc_init( malloc_init(&_sheap, (size_t)(&_eheap) - (size_t)(&_sheap));
&_sheap,
(size_t)(&_eheap) - (size_t)(&_sheap)
);
/* start the Kernel */ /* start the Kernel */
do_bootstrap(); do_bootstrap();