diff options
| author | Michael Neuling <mikey@neuling.org> | 2018-06-19 15:25:26 +1000 |
|---|---|---|
| committer | Alistair Popple <alistair@popple.id.au> | 2018-06-25 14:50:54 +1000 |
| commit | 9e0991706a9cec65e62c11f61463076399dcbfb0 (patch) | |
| tree | 925b46f8be46cef2a141e886fb26724482d0c09d | |
| parent | db3412e2ba689a2281d56a50b5d85a34f68561ab (diff) | |
| download | pdbg-9e0991706a9cec65e62c11f61463076399dcbfb0.tar.gz pdbg-9e0991706a9cec65e62c11f61463076399dcbfb0.zip | |
htm: Remove reset by adding it to start
Signed-off-by: Michael Neuling <mikey@neuling.org>
| -rw-r--r-- | libpdbg/htm.c | 12 | ||||
| -rw-r--r-- | libpdbg/libpdbg.h | 1 | ||||
| -rw-r--r-- | libpdbg/target.h | 1 | ||||
| -rw-r--r-- | src/htm.c | 25 |
4 files changed, 3 insertions, 36 deletions
diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 48ad001..d7ffbcc 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -207,13 +207,6 @@ int htm_stop(struct pdbg_target *target) return htm ? htm->stop(htm) : -1; } -int htm_reset(struct pdbg_target *target) -{ - struct htm *htm = check_and_convert(target); - - return htm ? htm->reset(htm) : -1; -} - int htm_status(struct pdbg_target *target) { struct htm *htm = check_and_convert(target); @@ -705,6 +698,9 @@ static int do_htm_start(struct htm *htm) { struct htm_status status; + if (do_htm_reset(htm) < 0) + return -1; + if (HTM_ERR(get_status(htm, &status))) return -1; @@ -950,7 +946,6 @@ static struct htm nhtm = { }, .start = do_htm_start, .stop = do_htm_stop, - .reset = do_htm_reset, .status = do_htm_status, .dump = do_htm_dump, }; @@ -965,7 +960,6 @@ static struct htm chtm = { }, .start = do_htm_start, .stop = do_htm_stop, - .reset = do_htm_reset, .status = do_htm_status, .dump = do_htm_dump, }; diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h index 1f5c311..21e10c6 100644 --- a/libpdbg/libpdbg.h +++ b/libpdbg/libpdbg.h @@ -165,7 +165,6 @@ 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_reset(struct pdbg_target *target); int htm_dump(struct pdbg_target *target, uint64_t size, char *filename); int adu_getmem(struct pdbg_target *target, uint64_t addr, uint8_t *ouput, uint64_t size); diff --git a/libpdbg/target.h b/libpdbg/target.h index ac00b56..6f8d4b8 100644 --- a/libpdbg/target.h +++ b/libpdbg/target.h @@ -93,7 +93,6 @@ struct htm { struct pdbg_target target; int (*start)(struct htm *); int (*stop)(struct htm *); - int (*reset)(struct htm *); int (*status)(struct htm *); int (*dump)(struct htm *, uint64_t, char *); }; @@ -146,30 +146,6 @@ static int run_status(enum htm_type type) return rc; } -static int run_reset(enum htm_type type) -{ - struct pdbg_target *target; - int rc = 0; - - pdbg_for_each_class_target(HTM_ENUM_TO_STRING(type), target) { - if (!target_selected(target)) - continue; - pdbg_target_probe(target); - if (target_is_disabled(target)) - continue; - - printf("Resetting HTM@"); - print_htm_address(type, target); - if (htm_reset(target) != 1) { - printf("Couldn't reset HTM@"); - print_htm_address(type, target); - } - rc++; - } - - return rc; -} - static int run_dump(enum htm_type type) { struct pdbg_target *target; @@ -211,7 +187,6 @@ static struct { { "start", "", "Start %s HTM", &run_start }, { "stop", "", "Stop %s HTM", &run_stop }, { "status", "", "Get %s HTM status", &run_status }, - { "reset", "", "Reset %s HTM", &run_reset }, { "dump", "", "Dump %s HTM buffer to file", &run_dump }, }; |

