/* Set specified permissions for a page in the appropriate page table  */
static void mpu_context_map_page(struct mm_struct *mm, unsigned int a, unsigned int f)
/* Set specified permissions for a page in the appropriate page table  */
static void mpu_context_map_page(struct mm_struct *mm, unsigned int a, unsigned int f)
{
	mpu_context_t *p;
	mpu_addr_region_t *r;
	unsigned int *mask;
	unsigned int page;
	unsigned int idx;
	unsigned int bit;
	int i;
	r = mpu_addr_region_find(a);
	if (! r) {
		goto Done;
	}
	p = mpu_context_p(mm);
	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);
	if (f & (VM_READ | VM_WRITE | VM_EXEC)) mask[idx] |= bit;
	else					mask[idx] &= ~bit; 
Done:	;
}