From patchwork Tue Nov 10 04:52:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1397291 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 4CVb8L3cbrz9sPB for ; Tue, 10 Nov 2020 15:52:50 +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=lWDblCpU; 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 4CVb8K4HzSzDqZ2 for ; Tue, 10 Nov 2020 15:52:49 +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 4CVb7y3zZVzDqYq for ; Tue, 10 Nov 2020 15:52:30 +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=lWDblCpU; 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 4CVb7y1mctz9sTR; Tue, 10 Nov 2020 15:52:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1604983950; bh=P20fYRst1Xc9n43PtRHNZv2X0Vms60uiKVf5bTE+VSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWDblCpUpZ2KJL8JQQ0WuoE9P99INSodZcFhEG3svH0eLwo1Mt1d2Ha7d13mB92j0 sDZj8bTbp85Jlc2LugglzogD1DnotE3rlCxy2a8ButFBxQW0CZrN5pS15ZWtEsj71K 6j+DmEpfRF8Ui/B6xKPOe72ZKtVa4L/Nd+/vlYgzqWULBGZL1ehl/uvKL4yleqGkIY dTdp9LxV2/g4k4HsxR4OTKAimzDBOvwJOCN3e0yF9fKpLynVUdqTuekBc3wOo4Dyav P+QF0fiuzGOX1yIlNAaYbrbNwqMGJHOIeD1vyHbULVVULFuwRVYo/KQWgc6N6s+r0O 4+8QD+r3Idw0g== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Tue, 10 Nov 2020 15:52:17 +1100 Message-Id: <20201110045217.137133-5-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201110045217.137133-1-amitay@ozlabs.org> References: <20201110045217.137133-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 4/4] libdbg: Use the correct thread state function 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 --- libpdbg/sbefifo.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index bfe25cf..cfc8488 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -370,7 +370,16 @@ static int sbefifo_thread_op(struct thread *thread, uint32_t oper) static struct thread_state sbefifo_thread_state(struct thread *thread) { - return p9_thread_state(thread); + struct pdbg_target *pib = pdbg_target_require_parent("pib", &thread->target); + struct sbefifo *sbefifo = pib_to_sbefifo(pib); + struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo); + + if (sbefifo_proc(sctx) == SBEFIFO_PROC_P9) + return p9_thread_state(thread); + else if (sbefifo_proc(sctx) == SBEFIFO_PROC_P10) + return p10_thread_state(thread); + else + abort(); } static int sbefifo_thread_start(struct thread *thread)