diff options
Diffstat (limited to 'c/src/lib/libbsp/h8300/h8sim/start')
-rw-r--r-- | c/src/lib/libbsp/h8300/h8sim/start/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/h8300/h8sim/start/Makefile.am | 32 | ||||
-rw-r--r-- | c/src/lib/libbsp/h8300/h8sim/start/start.S | 45 |
3 files changed, 79 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/h8300/h8sim/start/.cvsignore b/c/src/lib/libbsp/h8300/h8sim/start/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/lib/libbsp/h8300/h8sim/start/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/c/src/lib/libbsp/h8300/h8sim/start/Makefile.am b/c/src/lib/libbsp/h8300/h8sim/start/Makefile.am new file mode 100644 index 0000000000..e5a9f26a27 --- /dev/null +++ b/c/src/lib/libbsp/h8300/h8sim/start/Makefile.am @@ -0,0 +1,32 @@ +## +## $Id$ +## + +AUTOMAKE_OPTIONS = foreign 1.4 + +PGM = $(ARCH)/start.o + +S_FILES = start.S +S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o) + +OBJS = $(S_O_FILES) + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../../../../../../automake/lib.am + +# +# (OPTIONAL) Add local stuff here using += +# + +$(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o: $(PGM) + $(INSTALL_DATA) $< $@ + +TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o + +all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES) + +.PRECIOUS: $(PGM) + +EXTRA_DIST = start.S + +include $(top_srcdir)/../../../../../../automake/local.am diff --git a/c/src/lib/libbsp/h8300/h8sim/start/start.S b/c/src/lib/libbsp/h8300/h8sim/start/start.S new file mode 100644 index 0000000000..32b074f7bf --- /dev/null +++ b/c/src/lib/libbsp/h8300/h8sim/start/start.S @@ -0,0 +1,45 @@ +; h8/300 and h8/300h start up file. + +#ifdef __H8300__ + + .text + .global _start +_start: + mov.w #_stack_init,sp + mov.w #_edata,r0 + mov.w #_clear_end,r1 + mov.w #0,r2 +.loop: mov.w r2,@r0 + adds #2,r0 + cmp r1,r0 + blo .loop + ; call __main + jsr @_boot_card + mov.w #0,r0 ; indicate reason to exit + sleep + jmp @_start ; restart +#else + +#if defined(__H8300H__) + .h8300h +#else /* must be __H300S__ */ + .h8300s +#endif + .text + .global _start +_start: + mov.l #_stack_init,sp + mov.l #_edata,er0 + mov.l #_clear_end,er1 + mov.w #0,r2 ; not sure about alignment requirements +.loop: mov.w r2,@er0 ; playing it safe for now + adds #2,er0 + cmp.l er1,er0 + blo .loop + ; call __main + jsr @_boot_card + mov.w #0,r0 ; indicate reason to exit + sleep + jmp @_start ; restart + +#endif /* end of H8300 */ |