clean up the check for tracing into a syscall handler.

This commit is contained in:
chs 2010-07-07 01:15:34 +00:00
parent ffa744f452
commit b9075fd7d9

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.62 2010/04/23 19:18:09 rmind Exp $ */
/* $NetBSD: trap.c,v 1.63 2010/07/07 01:15:34 chs Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.62 2010/04/23 19:18:09 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63 2010/07/07 01:15:34 chs Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -197,6 +197,7 @@ onfault_handler(const struct pcb *pcb, const struct trapframe *tf)
* exception has been processed. Note that the effect is as if the arguments
* were passed call by reference.
*/
void
trap(struct trapframe *frame)
{
@ -206,6 +207,8 @@ trap(struct trapframe *frame)
extern char fusuintrfailure[], kcopy_fault[],
resume_iret[];
extern char IDTVEC(oosyscall)[];
extern char IDTVEC(osyscall)[];
extern char IDTVEC(syscall32)[];
#if 0
extern char resume_pop_ds[], resume_pop_es[];
#endif
@ -642,9 +645,9 @@ faultcommon:
case T_TRCTRAP:
/* Check whether they single-stepped into a lcall. */
if (frame->tf_rip == (int)IDTVEC(oosyscall))
return;
if (frame->tf_rip == (int)IDTVEC(oosyscall) + 1) {
if (frame->tf_rip == (uint64_t)IDTVEC(oosyscall) ||
frame->tf_rip == (uint64_t)IDTVEC(osyscall) ||
frame->tf_rip == (uint64_t)IDTVEC(syscall32)) {
frame->tf_rflags &= ~PSL_T;
return;
}
@ -655,6 +658,7 @@ faultcommon:
/*
* Don't go single-stepping into a RAS.
*/
if (p->p_raslist == NULL ||
(ras_lookup(p, (void *)frame->tf_rip) == (void *)-1)) {
KSI_INIT_TRAP(&ksi);