FreeBSD/sys/dev/pci/pci.c
/* return log2 of address range supported by map register */
return log2 of address range supported by map register
return log2 of address range supported by map register
static int
pci_maprange(uint64_t mapreg)
{
	int ln2range = 0;
	if (PCI_BAR_IO(mapreg))
		ln2range = 32;
	else
		switch (mapreg & PCIM_BAR_MEM_TYPE) {
		case PCIM_BAR_MEM_32:
			ln2range = 32;
			break;
		case PCIM_BAR_MEM_1MB:
			ln2range = 20;
			break;
		case PCIM_BAR_MEM_64:
			ln2range = 64;
			break;
		}
	return (ln2range);
}
static int pci_maprange ( uint64_t mapreg ) { int ln2range = 0 ; if ( PCI_BAR_IO ( mapreg ) ) ln2range = 32 ; else switch ( mapreg & PCIM_BAR_MEM_TYPE ) { case PCIM_BAR_MEM_32 : ln2range = 32 ; break ; case PCIM_BAR_MEM_1MB : ln2range = 20 ; break ; case PCIM_BAR_MEM_64 : ln2range = 64 ; break ; } return ( ln2range ) ; }
return log2 of address range supported by map register
return log2 of address range supported by map register