From patchwork Sun Dec 17 21:27:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 10117921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A7E160327 for ; Sun, 17 Dec 2017 21:42:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C37828757 for ; Sun, 17 Dec 2017 21:42:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E94D28A90; Sun, 17 Dec 2017 21:42:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2E4928757 for ; Sun, 17 Dec 2017 21:42:26 +0000 (UTC) Received: from localhost ([::1]:55640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQghW-0002qa-8L for patchwork-qemu-devel@patchwork.kernel.org; Sun, 17 Dec 2017 16:42:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQgcw-0007Ef-Op for qemu-devel@nongnu.org; Sun, 17 Dec 2017 16:37:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQgct-00014q-H9 for qemu-devel@nongnu.org; Sun, 17 Dec 2017 16:37:42 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:55313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQgct-00014L-9z; Sun, 17 Dec 2017 16:37:39 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2FDAD41175; Mon, 18 Dec 2017 00:28:09 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 1A5A1C8E; Mon, 18 Dec 2017 00:25:46 +0300 (MSK) Received: (nullmailer pid 30886 invoked by uid 1000); Sun, 17 Dec 2017 21:28:08 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 00:27:07 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 02/61] hw/alpha/typhoon: simplify using the "unimplemented" sysbus device 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: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Michael Tokarev --- hw/alpha/alpha_sys.h | 1 - hw/alpha/pci.c | 26 -------------------------- hw/alpha/typhoon.c | 6 ++---- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index b6d8369ed7..9e67f78c60 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -15,7 +15,6 @@ PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4], pci_map_irq_fn); /* alpha_pci.c. */ -extern const MemoryRegionOps alpha_pci_ignore_ops; extern const MemoryRegionOps alpha_pci_conf1_ops; extern const MemoryRegionOps alpha_pci_iack_ops; diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c index 8dde637bfe..e0bcde9f70 100644 --- a/hw/alpha/pci.c +++ b/hw/alpha/pci.c @@ -14,32 +14,6 @@ #include "trace.h" -/* Fallback for unassigned PCI I/O operations. Avoids MCHK. */ - -static uint64_t ignore_read(void *opaque, hwaddr addr, unsigned size) -{ - return 0; -} - -static void ignore_write(void *opaque, hwaddr addr, uint64_t v, unsigned size) -{ -} - -const MemoryRegionOps alpha_pci_ignore_ops = { - .read = ignore_read, - .write = ignore_write, - .endianness = DEVICE_LITTLE_ENDIAN, - .valid = { - .min_access_size = 1, - .max_access_size = 8, - }, - .impl = { - .min_access_size = 1, - .max_access_size = 8, - }, -}; - - /* PCI config space reads/writes, to byte-word addressable memory. */ static uint64_t bw_conf1_read(void *opaque, hwaddr addr, unsigned size) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index ae11e012c7..d8e2cac3f3 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -11,6 +11,7 @@ #include "cpu.h" #include "hw/hw.h" #include "hw/devices.h" +#include "hw/misc/unimp.h" #include "sysemu/sysemu.h" #include "alpha_sys.h" #include "exec/address-spaces.h" @@ -876,10 +877,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, &s->pchip.reg_mem); /* Pchip0 PCI I/O, 0x801.FC00.0000, 32MB. */ - memory_region_init_io(&s->pchip.reg_io, OBJECT(s), &alpha_pci_ignore_ops, - NULL, "pci0-io", 32*MB); - memory_region_add_subregion(addr_space, 0x801fc000000ULL, - &s->pchip.reg_io); + create_unimplemented_device("pci0-io", 0x801fc000000ULL, 32 * MB); b = pci_register_bus(dev, "pci", typhoon_set_irq, sys_map_irq, s,