]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
powerpc pci: fixed packing of ranges[]
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 18 Jul 2012 08:22:51 +0000 (18:22 +1000)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Sat, 21 Jul 2012 09:54:40 +0000 (10:54 +0100)
By default mingw-gcc is trying to pack structures the way to
preserve binary compatibility with MS Visual C what leads to
incorrect and unexpected padding in the PCI bus ranges property of
the sPAPR PHB.

The patch replaces __attribute__((packed)) with more strict QEMU_PACKED
which actually is __attribute__((gcc_struct, packed)) on Windows.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/spapr_pci.c

index 47ba5ff770c56237fefddedcf524b85fd95a6540..b2e4f785eae8ec3f59cf29dbb5347d1f3be3d096 100644 (file)
@@ -418,7 +418,7 @@ int spapr_populate_pci_devices(sPAPRPHBState *phb,
         uint64_t child;
         uint64_t parent;
         uint64_t size;
-    } __attribute__((packed)) ranges[] = {
+    } QEMU_PACKED ranges[] = {
         {
             cpu_to_be32(b_ss(1)), cpu_to_be64(0),
             cpu_to_be64(phb->io_win_addr),