FreeCalypso > hg > freecalypso-tools
changeset 458:0a2e3fd156ed
simtest: reset implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 09 Feb 2019 17:21:45 +0000 |
parents | d96ea6ae6aa5 |
children | 5c1fb31751d7 |
files | target-utils/simtest/Makefile target-utils/simtest/cmdtab.c target-utils/simtest/reset.c |
diffstat | 3 files changed, 25 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/target-utils/simtest/Makefile Sat Feb 09 17:15:57 2019 +0000 +++ b/target-utils/simtest/Makefile Sat Feb 09 17:21:45 2019 +0000 @@ -5,7 +5,7 @@ OBJCOPY=arm-elf-objcopy PROG= simtest -OBJS= crt0.o cmdtab.o main.o poll.o setup.o volt.o +OBJS= crt0.o cmdtab.o main.o poll.o reset.o setup.o volt.o LIBS= ../libcommon/libcommon.a ../libprintf/libprintf.a ../libbase/libbase.a \ ../libc/libc.a LIBGCC= `${CC} -print-file-name=libgcc.a`
--- a/target-utils/simtest/cmdtab.c Sat Feb 09 17:15:57 2019 +0000 +++ b/target-utils/simtest/cmdtab.c Sat Feb 09 17:21:45 2019 +0000 @@ -7,6 +7,7 @@ extern void cmd_r8(); extern void cmd_r16(); extern void cmd_r32(); +extern void cmd_reset(); extern void cmd_setup(); extern void cmd_volt(); extern void cmd_w8(); @@ -29,6 +30,7 @@ {"r8", cmd_r8}, {"r16", cmd_r16}, {"r32", cmd_r32}, + {"reset", cmd_reset}, {"setup", cmd_setup}, {"volt", cmd_volt}, {"w8", cmd_w8},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target-utils/simtest/reset.c Sat Feb 09 17:21:45 2019 +0000 @@ -0,0 +1,22 @@ +#include <sys/types.h> +#include <strings.h> +#include "types.h" +#include "simregs.h" + +extern u16 conf1_reg; + +void +cmd_reset(argbulk) + char *argbulk; +{ + char *argv[2]; + + if (parse_args(argbulk, 1, 1, argv, 0) < 0) + return; + if (!strcmp(argv[0], "0")) + SIMREGS.conf1 = conf1_reg &= ~SIM_CONF1_SRSTLEV; + else if (!strcmp(argv[0], "1")) + SIMREGS.conf1 = conf1_reg |= SIM_CONF1_SRSTLEV; + else + printf("ERROR: \"0\" or \"1\" argument expected\n"); +}