summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pcivar.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2005-04-29 02:03:11 +0000
committermarcel <marcel@FreeBSD.org>2005-04-29 02:03:11 +0000
commit05efdf30cf2c5667b9a23d6d2a603926a3f03cec (patch)
treecdebb9bdf73e9946d88d32d007a1881a341f8d07 /sys/dev/pci/pcivar.h
parent662415efd622a0441d131aaa61448dfe88d09095 (diff)
downloadFreeBSD-src-05efdf30cf2c5667b9a23d6d2a603926a3f03cec.zip
FreeBSD-src-05efdf30cf2c5667b9a23d6d2a603926a3f03cec.tar.gz
Add pci_is_vga_ioport_range() and pci_is_vga_memory_range() as inline
functions. These functions centralize the details of which I/O port and memory ranges belong to VGA. Reviewed by: imp@, jhb@
Diffstat (limited to 'sys/dev/pci/pcivar.h')
-rw-r--r--sys/dev/pci/pcivar.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 75bc8d3..c90d659 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -288,6 +288,24 @@ pci_disable_io(device_t dev, int space)
}
/*
+ * Check if the address range falls within the VGA defined address range(s)
+ */
+static __inline int
+pci_is_vga_ioport_range(u_long start, u_long end)
+{
+
+ return (((start >= 0x3b0 && end <= 0x3bb) ||
+ (start >= 0x3c0 && end <= 0x3df)) ? 1 : 0);
+}
+
+static __inline int
+pci_is_vga_memory_range(u_long start, u_long end)
+{
+
+ return ((start >= 0xa0000 && end <= 0xbffff) ? 1 : 0);
+}
+
+/*
* PCI power states are as defined by ACPI:
*
* D0 State in which device is on and running. It is receiving full
OpenPOWER on IntegriCloud