qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] s390/pci: fix build on 32-bit and non linux


From: Frank Blaschka
Subject: [Qemu-devel] [PATCH] s390/pci: fix build on 32-bit and non linux
Date: Tue, 16 Dec 2014 10:28:58 +0100

From: Frank Blaschka <address@hidden>

Remove unnecessary and wrong includes. Fix get_rt_sto and
get_st_pto to build on 32-bit.

Signed-off-by: Frank Blaschka <address@hidden>
---
 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 <hw/pci/pci.h>
+#include "s390-pci-bus.h"
 #include <hw/pci/pci_bus.h>
-#include <hw/s390x/css.h>
-#include <hw/s390x/sclp.h>
 #include <hw/pci/msi.h>
-#include "qemu/error-report.h"
-#include "s390-pci-bus.h"
+#include <qemu/error-report.h>
 
 /* #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 <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#include <linux/kvm.h>
-#include <asm/ptrace.h>
-#include <hw/pci/pci.h>
-#include <hw/pci/pci_host.h>
-#include <net/net.h>
-
-#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 <exec/memory-internal.h>
+#include <qemu/error-report.h>
 
 /* #define DEBUG_S390PCI_INST */
 #ifdef DEBUG_S390PCI_INST
-- 
1.8.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]