[6604] qemu: warn if PCI region is not power of two (Marcelo Tosatti)
Revision: 6604
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6604 Author: aliguori Date: 2009-02-11 15:21:16 +0000 (Wed, 11 Feb 2009)
Log Message:
-----------
qemu: warn if PCI region is not power of two (Marcelo Tosatti)
Otherwise the PCI size for such regions can be calculated erroneously.
Signed-off-by Marcelo Tosatti <[email protected]>
Signed-off-by Anthony Liguori <[email protected]>
Modified Paths:
--------------
trunk/hw/pci.c
Modified: trunk/hw/pci.c
===================================================================
hw/pci.c +7 -0
@@ -247,6 +247,13 @@if ((unsigned int )region_num >=PCI_NUM_REGIONS )return ; + +if (size & (size-1 )) { +fprintf (stderr,"ERROR: PCI region size must be pow2 " +"type=0x%x, size=0x%x\n" , type, size); +exit (1 ); + } + r = &pci_dev->io_regions[region_num]; r->addr =-1 ; r->size = size;