From patchwork Sat Jul 21 12:27:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/6] powerpc pci: fixed packing of ranges[] X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 172430 Message-Id: <1342873625-7979-2-git-send-email-stefanha@linux.vnet.ibm.com> To: Anthony Liguori Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Stefan Hajnoczi Date: Sat, 21 Jul 2012 13:27:00 +0100 From: Stefan Hajnoczi List-Id: From: Alexey Kardashevskiy 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 --- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index 47ba5ff..b2e4f78 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),