nuke PCI_ALLOW_MMAP, instead allow mmap(/dev/pci*) with options INSECURE
now the x86 camp should be happy again
This commit is contained in:
parent
07c495396f
commit
e06eca8326
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pci_usrreq.c,v 1.20 2009/07/09 19:22:21 macallan Exp $ */
|
||||
/* $NetBSD: pci_usrreq.c,v 1.21 2009/07/14 19:54:40 macallan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.20 2009/07/09 19:22:21 macallan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.21 2009/07/14 19:54:40 macallan Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_usrreq.c,v 1.20 2009/07/09 19:22:21 macallan Exp
|
||||
#include <dev/pci/pciio.h>
|
||||
|
||||
#include "opt_pci.h"
|
||||
#include "opt_insecure.h"
|
||||
|
||||
static int
|
||||
pciopen(dev_t dev, int flags, int mode, struct lwp *l)
|
||||
@ -112,7 +113,7 @@ pciioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
|
||||
static paddr_t
|
||||
pcimmap(dev_t dev, off_t offset, int prot)
|
||||
{
|
||||
#ifdef PCI_ALLOW_MMAP
|
||||
#ifdef INSECURE
|
||||
struct pci_softc *sc = device_lookup_private(&pci_cd, minor(dev));
|
||||
|
||||
/*
|
||||
@ -142,10 +143,9 @@ pcimmap(dev_t dev, off_t offset, int prot)
|
||||
}
|
||||
#endif /* PCI_MAGIC_IO_RANGE */
|
||||
return bus_space_mmap(sc->sc_memt, offset, 0, prot, 0);
|
||||
#else
|
||||
/* XXX Consider this further. */
|
||||
#else /* INSECURE */
|
||||
return -1;
|
||||
#endif
|
||||
#endif /* INSECURE */
|
||||
}
|
||||
|
||||
const struct cdevsw pci_cdevsw = {
|
||||
|
Loading…
Reference in New Issue
Block a user