From patchwork Tue Jun 19 05:25:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 931386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418xJw4wNTz9s3C for ; Tue, 19 Jun 2018 15:26:24 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 418xJw3D0HzF0mQ for ; Tue, 19 Jun 2018 15:26:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 418xJ569ZQzF0kx for ; Tue, 19 Jun 2018 15:25:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 418xJ44YXwz9s70; Tue, 19 Jun 2018 15:25:40 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 7F443EE78C4; Tue, 19 Jun 2018 15:25:40 +1000 (AEST) From: Michael Neuling To: alistair@popple.id.au Date: Tue, 19 Jun 2018 15:25:26 +1000 Message-Id: <20180619052535.24043-9-mikey@neuling.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619052535.24043-1-mikey@neuling.org> References: <20180619052535.24043-1-mikey@neuling.org> Subject: [Pdbg] [PATCH 09/18] htm: Remove reset by adding it to start X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: grimm@linux.vnet.ibm.com, pdbg@lists.ozlabs.org MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Michael Neuling --- libpdbg/htm.c | 12 +++--------- libpdbg/libpdbg.h | 1 - libpdbg/target.h | 1 - src/htm.c | 25 ------------------------- 4 files changed, 3 insertions(+), 36 deletions(-) diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 48ad001f15..d7ffbccd54 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 1f5c31167f..21e10c61b1 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 ac00b56e86..6f8d4b8b08 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 *); }; diff --git a/src/htm.c b/src/htm.c index a41b2e52bb..a58a968c08 100644 --- a/src/htm.c +++ b/src/htm.c @@ -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 }, };