/*
* 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"
#include <sys/fasttrap.h>
#include <sys/machsystm.h>
static void
{
}
void
{
if (cpu == DTRACE_CPUALL) {
} else {
}
}
/*ARGSUSED*/
static void
{
}
void
dtrace_sync(void)
{
xc_all(dtrace_sync_func, 0, 0);
}
void
{
if (hole_end > hole_start)
}
void
{
/*
* This trap should only be invoked if there's a corresponding
* enabled dtrace probe. If there isn't, send SIGILL as though
* the process had executed an invalid trap instruction.
*/
return;
}
/*
* It is possible that we were preempted after entering the kernel,
* and the tracepoint was removed. If it appears that the process hit
* our reserved trap instruction, we call send SIGILL just as though
* the user had executed an unused trap instruction.
*/
instr == FASTTRAP_INSTR) {
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
}
}
void
{
if (curthread->t_dtrace_ast) {
}
/*
* Clear all user tracing flags.
*/
curthread->t_dtrace_ft = 0;
/*
* If we weren't expecting to take a return probe trap, kill the
* process as though it had just executed an unassigned trap
* instruction.
*/
if (step == 0) {
return;
}
/*
* If we hit this trap unrelated to a return probe, we're just here
* to reset the AST flag since we deferred a signal until after we
* logically single-stepped the instruction we copied out.
*/
if (ret == 0) {
return;
}
/*
* We need to wait until after we've called the dtrace_return_probe_ptr
* function pointer to set %pc and %npc.
*/
if (dtrace_return_probe_ptr != NULL)
(void) (*dtrace_return_probe_ptr)(rp);
}
void
{
ASSERT(t->t_dtrace_on);
/*
* If we're not actively tracing an instruction, turn off tracing
* flags. If the instruction we copied out caused a synchronous
* trap, reset the pc and npc back to their original values and turn
* off the flags.
*/
t->t_dtrace_ft = 0;
t->t_dtrace_ft = 0;
}
}
int
dtrace_safe_defer_signal(void)
{
ASSERT(t->t_dtrace_on);
/*
* If we're not actively tracing an instruction, turn off tracing
* flags.
*/
t->t_dtrace_ft = 0;
return (0);
}
/*
* Otherwise, make sure we'll return to the kernel after executing
* the instruction we copied out.
*/
if (!t->t_dtrace_step) {
t->t_dtrace_step = 1;
}
t->t_dtrace_ast = 1;
return (1);
}
/*
* Additional artificial frames for the machine type. For SPARC, we're already
* accounted for, so return 0.
*/
int
dtrace_mach_aframes(void)
{
return (0);
}