mach_sfmmu_asm.s revision 9c7f0c7949f4f8c13342ed0167ea42f8d77b5f21
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* SFMMU primitives. These primitives should only be used by sfmmu
* routines.
*/
#if defined(lint)
#else /* lint */
#include "assym.h"
#endif /* lint */
#include <sys/asm_linkage.h>
#include <sys/machtrap.h>
#include <vm/hat_sfmmu.h>
#include <sys/machparam.h>
#include <sys/privregs.h>
#include <sys/machthread.h>
#include <sys/trapstat.h>
/*
* sfmmu related subroutines
*/
#if defined (lint)
/* ARGSUSED */
void
{}
int
{ return(0); }
int
{ return(0); }
/* ARGSUSED */
void
sfmmu_setctx_sec(int ctx)
{}
/* ARGSUSED */
void
{
}
#else /* lint */
/*
* Invalidate either the context of a specific victim or any process
* currently running on this CPU.
*
* %g1 = sfmmup whose ctx is being stolen (victim)
* when called from sfmmu_wrap_around, %g1 == INVALID_CONTEXT.
* Note %g1 is the only input argument used by this xcall handler.
*/
!
! if (victim == INVALID_CONTEXT) {
!
! return
! } else {
!
! }
!
0:
6: /* flushall tlb */
5:
ba 3f
1:
/*
* %g1 = sfmmup
* %g2 = INVALID_CONTEXT
* %g3 = MMU_SCONTEXT
*/
0:
3:
/* TSB program must be cleared - walkers do not check a context. */
2:
/*
* Set the secondary context register for this process.
* %o0 = context number
*/
/*
* From resume we call sfmmu_setctx_sec with interrupts disabled.
* But we can also get called from C with interrupts enabled. So,
* we need to check first.
*/
/* If interrupts are not disabled, then disable them */
1:
/*
* if the routine is entered with intr enabled, then enable intr now.
* otherwise, keep intr disabled, return without enabing intr.
* %g1 - old intr state
*/
2: retl
/*
* set ktsb_phys to 1 if the processor supports ASI_QUAD_LDD_PHYS.
* returns the detection value in %o0.
*/
/*
* Called to load MMU registers and tsbmiss area
* for the active process. This function should
* only be called from TL=0.
*
* %o0 - hat pointer
*/
#ifdef DEBUG
#endif /* DEBUG */
/*
* We need to set up the TSB base register, tsbmiss
* area, and pass the TSB information into the hypervisor
*/
/* make 2nd UTSBREG */
2:
#ifdef DEBUG
/* check if hypervisor/hardware should handle user TSB */
#endif /* DEBUG */
/*
* %o0 = sfmmup
* %o2 = returned sfmmu cnum on this CPU
* %o4 = scratch
*/
4:
5:
3: retl
#endif /* lint */
#if defined(lint)
/* Prefetch "struct tsbe" while walking TSBs */
/*ARGSUSED*/
void
{}
/* Prefetch the tsbe that we are about to write */
/*ARGSUSED*/
void
{}
#else /* lint */
#endif /* lint */