Module Name:    src
Committed By:   chs
Date:           Wed Jul  7 01:15:35 UTC 2010

Modified Files:
        src/sys/arch/amd64/amd64: trap.c

Log Message:
clean up the check for tracing into a syscall handler.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amd64/amd64/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.62 src/sys/arch/amd64/amd64/trap.c:1.63
--- src/sys/arch/amd64/amd64/trap.c:1.62	Fri Apr 23 19:18:09 2010
+++ src/sys/arch/amd64/amd64/trap.c	Wed Jul  7 01:15:34 2010
@@ -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 @@
  * 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 @@
 	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 @@
 
 	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 @@
 		/*
 		 * 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);

Reply via email to