提交 a4c20c6a 编写于 作者: A aliguori

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: NMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6604 c046a42c-6fe2-441c-8c8c-71466251a162
上级 5851e08c
无相关合并请求
......@@ -247,6 +247,13 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部