summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/startup/zerobss.c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2005-11-04 00:57:25 +0000
committerTill Straumann <strauman@slac.stanford.edu>2005-11-04 00:57:25 +0000
commitab20575a29a7f969f782053ef7a0ef968ca1ed27 (patch)
treec4068d3117b7e2de71785588423895678f5f7fbf /c/src/lib/libbsp/powerpc/shared/startup/zerobss.c
parent2005-11-03 <strauman@slac.stanford.edu> (diff)
downloadrtems-ab20575a29a7f969f782053ef7a0ef968ca1ed27.tar.bz2
2005-11-03 <strauman@slac.stanford.edu>
* shared/startup/pretaskinghook.c, shared/startup/zerobss.c: New files. * Makefile.am, shared/startup/bspstart.c: Split pretaskinghook and zerobss into separate, reusable files; Fixed #PR837 (set exception in ram flag before initializing exceptions); Setup DBATs early, they are needed to access peripherals (Allows mvme2100 to use MMU); moved VME initialization into pretasking hook so that shared interrupts can be used for VME [shared IRQ facility needs functional workspace].
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/startup/zerobss.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/zerobss.c b/c/src/lib/libbsp/powerpc/shared/startup/zerobss.c
new file mode 100644
index 0000000000..d1c62384f2
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/startup/zerobss.c
@@ -0,0 +1,28 @@
+/*
+ * zero the various bss areas.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * Modified to support the MCP750.
+ * Modifications Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
+ *
+ * $Id$
+ */
+
+#include <string.h>
+
+void zero_bss()
+{
+ /* prevent these from being accessed in the short data areas */
+ extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
+ extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
+ extern unsigned long __rtems_end[];
+ memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
+ memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
+ memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
+}