Received: by 2002:adf:e804:0:0:0:0:0 with SMTP id o4csp1087475wrm; Fri, 18 Oct 2019 08:43:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMrtfOS1rZzv8wjMVPDSA6ESkFxynBnW/dearcKAFIes0gKRGAyanDVHhioyOWf1Oq0WhZ X-Received: by 2002:a05:620a:1497:: with SMTP id w23mr5844264qkj.302.1571413436031; Fri, 18 Oct 2019 08:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571413436; cv=none; d=google.com; s=arc-20160816; b=VeU+VqvhmTas8kbrx8QRJ64TCc7z+qLNS/r3FtXkTg+y4ITaPJkYQi6fQ4EejUYmCW 6UMLWb/RNKy9T5Beh7wr4Y58QtvAOF9v2LLSz5WTOD/OEXH0gwakKZUzDe252E1QFyvE YZKXalTUOP830QhH1rNKmBPujixCd/Wdv9X/CnoyV5pbzxRrL+VgAniYlOMMV18YB1Qg 04V2KL9s+gN6QBJxGWDDHaTFSjD1SDOgot6yBS45i/6BshMRasF+8GAQ46Uw6DvV7Gv0 mOsWbLdUJSKOy3CHkOqYYHtG+gL5gblsMVPM8N38kIE88rhMnCW71xWuCdA3zb5r1XO/ rk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=ICNZv7zxEprGe6hQBwbFL6RXEspNBPSHhnEYEskmwhQ=; b=m15Ht/n7yZjhthudVdpP43/cOuuwStIuLuGxlU/5PthOHJNtdoEQKg+0nCnyMNva26 Ly0DY3Ra4eLO9eP759ryzV1fd76xBbYM5J/theAhLFklDM2oGAxS3pt47wZXPRlX2g23 up2gCHGp93za8kMOJRlAjhXj6hp0UNP5Ah4t8ftUMRVjVL6ccVLC/5/sYDWpshp4AkXG gzKGDmA0+j4xUF9zvgph0b5ro0iontFjL10de+x4X3zE4PczeSYl/lHV4QImqKzY4HGe 3pCJ086gJZkNqmlmL6yKpBy+Dw0zZ/pfdN6rG1SUcyfdTXEf0dYf+o5RTXr3iBYffE+S s+jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o32si6326273qvh.190.2019.10.18.08.43.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 08:43:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:42104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLUPy-0001QI-Jd for alex.bennee@linaro.org; Fri, 18 Oct 2019 11:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44415) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLUPR-0000li-Rv for qemu-arm@nongnu.org; Fri, 18 Oct 2019 11:43:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLUPQ-00073R-Ic for qemu-arm@nongnu.org; Fri, 18 Oct 2019 11:43:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLUPQ-00072e-AO; Fri, 18 Oct 2019 11:43:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6390483F45; Fri, 18 Oct 2019 15:43:19 +0000 (UTC) Received: from localhost (ovpn-112-40.ams2.redhat.com [10.36.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEDD2600D1; Fri, 18 Oct 2019 15:43:17 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PATCH 08/14] cris: replace PROP_PTR with PROP_LINK for interrupt vector Date: Fri, 18 Oct 2019 17:42:06 +0200 Message-Id: <20191018154212.13458-9-marcandre.lureau@redhat.com> In-Reply-To: <20191018154212.13458-1-marcandre.lureau@redhat.com> References: <20191018154212.13458-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 18 Oct 2019 15:43:19 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , Peter Maydell , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , BALATON Zoltan , KONRAD Frederic , Aleksandar Rikalo , Magnus Damm , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Artyom Tarasenko , Eduardo Habkost , Fabien Chouteau , qemu-arm@nongnu.org, Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-ppc@nongnu.org, Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: GsDDqX1MGf8C Instead of using raw interrupt vector pointer, store the associated CPU with a link property. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/cris/axis_dev88.c | 4 +--- hw/intc/Makefile.objs | 2 +- hw/intc/etraxfs_pic.c | 18 +++++++----------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index 940c7dd122..cb7b1b58aa 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -253,7 +253,6 @@ void axisdev88_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; CRISCPU *cpu; - CPUCRISState *env; DeviceState *dev; SysBusDevice *s; DriveInfo *nand; @@ -267,7 +266,6 @@ void axisdev88_init(MachineState *machine) =20 /* init CPUs */ cpu =3D CRIS_CPU(cpu_create(machine->cpu_type)); - env =3D &cpu->env; =20 /* allocate RAM */ memory_region_allocate_system_memory(phys_ram, NULL, "axisdev88.ram"= , @@ -298,7 +296,7 @@ void axisdev88_init(MachineState *machine) =20 dev =3D qdev_create(NULL, "etraxfs,pic"); /* FIXME: Is there a proper way to signal vectors to the CPU core? = */ - qdev_prop_set_ptr(dev, "interrupt_vector", &env->interrupt_vector); + object_property_set_link(OBJECT(dev), OBJECT(cpu), "cpu", &error_abo= rt); qdev_init_nofail(dev); s =3D SYS_BUS_DEVICE(dev); sysbus_mmio_map(s, 0, 0x3001c000); diff --git a/hw/intc/Makefile.objs b/hw/intc/Makefile.objs index f726d87532..26a3cb36cb 100644 --- a/hw/intc/Makefile.objs +++ b/hw/intc/Makefile.objs @@ -5,7 +5,6 @@ common-obj-$(CONFIG_PUV3) +=3D puv3_intc.o common-obj-$(CONFIG_XILINX) +=3D xilinx_intc.o common-obj-$(CONFIG_XLNX_ZYNQMP_PMU) +=3D xlnx-pmu-iomod-intc.o common-obj-$(CONFIG_XLNX_ZYNQMP) +=3D xlnx-zynqmp-ipi.o -common-obj-$(CONFIG_ETRAXFS) +=3D etraxfs_pic.o common-obj-$(CONFIG_IMX) +=3D imx_avic.o imx_gpcv2.o common-obj-$(CONFIG_LM32) +=3D lm32_pic.o common-obj-$(CONFIG_REALVIEW) +=3D realview_gic.o @@ -49,3 +48,4 @@ obj-$(CONFIG_ARM_GIC) +=3D arm_gicv3_cpuif.o obj-$(CONFIG_MIPS_CPS) +=3D mips_gic.o obj-$(CONFIG_NIOS2) +=3D nios2_iic.o obj-$(CONFIG_OMPIC) +=3D ompic.o +obj-$(CONFIG_ETRAXFS) +=3D etraxfs_pic.o diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c index 77f652acec..8065fc757e 100644 --- a/hw/intc/etraxfs_pic.c +++ b/hw/intc/etraxfs_pic.c @@ -27,8 +27,7 @@ #include "qemu/module.h" #include "hw/irq.h" #include "hw/qdev-properties.h" -//#include "pc.h" -//#include "etraxfs.h" +#include "target/cris/cpu.h" =20 #define D(x) =20 @@ -48,10 +47,10 @@ struct etrax_pic SysBusDevice parent_obj; =20 MemoryRegion mmio; - void *interrupt_vector; qemu_irq parent_irq; qemu_irq parent_nmi; uint32_t regs[R_MAX]; + CRISCPU *cpu; }; =20 static void pic_update(struct etrax_pic *fs) @@ -79,9 +78,10 @@ static void pic_update(struct etrax_pic *fs) } } =20 - if (fs->interrupt_vector) { - /* hack alert: ptr property */ - *(uint32_t*)(fs->interrupt_vector) =3D vector; + if (fs->cpu) { + /* hack alert: cpu link property */ + int32_t *int_vec =3D &fs->cpu->env.interrupt_vector; + *int_vec =3D (uint32_t)vector; } qemu_set_irq(fs->parent_irq, !!vector); } @@ -164,7 +164,7 @@ static void etraxfs_pic_init(Object *obj) } =20 static Property etraxfs_pic_properties[] =3D { - DEFINE_PROP_PTR("interrupt_vector", struct etrax_pic, interrupt_vect= or), + DEFINE_PROP_LINK("cpu", struct etrax_pic, cpu, TYPE_CRIS_CPU, CRISCP= U *), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -173,10 +173,6 @@ static void etraxfs_pic_class_init(ObjectClass *klas= s, void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->props =3D etraxfs_pic_properties; - /* - * Note: pointer property "interrupt_vector" may remain null, thus - * no need for dc->user_creatable =3D false; - */ } =20 static const TypeInfo etraxfs_pic_info =3D { --=20 2.23.0.606.g08da6496b6