mach_kpm.c revision a75003d539b0f1ee06eb869b099fafb3126fa4ad
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 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
}
/*
* 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
{
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);
}