/* Is a specified page validly mapped within a specified address region?  */
static int mpu_context_addr_valid_for_region(struct mm_struct *mm, mpu_addr_region_t *r, unsigned int a, unsigned int f)
/* Is a specified page validly mapped within a specified address region?  */
static int mpu_context_addr_valid_for_region(struct mm_struct *mm, mpu_addr_region_t *r, unsigned int a, unsigned int f)
{
	mpu_context_t *p = mpu_context_p(mm);
	unsigned int *mask;
	unsigned int page;
	unsigned int idx;
	unsigned int bit;
	int i;	int b = 0;
	i = r - mpu_addr_region_tbl;
	mask = p->page_tbl + mpu_page_tbl_off[i];
	page = (a - r->bot) >> PAGE_SHIFT;
	idx = page >> 5;
	bit = 1 << (page & 31);
	b = (mask[idx] & bit) ? 1 : 0; 
	return b;
}