/* Return PA for this VA if it is mapped by a BAT, or 0  */
phys_addr_t v_mapped_by_bats(unsigned long va)
/* Return PA for this VA if it is mapped by a BAT, or 0  */
phys_addr_t v_mapped_by_bats(unsigned long va)
{
	int b;
	for (b = 0; b < 4; ++b)
		if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
			return bat_addrs[b].phys + (va - bat_addrs[b].start);
	return 0;
}