From patchwork Tue Dec 16 09:28:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Blaschka X-Patchwork-Id: 421825 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 C0BAD1400D2 for ; Tue, 16 Dec 2014 20:29:43 +1100 (AEDT) Received: from localhost ([::1]:43683 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0oRo-00051p-GT for incoming@patchwork.ozlabs.org; Tue, 16 Dec 2014 04:29:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0oRP-0004kH-Fa for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:29:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0oRG-0004fC-CP for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:29:15 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:41778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0oRG-0004ev-3R for qemu-devel@nongnu.org; Tue, 16 Dec 2014 04:29:06 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Dec 2014 09:29:03 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Dec 2014 09:29:02 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 512C917D8047 for ; Tue, 16 Dec 2014 09:29:27 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBG9T2GO48955600 for ; Tue, 16 Dec 2014 09:29:02 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBG9T1TE002002 for ; Tue, 16 Dec 2014 02:29:02 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBG9T0sD001930; Tue, 16 Dec 2014 02:29:00 -0700 From: Frank Blaschka To: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, agraf@suse.de, peter.maydell@linaro.org Date: Tue, 16 Dec 2014 10:28:58 +0100 Message-Id: <1418722138-37222-1-git-send-email-blaschka@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.5.5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121609-0021-0000-0000-0000022CEF96 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.111 Cc: Frank Blaschka , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] s390/pci: fix build on 32-bit and non linux 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: Frank Blaschka Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit. Signed-off-by: Frank Blaschka --- hw/s390x/s390-pci-bus.c | 25 +++++++++++-------------- hw/s390x/s390-pci-inst.c | 30 +++--------------------------- 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index c1b57d0..c9c06e6 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -11,13 +11,10 @@ * directory. */ -#include +#include "s390-pci-bus.h" #include -#include -#include #include -#include "qemu/error-report.h" -#include "s390-pci-bus.h" +#include /* #define DEBUG_S390PCI_BUS */ #ifdef DEBUG_S390PCI_BUS @@ -253,18 +250,18 @@ static unsigned int calc_px(dma_addr_t ptr) return ((unsigned long) ptr >> PAGE_SHIFT) & ZPCI_PT_MASK; } -static unsigned long *get_rt_sto(unsigned long entry) +static uint64_t get_rt_sto(uint64_t entry) { return ((entry & ZPCI_TABLE_TYPE_MASK) == ZPCI_TABLE_TYPE_RTX) - ? (unsigned long *) (entry & ZPCI_RTE_ADDR_MASK) - : NULL; + ? (entry & ZPCI_RTE_ADDR_MASK) + : 0; } -static unsigned long *get_st_pto(unsigned long entry) +static uint64_t get_st_pto(uint64_t entry) { return ((entry & ZPCI_TABLE_TYPE_MASK) == ZPCI_TABLE_TYPE_SX) - ? (unsigned long *) (entry & ZPCI_STE_ADDR_MASK) - : NULL; + ? (entry & ZPCI_STE_ADDR_MASK) + : 0; } static uint64_t s390_guest_io_table_walk(uint64_t guest_iota, @@ -280,7 +277,7 @@ static uint64_t s390_guest_io_table_walk(uint64_t guest_iota, sto_a = guest_iota + rtx * sizeof(uint64_t); sto = ldq_phys(&address_space_memory, sto_a); - sto = (uint64_t)get_rt_sto(sto); + sto = get_rt_sto(sto); if (!sto) { pte = 0; goto out; @@ -288,7 +285,7 @@ static uint64_t s390_guest_io_table_walk(uint64_t guest_iota, pto_a = sto + sx * sizeof(uint64_t); pto = ldq_phys(&address_space_memory, pto_a); - pto = (uint64_t)get_st_pto(pto); + pto = get_st_pto(pto); if (!pto) { pte = 0; goto out; @@ -322,7 +319,7 @@ static IOMMUTLBEntry s390_translate_iommu(MemoryRegion *iommu, hwaddr addr, /* s390 does not have an APIC maped to main storage so we use * a separate AddressSpace only for msix notifications */ - if (addr == ZPCI_MSI_ADDR) { + if (((uint64_t)addr) == ZPCI_MSI_ADDR) { ret.target_as = &s->msix_notify_as; ret.iova = addr; ret.translated_addr = addr; diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 83ab60f..d486cbb 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -11,34 +11,10 @@ * directory. */ -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "qemu-common.h" -#include "qemu/timer.h" -#include "migration/qemu-file.h" -#include "sysemu/sysemu.h" -#include "sysemu/kvm.h" -#include "cpu.h" -#include "sysemu/device_tree.h" -#include "monitor/monitor.h" #include "s390-pci-inst.h" - -#include "hw/hw.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_bridge.h" -#include "hw/pci/pci_bus.h" -#include "hw/pci/pci_host.h" -#include "hw/s390x/s390-pci-bus.h" -#include "exec/exec-all.h" -#include "exec/memory-internal.h" +#include "s390-pci-bus.h" +#include +#include /* #define DEBUG_S390PCI_INST */ #ifdef DEBUG_S390PCI_INST