/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* WARNING: This file is used by both dboot and the kernel.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/machparam.h>
#include <sys/mach_mmu.h>
#ifdef __xpv
#include <sys/hypervisor.h>
#endif
#ifdef _BOOT
#include <dboot/dboot_printf.h>
#else
#include <sys/bootconf.h>
#endif
/*
* Return the index corresponding to a virt address at a given page table level.
*/
static uint_t
{
}
/*
* Return a pointer to the page table entry that maps a virtual address.
* If there is no page table and probe_only is not set, one is created.
*/
x86pte_t *
{
uint_t l;
if (pa)
*pa = 0;
#ifndef _BOOT
if (IN_HYPERVISOR_VA(va))
return (NULL);
#endif
/*
* Walk down the page tables creating any needed intermediate tables.
*/
/*
* Life is easy if we find the pagetable. We just use it.
*/
if (table == -1) {
if (probe_only)
return (NULL);
bop_panic("find_pte(): phys not found!");
}
continue;
}
if (probe_only)
return (NULL);
}
/*
* Return a pointer into the current pagetable.
*/
if (pa)
}