comparison target-utils/simtest/reset.c @ 458:0a2e3fd156ed

simtest: reset implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 09 Feb 2019 17:21:45 +0000
parents
children
comparison
equal deleted inserted replaced
457:d96ea6ae6aa5 458:0a2e3fd156ed
1 #include <sys/types.h>
2 #include <strings.h>
3 #include "types.h"
4 #include "simregs.h"
5
6 extern u16 conf1_reg;
7
8 void
9 cmd_reset(argbulk)
10 char *argbulk;
11 {
12 char *argv[2];
13
14 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
15 return;
16 if (!strcmp(argv[0], "0"))
17 SIMREGS.conf1 = conf1_reg &= ~SIM_CONF1_SRSTLEV;
18 else if (!strcmp(argv[0], "1"))
19 SIMREGS.conf1 = conf1_reg |= SIM_CONF1_SRSTLEV;
20 else
21 printf("ERROR: \"0\" or \"1\" argument expected\n");
22 }