comparison target-utils/pln-ppb-test/mode_entry.c @ 987:6b87de9e385b

pln-ppb-test: implement mode-exit
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Dec 2023 00:01:03 +0000
parents 676203b4bf33
children
comparison
equal deleted inserted replaced
986:676203b4bf33 987:6b87de9e385b
28 } 28 }
29 *(volatile u16 *)(addr + 0xAAA) = 0xAA; 29 *(volatile u16 *)(addr + 0xAAA) = 0xAA;
30 *(volatile u16 *)(addr + 0x554) = 0x55; 30 *(volatile u16 *)(addr + 0x554) = 0x55;
31 *(volatile u16 *)(addr + 0xAAA) = mode; 31 *(volatile u16 *)(addr + 0xAAA) = mode;
32 } 32 }
33
34 void
35 cmd_mode_exit(argbulk)
36 char *argbulk;
37 {
38 char *argv[2];
39 u_long addr;
40
41 if (parse_args(argbulk, 1, 1, argv, 0) < 0)
42 return;
43 if (parse_hexarg(argv[0], 8, &addr) < 0) {
44 printf("ERROR: argument must be a valid 32-bit hex address\n");
45 return;
46 }
47 if (addr & 0xFFFF) {
48 printf("ERROR: address is not on 64 KiB boundary\n");
49 return;
50 }
51 *(volatile u16 *)addr = 0x90;
52 *(volatile u16 *)addr = 0x00;
53 }