comparison target-utils/loadagent/cmd_blankchk.c @ 658:0da2cf5a999c

target-utils: libload eliminated
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 03 Mar 2020 06:06:17 +0000
parents target-utils/libload/cmd_blankchk.c@e7502631a0f9
children
comparison
equal deleted inserted replaced
657:742c99c1ff52 658:0da2cf5a999c
1 /*
2 * Flash blank check command
3 */
4
5 #include <sys/types.h>
6 #include "types.h"
7
8 void
9 cmd_blankchk(argbulk)
10 char *argbulk;
11 {
12 char *argv[3];
13 u_long start, length;
14 u_long addr;
15 int c;
16
17 if (parse_args(argbulk, 2, 2, argv, 0) < 0)
18 return;
19 if (parse_hexarg(argv[0], 8, &start) < 0) {
20 printf("ERROR: arg1 must be a valid 32-bit hex address\n");
21 return;
22 }
23 if (parse_hexarg(argv[1], 8, &length) < 0) {
24 printf("ERROR: arg2 must be a valid 32-bit hex value (length)\n");
25 return;
26 }
27 for (addr = start; addr < start + length; addr++) {
28 c = *(volatile u8 *)addr;
29 if (c != 0xFF) {
30 printf("Not blank: %02X at %08X\n", c, addr);
31 return;
32 }
33 }
34 printf("OK\n");
35 }