From patchwork Wed Feb 26 18:02:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25420 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3461220636 for ; Wed, 26 Feb 2014 19:34:56 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id at1sf4708693iec.1 for ; Wed, 26 Feb 2014 11:34:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=HtFduyaZdS2mbt5bU98QJ8ijDXjNzzRvGKVcWCYFAlE=; b=aPjx+ayFZgEQvCqaT8jR2QX7ezPg1Bn/nY54uTThSu4EVdar6RxBsuiXOguENuUSsK 62AQ/7V0KFP3RP0ULT1tp0LpL+KSjRCGSAWm3Qph4bGELWB1C2SM34FfJsv447fOYG4a eowAfba9WpOcg5HokipDuVyukBL1iTigx2jr0DL+7ailBI4eMtMjG5Uo0JlGdsmmsBOW 7ujlkKlPwf8OIaxBW21T2e6emnvp6lFLXK03rhGo1ZvHMOXCQMVV0/6t4piGVm9dQwkc Eb0eZvfWgxiNs7/fL2CoJhN2ZreUaXf7BjmcZSX05WqxtZnQJXsupHdUm8CI5Q2sKf5j qMmQ== X-Gm-Message-State: ALoCoQnxYGPX0KiTWSO4KUegE6qCk0wT7vWKUUSaMfK/lmrHfUHLUjhNdYTpwELG5GAe1KC9liAU X-Received: by 10.43.14.137 with SMTP id pq9mr514835icb.12.1393443295617; Wed, 26 Feb 2014 11:34:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.100 with SMTP id 91ls408975qgi.18.gmail; Wed, 26 Feb 2014 11:34:55 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr7211476vco.18.1393443295393; Wed, 26 Feb 2014 11:34:55 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id l2si497273vcf.43.2014.02.26.11.34.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 11:34:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id im17so1440292vcb.33 for ; Wed, 26 Feb 2014 11:34:55 -0800 (PST) X-Received: by 10.52.65.207 with SMTP id z15mr310377vds.61.1393443295311; Wed, 26 Feb 2014 11:34:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp49846vcz; Wed, 26 Feb 2014 11:34:54 -0800 (PST) X-Received: by 10.224.119.147 with SMTP id z19mr10866004qaq.20.1393443294709; Wed, 26 Feb 2014 11:34:54 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id ca6si507569qcb.66.2014.02.26.11.34.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 11:34:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:42148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIirJ-0004aa-IT for patch@linaro.org; Wed, 26 Feb 2014 13:05:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIioh-0000kT-IU for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIiof-0007Ij-VE for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:47 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIiof-0007Eu-PW for qemu-devel@nongnu.org; Wed, 26 Feb 2014 13:02:45 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WIioY-0006ED-41; Wed, 26 Feb 2014 18:02:38 +0000 From: Peter Maydell To: Anthony Liguori Date: Wed, 26 Feb 2014 18:02:35 +0000 Message-Id: <1393437755-23586-46-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393437755-23586-1-git-send-email-peter.maydell@linaro.org> References: <1393437755-23586-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 45/45] dma/pl330: implement dmaadnh instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Crosthwaite Implement the missing DMAADNH instruction. This is a minor variant of the DMAADDH instruction, so factor out to a common implementation for both (dmaadxh). Signed-off-by: Peter Crosthwaite Message-id: 73ab13532a7cae53441da89b46c279b5f50785e3.1393372019.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell --- hw/dma/pl330.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index b5d586b..608a58c 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -601,10 +601,12 @@ static inline void pl330_fault(PL330Chan *ch, uint32_t flags) * LEN - number of elements in ARGS array */ -static void pl330_dmaaddh(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) +static void pl330_dmaadxh(PL330Chan *ch, uint8_t *args, bool ra, bool neg) { - uint16_t im = (((uint16_t)args[1]) << 8) | ((uint16_t)args[0]); - uint8_t ra = (opcode >> 1) & 1; + uint32_t im = (args[1] << 8) | args[0]; + if (neg) { + im |= 0xffffu << 16; + } if (ch->is_manager) { pl330_fault(ch, PL330_FAULT_UNDEF_INSTR); @@ -617,6 +619,16 @@ static void pl330_dmaaddh(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) } } +static void pl330_dmaaddh(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) +{ + pl330_dmaadxh(ch, args, extract32(opcode, 1, 1), false); +} + +static void pl330_dmaadnh(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) +{ + pl330_dmaadxh(ch, args, extract32(opcode, 1, 1), true); +} + static void pl330_dmaend(PL330Chan *ch, uint8_t opcode, uint8_t *args, int len) { @@ -1042,6 +1054,7 @@ static void pl330_dmawmb(PL330Chan *ch, uint8_t opcode, /* NULL terminated array of the instruction descriptions. */ static const PL330InsnDesc insn_desc[] = { { .opcode = 0x54, .opmask = 0xFD, .size = 3, .exec = pl330_dmaaddh, }, + { .opcode = 0x5c, .opmask = 0xFD, .size = 3, .exec = pl330_dmaadnh, }, { .opcode = 0x00, .opmask = 0xFF, .size = 1, .exec = pl330_dmaend, }, { .opcode = 0x35, .opmask = 0xFF, .size = 2, .exec = pl330_dmaflushp, }, { .opcode = 0xA0, .opmask = 0xFD, .size = 6, .exec = pl330_dmago, },