From patchwork Thu Jun 25 05:27:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1316735 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49spSz0dXMz9sSt for ; Thu, 25 Jun 2020 15:28:19 +1000 (AEST) 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=AVtQM7as; 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 49spSy4HfszDqjH for ; Thu, 25 Jun 2020 15:28:18 +1000 (AEST) 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) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49spSq48XBzDqgb for ; Thu, 25 Jun 2020 15:28:11 +1000 (AEST) 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=AVtQM7as; 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 49spSp6R3sz9sRf; Thu, 25 Jun 2020 15:28:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1593062891; bh=ALdOtiYOmMbT4lwdjKYtEYn/xwMFX2ohoUbvSKiEVLg=; h=From:To:Cc:Subject:Date:From; b=AVtQM7asL7iwWK4TdABNBWCsP3JHvnlCwJ7cqW4URptnOenMmwLZH5Bu32YejTnm5 VTMnLrw9NLtHeSj45cD//P9CDFSwmKMMqErMtVKAB5HDKiXTkSQpT6spWIGvSGPGIZ nl2XjClrfKbCb0clxFBgIfRWqoxq8v9g2dxxJN+WTJca0cAD4BdxyGVWhLtdOvquia B/BMN4gEyQV0BuSQkfq49sEm+H/yrKivltbw2BqCa7sV76HabnSfuNOF4inQpn9Jr+ /DqaoSdL+vaMKQA5CafOOwJGkunlERz5F/UH0J/Ww580Ri06n6oYLaJi5fyIxVVObf uw3jFoW36bKTA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 25 Jun 2020 15:27:57 +1000 Message-Id: <20200625052757.269277-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Pdbg] [PATCH] libpdbg: Use register type macros instead of hard-coded values 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 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index d2748d0..85b6265 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -364,7 +364,7 @@ static int sbefifo_thread_getregs(struct thread *thread, struct thread_regs *reg ret = sbefifo_register_get(sctx, pdbg_target_index(chiplet), thread->id, - 0, + SBEFIFO_REGISTER_TYPE_GPR, reg_id, 32, (uint64_t **)®s->gprs); @@ -409,7 +409,7 @@ static int sbefifo_thread_getregs(struct thread *thread, struct thread_regs *reg ret = sbefifo_register_get(sctx, pdbg_target_index(chiplet), thread->id, - 1, + SBEFIFO_REGISTER_TYPE_SPR, reg_id, 34, (uint64_t **)&value); @@ -490,7 +490,7 @@ static int sbefifo_thread_put_reg(struct thread *thread, uint8_t reg_type, uint3 static int sbefifo_thread_getgpr(struct thread *thread, int gpr, uint64_t *value) { - uint8_t reg_type = 0x0; /* GPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_GPR; uint32_t reg_id = gpr; return sbefifo_thread_get_reg(thread, reg_type, reg_id, value); @@ -498,7 +498,7 @@ static int sbefifo_thread_getgpr(struct thread *thread, int gpr, uint64_t *value static int sbefifo_thread_putgpr(struct thread *thread, int gpr, uint64_t value) { - uint8_t reg_type = 0x0; /* GPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_GPR; uint32_t reg_id = gpr; return sbefifo_thread_put_reg(thread, reg_type, reg_id, value); @@ -506,7 +506,7 @@ static int sbefifo_thread_putgpr(struct thread *thread, int gpr, uint64_t value) static int sbefifo_thread_getspr(struct thread *thread, int spr, uint64_t *value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = spr; return sbefifo_thread_get_reg(thread, reg_type, reg_id, value); @@ -514,7 +514,7 @@ static int sbefifo_thread_getspr(struct thread *thread, int spr, uint64_t *value static int sbefifo_thread_putspr(struct thread *thread, int spr, uint64_t value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = spr; return sbefifo_thread_put_reg(thread, reg_type, reg_id, value); @@ -522,7 +522,7 @@ static int sbefifo_thread_putspr(struct thread *thread, int spr, uint64_t value) static int sbefifo_thread_getmsr(struct thread *thread, uint64_t *value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_MSR; return sbefifo_thread_get_reg(thread, reg_type, reg_id, value); @@ -530,7 +530,7 @@ static int sbefifo_thread_getmsr(struct thread *thread, uint64_t *value) static int sbefifo_thread_putmsr(struct thread *thread, uint64_t value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_MSR; return sbefifo_thread_put_reg(thread, reg_type, reg_id, value); @@ -538,7 +538,7 @@ static int sbefifo_thread_putmsr(struct thread *thread, uint64_t value) static int sbefifo_thread_getnia(struct thread *thread, uint64_t *value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_NIA; return sbefifo_thread_get_reg(thread, reg_type, reg_id, value); @@ -546,7 +546,7 @@ static int sbefifo_thread_getnia(struct thread *thread, uint64_t *value) static int sbefifo_thread_putnia(struct thread *thread, uint64_t value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_NIA; return sbefifo_thread_put_reg(thread, reg_type, reg_id, value); @@ -554,7 +554,7 @@ static int sbefifo_thread_putnia(struct thread *thread, uint64_t value) static int sbefifo_thread_getxer(struct thread *thread, uint64_t *value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_XER; return sbefifo_thread_get_reg(thread, reg_type, reg_id, value); @@ -562,7 +562,7 @@ static int sbefifo_thread_getxer(struct thread *thread, uint64_t *value) static int sbefifo_thread_putxer(struct thread *thread, uint64_t value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_XER; return sbefifo_thread_put_reg(thread, reg_type, reg_id, value); @@ -570,7 +570,7 @@ static int sbefifo_thread_putxer(struct thread *thread, uint64_t value) static int sbefifo_thread_getcr(struct thread *thread, uint32_t *value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_CR; uint64_t val; int ret; @@ -585,7 +585,7 @@ static int sbefifo_thread_getcr(struct thread *thread, uint32_t *value) static int sbefifo_thread_putcr(struct thread *thread, uint32_t value) { - uint8_t reg_type = 0x1; /* SPR */ + uint8_t reg_type = SBEFIFO_REGISTER_TYPE_SPR; uint32_t reg_id = SPR_CR; uint64_t val = value;;