From patchwork Fri Oct 9 04:00:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1378979 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C6vWD3lN0z9sTR for ; Fri, 9 Oct 2020 15:00:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=MGxXQd7s; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C6vWD2wSwzDqSv for ; Fri, 9 Oct 2020 15:00:56 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4C6vVN5FMBzDqWG for ; Fri, 9 Oct 2020 15:00:12 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=MGxXQd7s; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4C6vVN1N7Dz9sVK; Fri, 9 Oct 2020 15:00:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1602216012; bh=SWg6p97T/rkQqzzR+ASTsob6FOyH7A+VHcz5C7YJ87c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGxXQd7srGrDh3Yn03rG6WPv8jmllHToq2RZ5U5ipDJCbZ2ebtSROMk3rB/R197OI GVTmVaHwCVv8HKXjL0T0O5wm5OhNzNS08h3LS3G3udSjKXiVyDUfWO8DzoUB5i1taK IprxoBLyr9EaGb9dxYb+tSa+Gn9HODPBHJqwvW1io8dhbdAbz3XH/4JALU0GNWT6G2 +v0VluVw1QXZcsDFZx0QwHv+JSl8pJz7iaPHCtYTv9xwZCgkZ7nWcxRtbQXHhvQLhO 801bBzMA+f0h+6HblqVN/7JIjC6h3oe01i1BJ2voxmVMAL/+trHN8H9CINFu+oxBBu uEA5kg2+1ccgA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 9 Oct 2020 15:00:01 +1100 Message-Id: <20201009040001.310868-9-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201009040001.310868-1-amitay@ozlabs.org> References: <20201009040001.310868-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 8/8] libpdbg: Update thread state when starting/stopping all threads X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 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: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs Reviewed-by: Joel Stanley --- libpdbg/sbefifo.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index fae2ab7..a8e4522 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -263,12 +263,32 @@ static int sbefifo_pib_thread_op(struct pib *pib, uint32_t oper) static int sbefifo_pib_thread_start(struct pib *pib) { - return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_START); + struct pdbg_target *target; + int rc; + + rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_START); + + pdbg_for_each_target("thread", &pib->target, target) { + struct thread *thread = target_to_thread(target); + thread->status = thread->state(thread); + } + + return rc; } static int sbefifo_pib_thread_stop(struct pib *pib) { - return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_STOP); + struct pdbg_target *target; + int rc; + + rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_STOP); + + pdbg_for_each_target("thread", &pib->target, target) { + struct thread *thread = target_to_thread(target); + thread->status = thread->state(thread); + } + + return rc; } static int sbefifo_pib_thread_step(struct pib *pib, int count) @@ -283,7 +303,17 @@ static int sbefifo_pib_thread_step(struct pib *pib, int count) static int sbefifo_pib_thread_sreset(struct pib *pib) { - return sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_SRESET); + struct pdbg_target *target; + int rc; + + rc = sbefifo_pib_thread_op(pib, SBEFIFO_INSN_OP_SRESET); + + pdbg_for_each_target("thread", &pib->target, target) { + struct thread *thread = target_to_thread(target); + thread->status = thread->state(thread); + } + + return rc; } static int sbefifo_thread_probe(struct pdbg_target *target)