From b9c068896914b4132a24839c9ef7f9fcd6282d88 Mon Sep 17 00:00:00 2001 From: Marcin Ko?cielnicki Date: Wed, 5 Feb 2014 09:01:25 +0100 Subject: Fix IO access functions on linux+sysfs. The offsets on the resourceX files are relative to BAR base - don't add the base address ourselves. Reviewed-by: Adam Jackson --- src/openbsd_pci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/openbsd_pci.c') diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c index 73c68f4..fe034f3 100644 --- a/src/openbsd_pci.c +++ b/src/openbsd_pci.c @@ -412,6 +412,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret, ret->base = base; ret->size = size; + ret->is_legacy = 1; return ret; #elif defined(__amd64__) struct amd64_iopl_args ia; @@ -422,6 +423,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret, ret->base = base; ret->size = size; + ret->is_legacy = 1; return ret; #elif defined(PCI_MAGIC_IO_RANGE) ret->memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, @@ -431,6 +433,7 @@ pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret, ret->base = base; ret->size = size; + ret->is_legacy = 1; return ret; #else return NULL; -- cgit v1.2.3