/* Return TRUE if ADDRESS points at a page in the kernel's mapped segment (inside region 5, on ia64) and that page is present.  */
static int mapped_kernel_page_is_present(unsigned long address)
/* Return TRUE if ADDRESS points at a page in the kernel's mapped segment (inside region 5, on ia64) and that page is present.  */
static int mapped_kernel_page_is_present(unsigned long address)
{
	pgd_t *pgd;
	pud_t *pud;
	pmd_t *pmd;
	pte_t *ptep, pte;
	pgd = pgd_offset_k(address);
	if (pgd_none(*pgd) || pgd_bad(*pgd))
		return 0;
	pud = pud_offset(pgd, address);
	if (pud_none(*pud) || pud_bad(*pud))
		return 0;
	pmd = pmd_offset(pud, address);
	if (pmd_none(*pmd) || pmd_bad(*pmd))
		return 0;
	ptep = pte_offset_kernel(pmd, address);
	if (!ptep)
		return 0;
	pte = *ptep;
	return pte_present(pte);
}