summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2011-05-23 17:41:30 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2011-05-23 17:41:30 +0000
commitb8870a029df4b52eca6ad89b9b393b9798dc812a (patch)
treed8b9dd17d021e50c2886c5de7136ae844b37746f /c/src/lib/libbsp/sparc/leon3
parent2011-05-23 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-b8870a029df4b52eca6ad89b9b393b9798dc812a.tar.bz2
2011-05-23 Jennifer Averett <Jennifer.Averett@OARcorp.com>
PR 1795/bsps * erc32/Makefile.am, leon2/Makefile.am, leon3/Makefile.am: Add rtems_bsp_delay to sparc bsps. * erc32/startup/bspdelay.c, leon2/startup/bspdelay.c, leon3/startup/bspdelay.c: New files.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/Makefile.am5
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/bspdelay.c25
2 files changed, 28 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 4dc665e678..ec14baea0c 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -1,5 +1,5 @@
##
-## $Id$
+## $Id: Makefile.am,v 1.30 2011/03/16 20:05:26 joel Exp
##
ACLOCAL_AMFLAGS = -I ../../../../aclocal
@@ -41,8 +41,9 @@ libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bootcard.c startup/bspstart.c \
../../sparc/shared/bsppretaskinghook.c ../../shared/bsppredriverhook.c \
../../sparc/shared/bspgetworkarea.c ../../shared/sbrk.c startup/setvec.c \
- startup/spurious.c startup/bspidle.S \
+ startup/spurious.c startup/bspidle.S startup/bspdelay.c \
../../shared/bspinit.c
+
# ISR Handler
libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S
# gnatsupp
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspdelay.c b/c/src/lib/libbsp/sparc/leon3/startup/bspdelay.c
new file mode 100644
index 0000000000..19a1dfd8b4
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspdelay.c
@@ -0,0 +1,25 @@
+/*
+ * LEON3 BSP Delay Method
+ *
+ * COPYRIGHT (c) 1989-2011.
+ * 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.
+ *
+ * $Id
+ */
+
+#include <bsp.h>
+
+void rtems_bsp_delay(int usecs)
+{
+ uint32_t then;
+
+ then =LEON3_Timer_Regs->timer[0].value;
+ then += usecs;
+
+ while (LEON3_Timer_Regs->timer[0].value >= then)
+ ;
+}