@@ -218,14 +218,14 @@ int htm_status(struct pdbg_target *target)
return htm ? htm->status(htm) : -1;
}
-int htm_dump(struct pdbg_target *target, uint64_t size, char *filename)
+int htm_dump(struct pdbg_target *target, char *filename)
{
struct htm *htm = check_and_convert(target);
if (!htm || !filename)
return -1;
- return htm->dump(htm, 0, filename);
+ return htm->dump(htm, filename);
}
int htm_record(struct pdbg_target *target, char *filename)
@@ -972,11 +972,12 @@ static int do_htm_status(struct htm *htm)
* FIXME:
* Look for eyecatcher 0xacef_f000 at start, otherwise assume wrapping
*/
-static int do_htm_dump(struct htm *htm, uint64_t size, char *filename)
+static int do_htm_dump(struct htm *htm, char *filename)
{
char *trace_file;
struct htm_status status;
uint64_t trace[0x1000];
+ uint64_t size;
int trace_fd, dump_fd;
uint32_t chip_id;
size_t r;
@@ -996,9 +997,7 @@ static int do_htm_dump(struct htm *htm, uint64_t size, char *filename)
if (chip_id == -1)
return -1;
- /* If size is zero they must want the entire thing */
- if (size == 0)
- size = status.mem_last - status.mem_base;
+ size = status.mem_last - status.mem_base;
printf("Dumping %" PRIi64 "i MB to %s\n", size >> 20, filename);
if (status.mem_last - status.mem_base > size) {
@@ -1063,7 +1062,7 @@ static int do_htm_record(struct htm *htm, char *filename)
if (do_htm_stop(htm) < 0)
return -1;
- if (do_htm_dump(htm, 0, filename) < 0)
+ if (do_htm_dump(htm, filename) < 0)
return -1;
@@ -165,7 +165,7 @@ struct thread_state {
int htm_start(struct pdbg_target *target);
int htm_stop(struct pdbg_target *target);
int htm_status(struct pdbg_target *target);
-int htm_dump(struct pdbg_target *target, uint64_t size, char *filename);
+int htm_dump(struct pdbg_target *target, char *filename);
int htm_record(struct pdbg_target *target, char *filename);
int adu_getmem(struct pdbg_target *target, uint64_t addr, uint8_t *ouput, uint64_t size);
@@ -94,7 +94,7 @@ struct htm {
int (*start)(struct htm *);
int (*stop)(struct htm *);
int (*status)(struct htm *);
- int (*dump)(struct htm *, uint64_t, char *);
+ int (*dump)(struct htm *, char *);
int (*record)(struct htm *, char *);
};
#define target_to_htm(x) container_of(x, struct htm, target)
@@ -166,7 +166,7 @@ static int run_dump(enum htm_type type)
/* size = 0 will dump everything */
printf("Dumping HTM@");
print_htm_address(type, target);
- if (htm_dump(target, 0, filename) != 1) {
+ if (htm_dump(target, filename) != 1) {
printf("Couldn't dump HTM@");
print_htm_address(type, target);
}
This isn't used and just complicates things. Signed-off-by: Michael Neuling <mikey@neuling.org> --- libpdbg/htm.c | 13 ++++++------- libpdbg/libpdbg.h | 2 +- libpdbg/target.h | 2 +- src/htm.c | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-)