Module Name:    src
Committed By:   thorpej
Date:           Fri Sep 18 00:02:43 UTC 2020

Modified Files:
        src/sys/arch/alpha/alpha: db_interface.c

Log Message:
Use alpha_pal_swpipl() directly instead of splhigh()/splx(), do avoid
soft int processing while dealing with entering / leaving the debugger.
Soft ints will be correctly handled during exception_return().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/alpha/alpha/db_interface.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/alpha/alpha/db_interface.c
diff -u src/sys/arch/alpha/alpha/db_interface.c:1.34 src/sys/arch/alpha/alpha/db_interface.c:1.35
--- src/sys/arch/alpha/alpha/db_interface.c:1.34	Mon Feb  6 02:14:10 2012
+++ src/sys/arch/alpha/alpha/db_interface.c	Fri Sep 18 00:02:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.34 2012/02/06 02:14:10 matt Exp $ */
+/* $NetBSD: db_interface.c,v 1.35 2020/09/18 00:02:43 thorpej Exp $ */
 
 /*
  * Mach Operating System
@@ -52,7 +52,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.34 2012/02/06 02:14:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.35 2020/09/18 00:02:43 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -176,7 +176,7 @@ int
 ddb_trap(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long entry, db_regs_t *regs)
 {
 	struct cpu_info *ci = curcpu();
-	int s;
+	unsigned long psl;
 
 	if (entry != ALPHA_KENTRY_IF ||
 	    (a0 != ALPHA_IF_CODE_BPT && a0 != ALPHA_IF_CODE_BUGCHK)) {
@@ -200,7 +200,12 @@ ddb_trap(unsigned long a0, unsigned long
 	/* Our register state is simply the trapframe. */
 	ddb_regp = ci->ci_db_regs = regs;
 
-	s = splhigh();
+	/*
+	 * Use SWPIPL directly; we want to avoid processing
+	 * software interrrupts when we go back.  Soft ints
+	 * will be caught later, so not to worry.
+	 */
+	psl = alpha_pal_swpipl(ALPHA_PSL_IPL_HIGH);
 
 	db_active++;
 	cnpollc(true);		/* Set polling mode, unblank video */
@@ -210,7 +215,7 @@ ddb_trap(unsigned long a0, unsigned long
 	cnpollc(false);		/* Resume interrupt mode */
 	db_active--;
 
-	splx(s);
+	alpha_pal_swpipl(psl);
 
 	ddb_regp = ci->ci_db_regs = NULL;
 

Reply via email to