annotate target-utils/libcommon/cmd_r8.c @ 983:7166c8311b0d

tfc139 reworked to support both ARM and Thumb entry
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 10 Dec 2015 08:07:47 +0000
parents f4fc449a64ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * r8 hexaddr -- read an 8-bit register or memory location
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 */
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 #include <sys/types.h>
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 #include "types.h"
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 void
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 cmd_r8(argbulk)
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 char *argbulk;
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 {
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 char *argv[2];
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 u_long addr;
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 return;
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 if (parse_hexarg(argv[0], 8, &addr) < 0) {
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 printf("ERROR: argument must be a valid 32-bit hex address\n");
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 return;
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 }
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 printf("%02X\n", *(volatile u8 *)addr);
f4fc449a64ea target-utils libcommon infrastructure for interactive commands
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 }