From patchwork Tue Jun 16 01:51:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 484764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 091DB140284 for ; Tue, 16 Jun 2015 12:01:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Ml0bmH7y; dkim-atps=neutral Received: from localhost ([::1]:37187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4gBi-00026u-A8 for incoming@patchwork.ozlabs.org; Mon, 15 Jun 2015 22:01:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4gB9-0001ap-Ul for qemu-devel@nongnu.org; Mon, 15 Jun 2015 22:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4gAh-0005cq-Mv for qemu-devel@nongnu.org; Mon, 15 Jun 2015 22:00:43 -0400 Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:33600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4gAh-0005by-H6 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 22:00:15 -0400 Received: by obcej4 with SMTP id ej4so2143499obc.0 for ; Mon, 15 Jun 2015 19:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6grBl8IiClg386SjXWKneOQnV5owyF2W4aNXHSxr3rk=; b=Ml0bmH7y50KAxTpK0Mv/yh8jFkpg6vyqVxbXyubbKADCUbTvyzk0R5TkV4PLLEWW/k ZPW0Q2J1AkWhoKPmxjBb6K2Hpcvw70mHiHYcSod/cUGwVuGlOSWv1+hHfT69VaDNWDia 2jKGXkGqVr0HOTOOt1Ghm7jOhS3yHqPR12vhH+BY0ZqF5SDJGwt6QCeLcETaftPVwRmK 5Tcg1ydqjbfdd8Ryi0ykzOyLZWogZOl+pt31MKeL1aPDdsFKlpoDuvUIpDrgG9hkZvQ8 6ti7gtSbuWkRaup7J+5iekrfXW+VHj9HuMCoiNA6+nT3LqNJzHxLKjtfxispnNe5EysH sY8A== X-Received: by 10.60.39.230 with SMTP id s6mr5433567oek.21.1434420015005; Mon, 15 Jun 2015 19:00:15 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id g7sm693536obk.15.2015.06.15.19.00.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Jun 2015 19:00:14 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 16 Jun 2015 11:51:54 +1000 Message-Id: <1434419515-3572-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434419515-3572-1-git-send-email-edgar.iglesias@gmail.com> References: <1434419515-3572-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::236 Cc: edgar.iglesias@xilinx.com, serge.fdrv@gmail.com, alex.bennee@linaro.org, agraf@suse.de Subject: [Qemu-devel] [PATCH v5 5/6] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 1b1cc71..f822ea0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -47,6 +47,7 @@ #include "hw/arm/virt-acpi-build.h" #include "hw/arm/sysbus-fdt.h" #include "hw/platform-bus.h" +#include "hw/intc/arm_gic_common.h" /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 256 @@ -395,15 +396,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,