From: Alexey Kardashevskiy Date: Wed, 18 Jul 2012 08:22:51 +0000 (+1000) Subject: powerpc pci: fixed packing of ranges[] X-Git-Tag: v1.2.0-rc0~143^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4889f54237aec5195d42de2c87292d6e41dd704;p=thirdparty%2Fqemu.git powerpc pci: fixed packing of ranges[] 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 Tested-by: Stefan Weil Reviewed-by: Stefan Weil Acked-by: Alexander Graf Signed-off-by: Stefan Hajnoczi --- diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index 47ba5ff770c..b2e4f785eae 100644 --- a/hw/spapr_pci.c +++ b/hw/spapr_pci.c @@ -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),