Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Aug 2007 14:36:52 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Christopher Davis <loafier@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 124155 for review
Message-ID:  <200708161436.52368.jhb@freebsd.org>
In-Reply-To: <200707270543.l6R5hd4T033226@repoman.freebsd.org>
References:  <200707270543.l6R5hd4T033226@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 27 July 2007 01:43:39 am Christopher Davis wrote:
> http://perforce.freebsd.org/chv.cgi?CH=124155
> 
> Change 124155 by loafier@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708161436.52368.jhb>