diff --git a/src/platforms/pc/cl_utils.c b/src/platforms/pc/cl_utils.c index 57af8d3..45f6373 100644 --- a/src/platforms/pc/cl_utils.c +++ b/src/platforms/pc/cl_utils.c @@ -285,8 +285,6 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) } else { target_foreach(display_target, NULL); } - if (opt->opt_mode == BMP_MODE_TEST) - return 0; if (opt->opt_target_dev > num_targets) { DEBUG("Given target nummer %d not available\n", opt->opt_target_dev); return res; @@ -296,6 +294,44 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) DEBUG("Can not attach to target %d\n", opt->opt_target_dev); goto target_detach; } + if (opt->opt_mode == BMP_MODE_TEST) { + char map [1024], *p = map; + if (target_mem_map(t, map, sizeof(map))) { + while (*p && (*p == '<')) { + unsigned int start, size; + char *res; + int match; + match = strncmp(p, "", strlen("")); + if (!match) { + p += strlen(""); + continue; + } + match = strncmp(p, "" + "%x", + &start, &size, &blocksize)) + printf("Flash Start: 0x%08x, length %#9x, blocksize %#8x\n", + start, size, blocksize); + res = strstr(p, ""); + p = res + strlen(""); + continue; + } + match = strncmp(p, ""); + p = res + strlen("/>"); + continue; + } + break; + } + } + goto target_detach; + } int read_file = -1; if ((opt->opt_mode == BMP_MODE_FLASH_WRITE) || (opt->opt_mode == BMP_MODE_FLASH_VERIFY)) {