* moxie/crt0.S (_start): Clear BSS at startup. Register _fini()

with atexit().
        * moxie/sim-open.S: Fix comment.
This commit is contained in:
Anthony Green 2009-07-01 11:45:49 +00:00
parent 128b854b57
commit 265b5faec7
3 changed files with 21 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2009-07-01 Anthony Green <green@moxielogic.com>
* moxie/crt0.S (_start): Clear BSS at startup. Register _fini()
with atexit().
* moxie/sim-open.S: Fix comment.
2009-06-19 Joseph Myers <joseph@codesourcery.com> 2009-06-19 Joseph Myers <joseph@codesourcery.com>
* Makefile.in (html, pdf): New. * Makefile.in (html, pdf): New.

View File

@ -1,6 +1,6 @@
/* crt0.S -- startup file for moxie /* crt0.S -- startup file for moxie
* *
* Copyright (c) 2008 Anthony Green * Copyright (c) 2008, 2009 Anthony Green
* *
* The authors hereby grant permission to use, copy, modify, distribute, * The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided * and license this software and its documentation for any purpose, provided
@ -23,12 +23,22 @@ _start:
ldi.l $fp, 0x0 /* zero fp to allow unwinders to stop */ ldi.l $fp, 0x0 /* zero fp to allow unwinders to stop */
/* zero the bss area */ /* zero the bss area */
/* TODO */ dec $sp, 12
/* call memset */ ldi.l $r0, __bss_start__
ldi.l $r1, __bss_end__
sub.l $r1, $r0
sto.l 8($sp), $r1
ldi.l $r1, 0
jsra memset
inc $sp, 12
/* Call _init to invoke static constructors, etc. */ /* Call _init to invoke static constructors, etc. */
jsra _init jsra _init
/* Call _fini at exit time for static destructors. */
ldi.l $r0, _fini
jsra atexit
/* Set argc and argv. These are populated by the simulator. */ /* Set argc and argv. These are populated by the simulator. */
lda.l $r0, 0x4 lda.l $r0, 0x4
ldi.l $r1, 0x8 ldi.l $r1, 0x8

View File

@ -1,5 +1,5 @@
/* /*
* sim-open.S -- open interface for frv simulator * sim-open.S -- open interface for moxie simulator
* *
* Copyright (c) 2008 Anthony Green * Copyright (c) 2008 Anthony Green
* *