PERFORCE change 124155 for review

John Baldwin jhb at freebsd.org
Thu Aug 16 12:57:20 PDT 2007


On Friday 27 July 2007 01:43:39 am Christopher Davis wrote:
> http://perforce.freebsd.org/chv.cgi?CH=124155
> 
> Change 124155 by loafier at chrisdsoc on 2007/07/27 05:43:02
> 
> 	Use return value from pci_enable_io() to help determine whether to 
> 	allocate memory or io ports.

No.  Drivers should not call this as you could enable decoding on BARs that 
aren't programmed yet.  Generally as a device driver writer you should know 
what the BARs on your system are.  Otherwise, you can read the BAR and test 
it like so:

	if (PCI_BAR_IO(pci_read_config(dev, PCIR_BAR(x), 4)) {
		It's I/O
	} else {
		It's memory
	}

-- 
John Baldwin


More information about the p4-projects mailing list