From nobody Tue Feb 10 12:13:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1558086458; cv=none; d=zoho.com; s=zohoarc; b=Imq27/2euw9jp6bdKwm2ijJX1rX+soYK+WzetLdul2NrE9iVfADx/aQfcORjv37fSR8kD5KLRyEnSmY2lrZtGHEu0Lqz7TPiYPgOFgfsHHSOihg9oLU+fVK3ClLkv6bihy6/O+uwZilUhhcHbeFj7A5QR1/98ulKGuGznIRSPHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558086458; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Lk4O5022BfdgsXozaU4aW4xnur6MwgzVlTkjn3XMKsY=; b=lP6hXIDqXkORktAqm6vEMy/Eh+E98dXVBJ4K62xpikH19evSM3sFCfXD8Nk0xLFm4NebVsuQKNX3e7xbCTg/l8BDFcDv2LE5JNGRfUcCK+/YItVsA65wCrAaqU/WqEiJhLGmWB+LxgJOvDV/AJhcdyiz7rvmJ96OuUTmtoVb0FY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155808645813964.75596209216678; Fri, 17 May 2019 02:47:38 -0700 (PDT) Received: from localhost ([127.0.0.1]:45380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZSb-00018p-Un for importer@patchew.org; Fri, 17 May 2019 05:47:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRZM1-0004IX-Dr for qemu-devel@nongnu.org; Fri, 17 May 2019 05:40:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRZM0-000261-6M for qemu-devel@nongnu.org; Fri, 17 May 2019 05:40:41 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:55358 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRZLz-00021A-VZ for qemu-devel@nongnu.org; Fri, 17 May 2019 05:40:40 -0400 Received: from host109-146-247-8.range109-146.btcentralplus.com ([109.146.247.8] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hRZLE-00018L-5p; Fri, 17 May 2019 10:39:52 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 17 May 2019 10:40:24 +0100 Message-Id: <20190517094029.7667-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190517094029.7667-1-mark.cave-ayland@ilande.co.uk> References: <20190517094029.7667-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.247.8 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 3/8] grlib, irqmp: get rid of the old-style create function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: KONRAD Frederic Suggested-by: Mark Cave-Ayland Signed-off-by: KONRAD Frederic Signed-off-by: Mark Cave-Ayland --- hw/intc/grlib_irqmp.c | 3 +-- hw/sparc/leon3.c | 12 ++++++++++-- include/hw/sparc/grlib.h | 31 ++----------------------------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index d6f9cb3692..20accb6c4d 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -3,7 +3,7 @@ * * (Multiprocessor and extended interrupt not supported) * - * Copyright (c) 2010-2011 AdaCore + * Copyright (c) 2010-2019 AdaCore * * Permission is hereby granted, free of charge, to any person obtaining a= copy * of this software and associated documentation files (the "Software"), t= o deal @@ -47,7 +47,6 @@ #define FORCE_OFFSET 0x80 #define EXTENDED_OFFSET 0xC0 =20 -#define TYPE_GRLIB_IRQMP "grlib,irqmp" #define GRLIB_IRQMP(obj) OBJECT_CHECK(IRQMP, (obj), TYPE_GRLIB_IRQMP) =20 typedef struct IRQMPState IRQMPState; diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index f438718794..34306937bc 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -47,6 +47,8 @@ =20 #define MAX_PILS 16 =20 +#define LEON3_IRQMP_OFFSET (0x80000200) + typedef struct ResetData { SPARCCPU *cpu; uint32_t entry; /* save kernel entry in case of reset */ @@ -121,6 +123,7 @@ static void leon3_generic_hw_init(MachineState *machine) int bios_size; int prom_size; ResetData *reset_info; + DeviceState *dev; =20 /* Init CPU */ cpu =3D SPARC_CPU(cpu_create(machine->cpu_type)); @@ -135,9 +138,14 @@ static void leon3_generic_hw_init(MachineState *machin= e) qemu_register_reset(main_cpu_reset, reset_info); =20 /* Allocate IRQ manager */ - grlib_irqmp_create(0x80000200, env, &cpu_irqs, MAX_PILS, &leon3_set_pi= l_in); - + dev =3D qdev_create(NULL, TYPE_GRLIB_IRQMP); + qdev_prop_set_ptr(dev, "set_pil_in", leon3_set_pil_in); + qdev_prop_set_ptr(dev, "set_pil_in_opaque", env); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_IRQMP_OFFSET); + env->irq_manager =3D dev; env->qemu_irq_ack =3D leon3_irq_manager; + cpu_irqs =3D qemu_allocate_irqs(grlib_irqmp_set_irq, dev, MAX_PILS); =20 /* Allocate RAM */ if (ram_size > 1 * GiB) { diff --git a/include/hw/sparc/grlib.h b/include/hw/sparc/grlib.h index 61a345c269..bef371a06f 100644 --- a/include/hw/sparc/grlib.h +++ b/include/hw/sparc/grlib.h @@ -1,7 +1,7 @@ /* * QEMU GRLIB Components * - * Copyright (c) 2010-2011 AdaCore + * Copyright (c) 2010-2019 AdaCore * * Permission is hereby granted, free of charge, to any person obtaining a= copy * of this software and associated documentation files (the "Software"), t= o deal @@ -33,6 +33,7 @@ */ =20 /* IRQMP */ +#define TYPE_GRLIB_IRQMP "grlib,irqmp" =20 typedef void (*set_pil_in_fn) (void *opaque, uint32_t pil_in); =20 @@ -40,34 +41,6 @@ void grlib_irqmp_set_irq(void *opaque, int irq, int leve= l); =20 void grlib_irqmp_ack(DeviceState *dev, int intno); =20 -static inline -DeviceState *grlib_irqmp_create(hwaddr base, - CPUSPARCState *env, - qemu_irq **cpu_irqs, - uint32_t nr_irqs, - set_pil_in_fn set_pil_in) -{ - DeviceState *dev; - - assert(cpu_irqs !=3D NULL); - - dev =3D qdev_create(NULL, "grlib,irqmp"); - qdev_prop_set_ptr(dev, "set_pil_in", set_pil_in); - qdev_prop_set_ptr(dev, "set_pil_in_opaque", env); - - qdev_init_nofail(dev); - - env->irq_manager =3D dev; - - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - - *cpu_irqs =3D qemu_allocate_irqs(grlib_irqmp_set_irq, - dev, - nr_irqs); - - return dev; -} - /* GPTimer */ =20 static inline --=20 2.11.0