Module Name:    src
Committed By:   ad
Date:           Tue May  5 21:22:48 UTC 2020

Modified Files:
        src/sys/arch/amiga/amiga: machdep.c

Log Message:
PR port-amiga/55233 Process hangs indefinitely if not calling syscalls for a 
while

cpu_intr_p() is broken on amiga, fix it.

>From code inspection it looks like amiga and other m68k ports check for ASTs
with interrupts enabled in some cases, which is racy.  Not fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/arch/amiga/amiga/machdep.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/amiga/amiga/machdep.c
diff -u src/sys/arch/amiga/amiga/machdep.c:1.251 src/sys/arch/amiga/amiga/machdep.c:1.252
--- src/sys/arch/amiga/amiga/machdep.c:1.251	Sun Feb 24 19:24:20 2019
+++ src/sys/arch/amiga/amiga/machdep.c	Tue May  5 21:22:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.251 2019/02/24 19:24:20 jandberg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.252 2020/05/05 21:22:48 ad Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,7 +50,7 @@
 #include "empm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.251 2019/02/24 19:24:20 jandberg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.252 2020/05/05 21:22:48 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -986,8 +986,6 @@ remove_isr(struct isr *isr)
 	}
 }
 
-static int idepth;
-
 void
 intrhand(int sr)
 {
@@ -995,7 +993,6 @@ intrhand(int sr)
 	register unsigned short ireq;
 	register struct isr **p, *q;
 
-	idepth++;
 	ipl = (sr >> 8) & 7;
 #ifdef REALLYDEBUG
 	printf("intrhand: got int. %d\n", ipl);
@@ -1118,14 +1115,13 @@ intrhand(int sr)
 #ifdef REALLYDEBUG
 	printf("intrhand: leaving.\n");
 #endif
-	idepth--;
 }
 
 bool
 cpu_intr_p(void)
 {
 
-	return idepth != 0;
+	return interrupt_depth != 0;
 }
 
 #if defined(DEBUG) && !defined(PANICBUTTON)

Reply via email to