[PATCH 4/4] h8300/h8sim: Exit simulator cleanly
Joel Sherrill
joel.sherrill at oarcorp.com
Wed Oct 15 14:34:52 UTC 2014
---
c/src/lib/libbsp/h8300/h8sim/Makefile.am | 23 +++++++++++++++--------
c/src/lib/libbsp/h8300/h8sim/configure.ac | 2 +-
c/src/lib/libbsp/h8300/h8sim/start/start.S | 6 ++++--
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/c/src/lib/libbsp/h8300/h8sim/Makefile.am b/c/src/lib/libbsp/h8300/h8sim/Makefile.am
index 19f473a..3d36374 100644
--- a/c/src/lib/libbsp/h8300/h8sim/Makefile.am
+++ b/c/src/lib/libbsp/h8300/h8sim/Makefile.am
@@ -26,17 +26,24 @@ noinst_LIBRARIES += libbsp.a
libbsp_a_SOURCES =
# startup
-libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
- ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
- ../../shared/bspgetworkarea.c ../../shared/bsppost.c \
- ../../shared/bspstart.c startup/h8bdinstallirq.c \
- ../../shared/bootcard.c ../../shared/sbrk.c \
- ../../shared/gnatinstallhandler.c startup/__main.c
+libbsp_a_SOURCES += ../../shared/bspclean.c
+libbsp_a_SOURCES += ../../shared/bsplibc.c
+libbsp_a_SOURCES += ../../shared/bsppredriverhook.c
+libbsp_a_SOURCES += ../../shared/bsppretaskinghook.c
+libbsp_a_SOURCES += ../../shared/bspgetworkarea.c
+libbsp_a_SOURCES += ../../shared/bsppost.c
+libbsp_a_SOURCES += ../../shared/bspstart.c
+libbsp_a_SOURCES += startup/h8bdinstallirq.c
+libbsp_a_SOURCES += ../../shared/bootcard.c
+libbsp_a_SOURCES += ../../shared/sbrk.c
+libbsp_a_SOURCES += ../../shared/gnatinstallhandler.c
+
# clock
libbsp_a_SOURCES += ../../shared/clock_driver_simidle.c
# console
-libbsp_a_SOURCES += ../../shared/console-polled.c console/console-io.c \
- console/syscalls.S
+libbsp_a_SOURCES += ../../shared/console-polled.c
+libbsp_a_SOURCES += console/console-io.c
+libbsp_a_SOURCES += console/syscalls.S
# timer
libbsp_a_SOURCES += ../../shared/timerstub.c
diff --git a/c/src/lib/libbsp/h8300/h8sim/configure.ac b/c/src/lib/libbsp/h8300/h8sim/configure.ac
index ae26342..4675d02 100644
--- a/c/src/lib/libbsp/h8300/h8sim/configure.ac
+++ b/c/src/lib/libbsp/h8300/h8sim/configure.ac
@@ -13,7 +13,7 @@ RTEMS_PROG_CC_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS
RTEMS_PROG_CCAS
-RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
+RTEMS_BSP_CLEANUP_OPTIONS(0, 1, 0)
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
diff --git a/c/src/lib/libbsp/h8300/h8sim/start/start.S b/c/src/lib/libbsp/h8300/h8sim/start/start.S
index 87daeb8..ca0fba2 100644
--- a/c/src/lib/libbsp/h8300/h8sim/start/start.S
+++ b/c/src/lib/libbsp/h8300/h8sim/start/start.S
@@ -13,9 +13,10 @@ _start:
adds #2,r0
cmp r1,r0
blo .loop
- ; call __main
mov.w #0,r0 ; pass in NULL
jsr @_boot_card
+ .global _bsp_reset
+_bsp_reset:
mov.w #0,r0 ; indicate reason to exit
sleep
jmp @_start ; restart
@@ -37,8 +38,9 @@ _start:
adds #2,er0
cmp.l er1,er0
blo .loop
- ; call __main
jsr @_boot_card
+ .global _bsp_reset
+_bsp_reset:
mov.w #0,r0 ; indicate reason to exit
sleep
jmp @_start ; restart
--
1.9.3
More information about the devel
mailing list