Use memcpy and memset instead of custom loop
This commit is contained in:
parent
205f7ee342
commit
f7c01c4b91
1 changed files with 11 additions and 13 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <arch/at91sam3x8e/interrupt.h>
|
#include <arch/at91sam3x8e/interrupt.h>
|
||||||
|
#include <ardix/string.h>
|
||||||
#include <toolchain.h>
|
#include <toolchain.h>
|
||||||
|
|
||||||
/* from flash.ld */
|
/* from flash.ld */
|
||||||
|
@ -46,19 +47,16 @@ void do_bootstrap(void);
|
||||||
|
|
||||||
void isr_reset(void)
|
void isr_reset(void)
|
||||||
{
|
{
|
||||||
uint32_t *src;
|
memcpy(
|
||||||
uint32_t *dest;
|
&_etext,
|
||||||
|
&_srelocate,
|
||||||
/* copy .data to sram */
|
(size_t)(&_erelocate) - (size_t)(&_srelocate)
|
||||||
dest = &_etext;
|
);
|
||||||
src = &_srelocate;
|
memset(
|
||||||
while (src < &_erelocate)
|
&_szero,
|
||||||
*dest++ = *src++;
|
0,
|
||||||
|
(size_t)(&_ezero) - (size_t)(&_szero)
|
||||||
/** clear .bss */
|
);
|
||||||
dest = &_szero;
|
|
||||||
while (dest <= &_ezero)
|
|
||||||
*dest++ = 0;
|
|
||||||
|
|
||||||
/* start the Kernel */
|
/* start the Kernel */
|
||||||
do_bootstrap();
|
do_bootstrap();
|
||||||
|
|
Loading…
Reference in a new issue