From 1d66d17d9d7af73bd5d45e15200d55a77a461f7b Mon Sep 17 00:00:00 2001 From: nakayama Date: Sat, 24 Jul 2004 12:04:32 +0000 Subject: [PATCH] Change interrupt pending list end value to -1, to avoid linking an interrupt handler twice. It may fix "sleep forever" bug. --- sys/arch/sparc64/sparc64/locore.s | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index b69e3347056d..a97e04e30b86 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.197 2004/04/09 19:41:57 petrov Exp $ */ +/* $NetBSD: locore.s,v 1.198 2004/07/24 12:04:32 nakayama Exp $ */ /* * Copyright (c) 1996-2002 Eduardo Horvath @@ -3984,7 +3984,7 @@ return_from_syscall: .data .globl intrpending intrpending: - .space 16 * 8 * PTRSZ + .space 16 * 8 * PTRSZ, -1 #ifdef DEBUG #define INTRDEBUG_VECTOR 0x1 @@ -4443,9 +4443,9 @@ sparc_intr_retry: 1: membar #StoreLoad ! Make sure any failed casxa insns complete LDPTR [%l4], %l2 ! Check a slot - brz,pn %l2, intrcmplt ! Empty list? - - clr %l7 + cmp %l2, -1 + beq,pn CCCR, intrcmplt ! Empty list? + mov -1, %l7 membar #LoadStore CASPTR [%l4] ASI_N, %l2, %l7 ! Grab the entire list cmp %l7, %l2 @@ -4468,7 +4468,8 @@ sparc_intr_retry: stx %g0, [%l1] ! Clear intr source membar #Sync ! Should not be needed 0: - brnz,pn %l7, 2b ! 'Nother? + cmp %l7, -1 + bne,pn CCCR, 2b ! 'Nother? mov %l7, %l2 #else /* INTRLIST */