From 56d6bdb9f7181e34e4a86421aa2589a60696db0f Mon Sep 17 00:00:00 2001 From: ad Date: Tue, 5 May 2020 21:22:48 +0000 Subject: [PATCH] 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. --- sys/arch/amiga/amiga/machdep.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index c61bd5d2931f..247b368e843b 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -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 -__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 #include @@ -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)