/* We keep several page tables. This is a simple routine to find the page table (if any) corresponding to this top-level address the Guest has given us.  */
static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
/* We keep several page tables. This is a simple routine to find the page table (if any) corresponding to this top-level address the Guest has given us.  */
static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
{
	unsigned int i;
	for (i = 0; i < ARRAY_SIZE(lg->pgdirs); i++)
		if (lg->pgdirs[i].pgdir && lg->pgdirs[i].gpgdir == pgtable)
			break;
	return i;
}