[PATCH:libpciaccess 3/3] Support more pci functions on NetBSD.
Thomas Klausner
wiz at NetBSD.org
Fri Jun 14 03:54:43 PDT 2013
Hi Matthieu!
Thanks for the review!
On Thu, Jun 13, 2013 at 12:28:05AM +0200, Matthieu Herrb wrote:
> > +#if defined(__i386__) || defined(__amd64__)
> > +#include <machine/sysarch.h>
> > +//#include <machine/pio.h>
> ^^
> Please Remove the commented out line above
Ok, will do.
> > +static struct pci_io_handle *
> > +pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret,
> > + struct pci_device *dev, pciaddr_t base, pciaddr_t size)
> > +{
> > +#if defined(__i386__)
> > + struct i386_iopl_args ia;
> > +
> > + ia.iopl = 1;
> > + if (sysarch(I386_IOPL, &ia))
> > + return NULL;
> > +
> > + ret->base = base;
> > + ret->size = size;
> > + return ret;
> > +#elif defined(__amd64__)
> > + struct x86_64_iopl_args ia;
> > +
> > + ia.iopl = 1;
> > + if (sysarch(X86_64_IOPL, &ia))
> > + return NULL;
> > +
> > + ret->base = base;
> > + ret->size = size;
> > + return ret;
> > +#elif defined(PCI_MAGIC_IO_RANGE)
> > + ret->memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
> > + aperturefd, PCI_MAGIC_IO_RANGE + base);
>
> Hmm where is aperturefd defined in the NetBSD case ? (I know it's is
> defined as static in openbsd_pci.c, but I can't find the similar hack
> for NetBSD
That's a copy'n'paste error from openbsd_pci.c. PCI_MAGIC_IO_RANGE is
only defined for a few ports of NetBSD anyway, and neither me nor
Chuck know what the proper way to do this is. I guess I'll just remove
this #elif clause.
> -- and it should not be needed in NetBSD's case where all
> memory can be be mapped through the /dev/pci* entry).
Can you please expand on this or suggest what the patch should look
like?
Thanks,
Thomas
More information about the xorg-devel
mailing list