FreeBSD/sys/powerpc/aim/mmu_oea.c
/*
 * Return true if the physical range is encompassed by the battable[idx]
 */
Return true if the physical range is encompassed by the battable[idx]
Return true if the physical range is encompassed by the battable [ idx ]
static int
moea_bat_mapped(int idx, vm_paddr_t pa, vm_size_t size)
{
	u_int prot;
	u_int32_t start;
	u_int32_t end;
	u_int32_t bat_ble;
	if (!(battable[idx].batu & BAT_Vs))
		return (EINVAL);
	prot = battable[idx].batl & (BAT_I|BAT_G|BAT_PP_RW);
	if (prot != (BAT_I|BAT_G|BAT_PP_RW))
		return (EPERM);
	start = battable[idx].batl & BAT_PBS;
	bat_ble = (battable[idx].batu & ~(BAT_EBS)) | 0x03;
	end = start | (bat_ble << 15) | 0x7fff;
	if ((pa < start) || ((pa + size) > end))
		return (ERANGE);
	return (0);
}
static int moea_bat_mapped ( int idx , vm_paddr_t pa , vm_size_t size ) { u_int prot ; u_int32_t start ; u_int32_t end ; u_int32_t bat_ble ; if ( ! ( battable [ idx ] . batu & BAT_Vs ) ) return ( EINVAL ) ; prot = battable [ idx ] . batl & ( BAT_I | BAT_G | BAT_PP_RW ) ; if ( prot != ( BAT_I | BAT_G | BAT_PP_RW ) ) return ( EPERM ) ; start = battable [ idx ] . batl & BAT_PBS ; bat_ble = ( battable [ idx ] . batu & ~ ( BAT_EBS ) ) | 0x03 ; end = start | ( bat_ble << 15 ) | 0x7fff ; if ( ( pa < start ) || ( ( pa + size ) > end ) ) return ( ERANGE ) ; return ( 0 ) ; }
Return true if the physical range is encompassed by the battable[idx]
Return true if the physical range is encompassed by the battable [ idx ]
/*
	 * Return immediately if not a valid mapping
	 */ /*
	 * The BAT entry must be cache-inhibited, guarded, and r/w
	 * so it can function as an i/o page
	 */ /*
	 * The address should be within the BAT range. Assume that the
	 * start address in the BAT has the correct alignment (thus
	 * not requiring masking)
	 */