Commit d7ce493a38680aeb9283129cf4f4ea576da62997
1 parent
6a882643
Initialize PCI BAR config data.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1824 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
0 deletions
hw/pci.c
@@ -124,6 +124,7 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num, | @@ -124,6 +124,7 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num, | ||
124 | PCIMapIORegionFunc *map_func) | 124 | PCIMapIORegionFunc *map_func) |
125 | { | 125 | { |
126 | PCIIORegion *r; | 126 | PCIIORegion *r; |
127 | + uint32_t addr; | ||
127 | 128 | ||
128 | if ((unsigned int)region_num >= PCI_NUM_REGIONS) | 129 | if ((unsigned int)region_num >= PCI_NUM_REGIONS) |
129 | return; | 130 | return; |
@@ -132,6 +133,12 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num, | @@ -132,6 +133,12 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num, | ||
132 | r->size = size; | 133 | r->size = size; |
133 | r->type = type; | 134 | r->type = type; |
134 | r->map_func = map_func; | 135 | r->map_func = map_func; |
136 | + if (region_num == PCI_ROM_SLOT) { | ||
137 | + addr = 0x30; | ||
138 | + } else { | ||
139 | + addr = 0x10 + region_num * 4; | ||
140 | + } | ||
141 | + *(uint32_t *)(pci_dev->config + addr) = cpu_to_le32(type); | ||
135 | } | 142 | } |
136 | 143 | ||
137 | static void pci_addr_writel(void* opaque, uint32_t addr, uint32_t val) | 144 | static void pci_addr_writel(void* opaque, uint32_t addr, uint32_t val) |