Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2009-07-01 15:45:49 +0400
committerAnthony Green <green@moxielogic.com>2009-07-01 15:45:49 +0400
commit265b5faec741277f9295baf03a627f9f855af0f2 (patch)
tree8986ea8761059bff07e85020b8ddd9c2488ecd68 /libgloss/moxie
parent128b854b57a40f47a9a9a804c3276a01a0fb4039 (diff)
* moxie/crt0.S (_start): Clear BSS at startup. Register _fini()
with atexit(). * moxie/sim-open.S: Fix comment.
Diffstat (limited to 'libgloss/moxie')
-rw-r--r--libgloss/moxie/crt0.S18
-rw-r--r--libgloss/moxie/sim-open.S2
2 files changed, 15 insertions, 5 deletions
diff --git a/libgloss/moxie/crt0.S b/libgloss/moxie/crt0.S
index e7c64a68b..d413a4580 100644
--- a/libgloss/moxie/crt0.S
+++ b/libgloss/moxie/crt0.S
@@ -1,6 +1,6 @@
/* 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,
* 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 */
/* zero the bss area */
- /* TODO */
- /* call memset */
+ dec $sp, 12
+ 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
+ /* Call _fini at exit time for static destructors. */
+ ldi.l $r0, _fini
+ jsra atexit
+
/* Set argc and argv. These are populated by the simulator. */
lda.l $r0, 0x4
ldi.l $r1, 0x8
diff --git a/libgloss/moxie/sim-open.S b/libgloss/moxie/sim-open.S
index dafbe4de1..87e9b94f8 100644
--- a/libgloss/moxie/sim-open.S
+++ b/libgloss/moxie/sim-open.S
@@ -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
*