Page MenuHomeFreeBSD

D20214.diff
No OneTemporary

D20214.diff

Index: head/sys/dev/pci/pci_host_generic.c
===================================================================
--- head/sys/dev/pci/pci_host_generic.c
+++ head/sys/dev/pci/pci_host_generic.c
@@ -359,29 +359,30 @@
switch (type) {
case SYS_RES_IOPORT:
+ case SYS_RES_MEMORY:
found = 0;
for (i = 0; i < MAX_RANGES_TUPLES; i++) {
pci_base = sc->ranges[i].pci_base;
phys_base = sc->ranges[i].phys_base;
size = sc->ranges[i].size;
- if ((rid > pci_base) && (rid < (pci_base + size))) {
+ if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size))) {
found = 1;
break;
}
}
if (found) {
- rman_set_start(r, rman_get_start(r) + phys_base);
- rman_set_end(r, rman_get_end(r) + phys_base);
+ rman_set_start(r, rman_get_start(r) - pci_base + phys_base);
+ rman_set_end(r, rman_get_end(r) - pci_base + phys_base);
res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev),
child, type, rid, r);
} else {
device_printf(dev,
- "Failed to activate IOPORT resource\n");
+ "Failed to activate %s resource\n",
+ type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY");
res = 0;
}
break;
- case SYS_RES_MEMORY:
case SYS_RES_IRQ:
res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child,
type, rid, r);
Index: head/sys/dev/pci/pci_host_generic_acpi.c
===================================================================
--- head/sys/dev/pci/pci_host_generic_acpi.c
+++ head/sys/dev/pci/pci_host_generic_acpi.c
@@ -148,8 +148,6 @@
off = res->Data.Address32.Address.TranslationOffset;
break;
case ACPI_RESOURCE_TYPE_ADDRESS64:
- if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE)
- break;
min = res->Data.Address64.Address.Minimum;
max = res->Data.Address64.Address.Maximum;
off = res->Data.Address64.Address.TranslationOffset;
@@ -293,7 +291,7 @@
continue; /* empty range element */
if (sc->base.ranges[tuple].flags & FLAG_MEM) {
error = rman_manage_region(&sc->base.mem_rman,
- phys_base, phys_base + size - 1);
+ pci_base, pci_base + size - 1);
} else if (sc->base.ranges[tuple].flags & FLAG_IO) {
error = rman_manage_region(&sc->base.io_rman,
pci_base + PCI_IO_WINDOW_OFFSET,

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 8:06 PM (8 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14807183
Default Alt Text
D20214.diff (2 KB)

Event Timeline