diff options
author | Keith Packard <keithp@koto.keithp.com> | 2007-09-06 14:31:55 -0700 |
---|---|---|
committer | Keith Packard <keithp@koto.keithp.com> | 2007-09-06 14:38:37 -0700 |
commit | 286f5df0b62f571cbb4dbf120679d3af029b8775 (patch) | |
tree | cd373666254d56a137d282deeb15a2ccaf8da22b /src/reg_dumper | |
parent | 2a8592f2ebcba86b1127aa889155d58a3dc186ca (diff) |
Switch to pci_device_map_range/pci_device_unmap_range APIs.
With the libpciaccess change that added these new APIs, use them
for all mapping.
Diffstat (limited to 'src/reg_dumper')
-rw-r--r-- | src/reg_dumper/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/reg_dumper/main.c b/src/reg_dumper/main.c index b3c50dee..5c8ef9ed 100644 --- a/src/reg_dumper/main.c +++ b/src/reg_dumper/main.c @@ -40,6 +40,7 @@ int main(int argc, char **argv) I830Rec i830; ScrnInfoRec scrn; int err, mmio_bar; + void *mmio; err = pci_system_init(); if (err != 0) { @@ -68,12 +69,17 @@ int main(int argc, char **argv) mmio_bar = IS_I9XX((&i830)) ? 0 : 1; - err = pci_device_map_region(dev, mmio_bar, 1); + err = pci_device_map_range (dev, + dev->regions[mmio_bar].base_addr, + dev->regions[mmio_bar].size, + PCI_DEV_MAP_FLAG_WRITABLE, + &mmio); + if (err != 0) { fprintf(stderr, "Couldn't map MMIO region: %s\n", strerror(err)); exit(1); } - i830.mmio = i830.pci_dev->regions[mmio_bar].memory; + i830.mmio = mmio; scrn.scrnIndex = 0; scrn.pI830 = &i830; |