Пример #1
0
void				tcont(void)
{
	tsignal();
	treset(g_old_term, 1);
	tresize(0, 0);
	free(g_old_term);
	g_old_term = NULL;
}
Пример #2
0
void
dtrace_return_probe(struct regs *rp)
{
	krwlock_t *rwp;
	uintptr_t npc = curthread->t_dtrace_npc;
	uint8_t step = curthread->t_dtrace_step;
	uint8_t ret = curthread->t_dtrace_ret;

	if (curthread->t_dtrace_ast) {
		aston(curthread);
		curthread->t_sig_check = 1;
	}

	/*
	 * 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) {
		tsignal(curthread, SIGILL);
		return;
	}

	ASSERT(rp->r_npc == rp->r_pc + 4);

	/*
	 * 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) {
		rp->r_pc = npc;
		rp->r_npc = npc + 4;
		return;
	}

	/*
	 * We need to wait until after we've called the dtrace_return_probe_ptr
	 * function pointer to set %pc and %npc.
	 */
	rwp = &CPU->cpu_ft_lock;
	rw_enter(rwp, RW_READER);
	if (dtrace_return_probe_ptr != NULL)
		(void) (*dtrace_return_probe_ptr)(rp);
	rw_exit(rwp);
	rp->r_pc = npc;
	rp->r_npc = npc + 4;
}
Пример #3
0
/*
 * nonexistent system call-- signal lwp (may want to handle it)
 * flag error if lwp won't see signal immediately
 */
int64_t
nosys()
{
	tsignal(curthread, SIGSYS);
	return (set_errno(ENOSYS));
}