mach_kpm.c revision d20abfaa275f62e387fe9d814375fb3829fdb91f
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Kernel Physical Mapping (segkpm) hat interface routines for sun4v.
*/
#include <vm/hat_sfmmu.h>
#include <sys/machsystm.h>
#include <vm/mach_kpm.h>
/*
* Kernel Physical Mapping (kpm) facility
*/
void
{
/*
* Map each of the memsegs into the kpm segment, coalesing
* adjacent memsegs to allow mapping with the largest
* possible pages.
*/
pmem = phys_install;
for (;;) {
break;
}
}
}
/* -- hat_kpm interface section -- */
/*
* Mapin a locked page and return the vaddr.
*/
/*ARGSUSED*/
{
if (kpm_enable == 0) {
}
}
return (vaddr);
}
/*
* Mapout a locked page.
*/
/*ARGSUSED*/
void
{
#ifdef DEBUG
if (kpm_enable == 0) {
return;
}
if (IS_KPM_ADDR(vaddr) == 0) {
return;
}
return;
}
#endif
}
/*
* hat_kpm_mapin_pfn is used to obtain a kpm mapping for physical
* memory addresses that are not described by a page_t. It can
* also be used for normal pages that are not locked, but beware
* this is dangerous - no locking is performed, so the identity of
* the page could change. hat_kpm_mapin_pfn is not supported when
* vac_colors > 1, because the chosen va depends on the page identity,
* which could change.
* The caller must only pass pfn's for valid physical addresses; violation
* of this rule will cause panic.
*/
{
if (kpm_enable == 0)
}
/*ARGSUSED*/
void
{
/* empty */
}
/*
* Return the kpm virtual address for the page at pp.
*/
/*ARGSUSED*/
{
}
/*
* Return the page for the kpm virtual address vaddr.
* Caller is responsible for the kpm mapping and lock
* state of the page.
*/
page_t *
{
return (page_numtopp_nolock(pfn));
}
/*
* hat_kpm_fault is called from segkpm_fault when a kpm tsbmiss occurred.
* This should never happen on sun4v.
*/
int
{
panic("pagefault in seg_kpm. hat: 0x%p vaddr: 0x%p",
return (0);
}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
{
return (0);
}
/*ARGSUSED*/
void
{}
/*ARGSUSED*/
void
{}
/*
* Walk the memsegs chain, applying func to each memseg span and vcolor.
*/
void
{
void *base;
}
}
/* -- sfmmu_kpm internal section -- */
/*
* Return the page frame number if a valid segkpm mapping exists
* for vaddr, otherwise return PFN_INVALID. No locks are grabbed.
* Should only be used by other sfmmu routines.
*/
{
if (pp)
return (pfn);
else
return ((pfn_t)PFN_INVALID);
}