FreeCalypso > hg > freecalypso-tools
view target-utils/dspdump/mandump.c @ 541:a58563d16e1d
target-utils/Makefile: dspdump added
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 28 Oct 2019 08:36:50 +0000 |
parents | 27b5526ba1a8 |
children |
line wrap: on
line source
/* manual dump command */ #include <sys/types.h> #include "types.h" #include "leadapi.h" void cmd_dump(argbulk) char *argbulk; { char *argv[4]; u_long mode, addr, len; int rc; volatile u16 *api; unsigned n; if (parse_args(argbulk, 3, 3, argv, 0) < 0) return; if (parse_hexarg(argv[0], 4, &mode) < 0) { printf("ERROR: mode must be a valid 16-bit hex value\n"); return; } if (parse_hexarg(argv[1], 8, &addr) < 0) { printf("ERROR: addr must be a valid 32-bit hex value\n"); return; } if (parse_hexarg(argv[2], 4, &len) < 0) { printf("ERROR: len must be a valid 16-bit hex value\n"); return; } rc = boot_dsp_dump_agent(); if (rc < 0) return; /* error msg already printed */ rc = dsp_read_op((u16)mode, (u32)addr, (u16)len); if (rc < 0) { printf("ERROR: DSP timeout on read operation\n"); return; } api = (volatile u16 *) APIF_ADDR; for (n = 0; n < len; n++) printf("%04X\n", *api++); }