summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pci_map.c
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2000-06-09 16:09:10 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2000-06-09 16:09:10 +0000
commit99ce614ba9488ff7dcd7c678eec00e6d721d9c86 (patch)
tree33a59bbe294c305d40d399eaa4f247c56fa81f83 /sys/dev/pci/pci_map.c
parent99fecc041a8c037474560c4a1f54938ed0e9a1a9 (diff)
Import pci_mapreg_type from NetBSD
Diffstat (limited to 'sys/dev/pci/pci_map.c')
-rw-r--r--sys/dev/pci/pci_map.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_map.c b/sys/dev/pci/pci_map.c
index 7038aa8e721..af1ed413ace 100644
--- a/sys/dev/pci/pci_map.c
+++ b/sys/dev/pci/pci_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_map.c,v 1.2 1999/07/18 21:25:19 csapuntz Exp $ */
+/* $OpenBSD: pci_map.c,v 1.3 2000/06/09 16:09:09 chris Exp $ */
/* $NetBSD: pci_map.c,v 1.5 1998/08/15 10:10:54 mycroft Exp $ */
/*-
@@ -207,6 +207,21 @@ pci_mem_find(pc, pcitag, reg, membasep, memsizep, cacheablep)
cacheablep));
}
+pcireg_t
+pci_mapreg_type(pc, tag, reg)
+ pci_chipset_tag_t pc;
+ pcitag_t tag;
+ int reg;
+{
+ pcireg_t rv;
+
+ rv = pci_conf_read(pc, tag, reg);
+ if (PCI_MAPREG_TYPE(rv) == PCI_MAPREG_TYPE_IO)
+ rv &= PCI_MAPREG_TYPE_MASK;
+ else
+ rv &= PCI_MAPREG_TYPE_MASK|PCI_MAPREG_MEM_TYPE_MASK;
+ return (rv);
+}
int
pci_mapreg_info(pc, tag, reg, type, basep, sizep, flagsp)