kaif_handlers.s revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/asm_linkage.h>
#include <sys/machtrap.h>
#include <sys/privregs.h>
/*
* This file contains the trap handlers that will be copied to kmdb's trap
* table. See kaif_activate.c for the code that does the actual copying.
*
* The handlers have a debugging feature, enabled when KMDB_TRAPCOUNT is
* defined, which allows them to keep a running count of the number of times
* a given trap has occurred. The counter is stored in the padding at the end
* of the handler. Write access is of course required to allow the values to
* be updated, so KMDB_TRAPCOUNT also enables the installation of DTLB entries
* for each trap table page. Finally, the code in this file is copied into
* the actual location used by the handler, so we can't perform compile-time
* counter location calculations. The calculations are instead performed at
* run-time, as A) we generally already derive the table location as part of
* the trap processing and B) simplicity is more of a concern than is speed.
*/
#if defined(lint)
#endif /* lint */
#if defined(lint)
#ifdef sun4v
#else /* sun4v */
void
kaif_hdlr_dmiss(void)
{
}
void
kaif_itlb_handler(void)
{
}
#endif /* sun4v */
#else /* lint */
#ifdef sun4v
#else /* sun4v */
/*
* This routine must be exactly 32 instructions long.
*/
/*
* Use kdi_vatotte to look up the tte. We don't bother stripping the
* context, as it won't change the tte we get.
*/
/*
* kdi_vatotte gave us a TTE to use. Load it up and head back
* into the world, but first bump a counter.
*/
#ifdef KMDB_TRAPCOUNT
#else
#endif
1: /*
* kdi_vatotte didn't give us a tte, which is unfortunate. We're
* going to need to jump into the debugger so as to allow it to
* handle the trap. The debugger itself isn't locked into the TLB,
* so we may well incur a TLB miss while trying to get into it. As
* such, we're going to switch off the MMU globals before setting foot
* into the debugger, thus allowing a TL>1 miss to be handled without
* clobbering our state. We'll also save off the tag just in case the
* world ends and someone wants to find out what happened.
*
* We will only reach this point at TL=1, as kdi_vatotte will always
* find the TTE for the debugger without missing.
*/
#ifdef KMDB_TRAPCOUNT
#else
#endif
unimp 0
unimp 0 /* counter goes here (base + 0x60) */
unimp 0
unimp 0 /* miss address goes here (base + 0x68) */
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
/*
* This routine must be exactly 32 instructions long.
*/
/*
* kdi_vatotte gave us a TTE to use. Load it up and head back
* into the world, but first bump a counter.
*/
#ifdef KMDB_TRAPCOUNT
#else
#endif
1: /*
* kdi_vatotte didn't give us a tte, which is unfortunate. We're
* going to need to jump into the debugger so as to allow it to
* handle the trap. The debugger itself isn't locked into the TLB,
* so we may well incur a TLB miss while trying to get into it. As
* such, we're going to switch off the MMU globals before setting foot
* into the debugger, thus allowing a TL>1 miss to be handled without
* clobbering our state.
*
* We will only reach this point at TL=1, as kdi_vatotte will always
* find the TTE for the debugger without missing.
*/
unimp 0
unimp 0
unimp 0 /* counter goes here */
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
unimp 0
#endif /* sun4v */
#ifdef KMDB_TRAPCOUNT
#else
#endif
unimp 0 /* counter goes here */
#endif