From patchwork Thu Aug 13 10:44:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 52373 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 2283922EC6 for ; Thu, 13 Aug 2015 10:57:29 +0000 (UTC) Received: by lagz9 with SMTP id z9sf15538155lag.3 for ; Thu, 13 Aug 2015 03:57:28 -0700 (PDT) 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: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=Aa4WzA9OZKeqIk+cZ2TWpt2Od/sZuR61EdduTbztJBI=; b=VyYjpISNvRwSuWhB2RU7NjelSDiBf3pmV48MlfzT4prvSEKXCqeHRfbI46S58T+Tlw 1l+H+DCw6RYGIXUIQeTnZ7IKLUAGzzY0BJWTrVYZ2VEVOOlPYblWOpUUZszc7lt5h2tK t4DtRs+nBp31QpTmdsdagpxwnsE2t5p8yFbfw8A2UHmlB5BpeZ+10GhT7A+G8RfZb6Gn aILOSfN2bR2FSy5y6Fmlvpp4tzSCGSiF03Aqp/vdCDKDR3+H7Ek/r5FnxXfSgjwta+H7 ipw98He5bsF3dFlMiAHW3OpVhovmrcuqsY1TT0rD6utPm+/HjPry6/2pIQSymZTsJZ26 QIQw== X-Gm-Message-State: ALoCoQnraAMy+FOfiK2zjiYCXTqgR0fEY/USYtmzhvBtLqRuk5+7fJ/JtS318iNcd8M9pRajhDUQ X-Received: by 10.112.54.166 with SMTP id k6mr11123333lbp.0.1439463448105; Thu, 13 Aug 2015 03:57:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.100 with SMTP id s4ls159033lag.83.gmail; Thu, 13 Aug 2015 03:57:27 -0700 (PDT) X-Received: by 10.152.21.71 with SMTP id t7mr35116820lae.118.1439463447903; Thu, 13 Aug 2015 03:57:27 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id z20si1810264lbg.121.2015.08.13.03.57.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 03:57:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbtg9 with SMTP id tg9so25004380lbb.1 for ; Thu, 13 Aug 2015 03:57:27 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr35413242lav.36.1439463447808; Thu, 13 Aug 2015 03:57:27 -0700 (PDT) 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.112.7.198 with SMTP id l6csp862575lba; Thu, 13 Aug 2015 03:57:26 -0700 (PDT) X-Received: by 10.50.72.113 with SMTP id c17mr26710164igv.73.1439463446225; Thu, 13 Aug 2015 03:57:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g63si1208812ioj.58.2015.08.13.03.57.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Aug 2015 03:57:26 -0700 (PDT) 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]:41738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPqCL-00024i-4o for patch@linaro.org; Thu, 13 Aug 2015 06:57:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0R-0005Wk-3h for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPq0M-0005Pl-C7 for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:07 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0M-0005DT-2U for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:02 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZPq07-00070m-Nx for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Aug 2015 11:44:26 +0100 Message-Id: <1439462687-26903-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1439462687-26903-1-git-send-email-peter.maydell@linaro.org> References: <1439462687-26903-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 Subject: [Qemu-devel] [PULL 06/27] hw/arm/virt: Replace magic IRQ constants with macros 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=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: "Edgar E. Iglesias" Replace magic constants with macros from hw/arm/virt.h and hw/intc/arm_gic_common.h. Reviewed-by: Peter Maydell Signed-off-by: Edgar E. Iglesias Message-id: 1436791864-4582-7-git-send-email-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- hw/arm/virt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 4846892..42efad1 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -48,6 +48,7 @@ #include "hw/arm/sysbus-fdt.h" #include "hw/platform-bus.h" #include "hw/arm/fdt.h" +#include "hw/intc/arm_gic_common.h" /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 256 @@ -390,15 +391,17 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic) */ for (i = 0; i < smp_cpus; i++) { DeviceState *cpudev = DEVICE(qemu_get_cpu(i)); - int ppibase = NUM_IRQS + i * 32; + int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS; /* physical timer; we wire it up to the non-secure timer's ID, * since a real A15 always has TrustZone but QEMU doesn't. */ qdev_connect_gpio_out(cpudev, 0, - qdev_get_gpio_in(gicdev, ppibase + 30)); + qdev_get_gpio_in(gicdev, + ppibase + ARCH_TIMER_NS_EL1_IRQ)); /* virtual timer */ qdev_connect_gpio_out(cpudev, 1, - qdev_get_gpio_in(gicdev, ppibase + 27)); + qdev_get_gpio_in(gicdev, + ppibase + ARCH_TIMER_VIRT_IRQ)); sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ)); sysbus_connect_irq(gicbusdev, i + smp_cpus,