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@
This commit is contained in:
marcel 2005-04-29 02:03:11 +00:00
parent 662415efd6
commit 05efdf30cf

View File

@ -287,6 +287,24 @@ pci_disable_io(device_t dev, int space)
return(PCI_DISABLE_IO(device_get_parent(dev), dev, 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:
*