From patchwork Mon Jan 7 04:30:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1021171 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 (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Y2WW1ymRz9sDP for ; Mon, 7 Jan 2019 15:30:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (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.b="GE1KKbh7"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43Y2WV6FqjzDqCV for ; Mon, 7 Jan 2019 15:30:46 +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) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43Y2W92y7tzDqDx for ; Mon, 7 Jan 2019 15:30:29 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (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.b="GE1KKbh7"; 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 (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 43Y2W900NSz9sDP; Mon, 7 Jan 2019 15:30:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1546835429; bh=+PrwxIMgJ4WTIK1U/EOvOEyXMzO4WhIs6cK3URl+mcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GE1KKbh7YBW62EkXX/xnTqLrkrcPrn7hMD8FA1S/m3AyRxF2smecv/icTzgz2lgdN YOSe0tBWzxCrjR9+fnkbaM395Hus+5dzRXdmDx0PE2mti9Fa91Mul2h2YDjV0MFHjf 1YT2rY3Y8Ot9M8555M065Z8HbhDlMfJ9c0vobtpOU+bqxAwA38atQHPrnLtGs/3ILA EObDPIrHgMICdL6/u4XjrvPR4yPgtsQlTdthj++nRP0SOW3pbUiFDCO+Hy+xBcvNcf nSTcW7jMyv7VQ/kj216KAq7uOT5/GW2n78IS3f5eXwVDB+7FEPTKlKjHEztUcTsCve S2PeF965B0e3g== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 7 Jan 2019 15:30:18 +1100 Message-Id: <20190107043020.145107-4-amitay@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107043020.145107-1-amitay@ozlabs.org> References: <20190107043020.145107-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 3/5] adu: Set default blocksize for adu 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/adu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libpdbg/adu.c b/libpdbg/adu.c index bc01625..650ec6b 100644 --- a/libpdbg/adu.c +++ b/libpdbg/adu.c @@ -117,6 +117,9 @@ static int adu_read(struct adu *adu, uint64_t start_addr, uint8_t *output, int rc = 0; uint64_t addr0, addr; + if (!block_size) + block_size = 8; + output0 = output; /* Align start address to block_sized boundary */ @@ -209,6 +212,9 @@ static int adu_write(struct adu *adu, uint64_t start_addr, uint8_t *input, int rc = 0, tsize; uint64_t addr, data, end_addr; + if (!block_size) + block_size = 8; + end_addr = start_addr + size; for (addr = start_addr; addr < end_addr; addr += tsize, input += tsize) { if ((addr % block_size) || (addr + block_size > end_addr)) {