- return CMD_RET_SUCCESS;
-}
-
-static const FLASH char * const FLASH cpu_strings[] = {
- FSTR("Unknown"),
- FSTR("8080"),
- FSTR("8085"),
- FSTR("Z80"),
- FSTR("x180"),
- FSTR("HD64180"),
- FSTR("Z80180"),
- FSTR("Z80S180"),
-};
-
-command_ret_t do_cpuchk(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED)
-{
- uint_fast8_t options = O_LOAD_LOOP | O_UNLOAD_LOOP;
- uint_fast8_t cputype = 0;
- ERRNUM err = ESUCCESS;
- uint8_t eimsk_save;
-
- int opt;
- while ((opt = getopt(argc, argv, PSTR("swnu"))) != -1) {
- switch (opt) {
- case 's':
- options |= O_SILENT;
- break;
- case 'w':
- options |= O_WENV;
- break;
- case 'n':
- options &= ~O_LOAD_LOOP;
- break;
- case 'u':
- options &= ~O_UNLOAD_LOOP;
- break;
- default: /* '?' */
- return CMD_RET_USAGE;
- }
- }
- if (argc - optind != 0)
- return CMD_RET_USAGE;
-
- if (z80_bus_state() & ZST_RUNNING)
- cmd_error(CMD_RET_FAILURE, ERUNNING, NULL);
-
- uint8_t *mem_save = NULL;
- if (options & O_LOAD_LOOP) {
- mem_save = (uint8_t *) malloc(cpuinfo_length);
- if (mem_save == NULL)
- cmd_error(CMD_RET_FAILURE, ENOMEM, NULL);
- z80_bus_cmd(Request);
- z80_read_block(mem_save, 0, cpuinfo_length);
- z80_load_mem(0, cpuinfo, &cpuinfo_sections, cpuinfo_address,
- cpuinfo_length_of_sections);
- z80_bus_cmd(Release);
- }
-
- /* Save state and disable INT5/INT6 */
- ATOMIC_BLOCK(ATOMIC_FORCEON) {
- eimsk_save = EIMSK;
- EIMSK &= ~_BV(INT6);
- EIMSK &= ~_BV(INT5);