Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci.c
Context not available. | |||||
struct resource_list *rl = &dinfo->resources; | struct resource_list *rl = &dinfo->resources; | ||||
struct resource *res; | struct resource *res; | ||||
struct pci_map *pm; | struct pci_map *pm; | ||||
uint16_t cmd; | |||||
pci_addr_t map, testval; | pci_addr_t map, testval; | ||||
int mapsize; | int mapsize; | ||||
Context not available. | |||||
device_printf(child, | device_printf(child, | ||||
"Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n", | "Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n", | ||||
count, *rid, type, rman_get_start(res)); | count, *rid, type, rman_get_start(res)); | ||||
/* Disable decoding via the CMD register before updating the BAR */ | |||||
cmd = pci_read_config(child, PCIR_COMMAND, 2); | |||||
pci_write_config(child, PCIR_COMMAND, | |||||
cmd & ~(PCI_BAR_MEM(map) ? PCIM_CMD_MEMEN : PCIM_CMD_PORTEN), 2); | |||||
map = rman_get_start(res); | map = rman_get_start(res); | ||||
pci_write_bar(child, pm, map); | pci_write_bar(child, pm, map); | ||||
/* Restore the original value of the CMD register */ | |||||
pci_write_config(child, PCIR_COMMAND, cmd, 2); | |||||
out: | out: | ||||
return (res); | return (res); | ||||
} | } | ||||
Context not available. |