From owner-p4-projects@FreeBSD.ORG Tue Apr 22 21:53:41 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 815291065674; Tue, 22 Apr 2008 21:53:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43FE71065672 for ; Tue, 22 Apr 2008 21:53:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFC98FC15 for ; Tue, 22 Apr 2008 21:53:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m3MLrfpg011997 for ; Tue, 22 Apr 2008 21:53:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3MLrfBK011995 for perforce@freebsd.org; Tue, 22 Apr 2008 21:53:41 GMT (envelope-from gonzo@FreeBSD.org) Date: Tue, 22 Apr 2008 21:53:41 GMT Message-Id: <200804222153.m3MLrfBK011995@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 140429 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 21:53:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=140429 Change 140429 by gonzo@gonzo_jeeves on 2008/04/22 21:52:58 o Minor cleanups o Add new parameter (irq) to intr_event_create call o Use intr_event_handle instead of handmade loop Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips32/idt/obio.c#5 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips32/idt/obio.c#5 (text+ko) ==== @@ -273,7 +273,7 @@ event = sc->sc_eventstab[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, + error = intr_event_create(&event, (void *)irq, 0, irq, (mask_fn)obio_mask_irq, (mask_fn)obio_unmask_irq, NULL, NULL, "obio intr%d:", irq); @@ -328,9 +328,8 @@ { struct obio_softc *sc = arg; struct intr_event *event; - struct intr_handler *ih; uint32_t irqstat, ipend, imask, xpend; - int irq, thread, group, i, ret; + int irq, thread, group, i; irqstat = 0; irq = 0; @@ -350,68 +349,15 @@ irq = IP_IRQ(group, i - 1); event = sc->sc_eventstab[irq]; thread = 0; -#ifndef INTR_FILTER - obio_mask_irq(irq); -#endif if (!event || TAILQ_EMPTY(&event->ie_handlers)) { -#ifdef INTR_FILTER - obio_unmask_irq(irq); -#endif + printf("obio: stray irq %d\n", irq); continue; } -#ifdef INTR_FILTER /* TODO: frame instead of NULL? */ - intr_event_handle(event, NULL); - /* XXX: Log stray IRQs */ -#else - /* Execute fast handlers. */ - TAILQ_FOREACH(ih, &event->ie_handlers, - ih_next) { - if (ih->ih_filter == NULL) - thread = 1; - else - ret = ih->ih_filter(ih->ih_argument); - /* - * Wrapper handler special case: see - * intr_execute_handlers() in - * i386/intr_machdep.c - */ - if (!thread) { - if (ret == FILTER_SCHEDULE_THREAD) - thread = 1; - } - } - - /* Schedule thread if needed. */ - if (thread) - intr_event_schedule_thread(event); - else - obio_unmask_irq(irq); - } - } -#endif -#if 0 - ipend = ICU_REG_READ(ICU_IPEND2); - printf("ipend2 = %08x!\n", ipend); - - ipend = ICU_REG_READ(ICU_IPEND3); - printf("ipend3 = %08x!\n", ipend); - - ipend = ICU_REG_READ(ICU_IPEND4); - printf("ipend4 = %08x!\n", ipend); - ipend = ICU_REG_READ(ICU_IPEND5); - printf("ipend5 = %08x!\n", ipend); - - ipend = ICU_REG_READ(ICU_IPEND6); - printf("ipend6 = %08x!\n", ipend); -#endif - while (irqstat != 0) { - if ((irqstat & 1) == 1) { + if (intr_event_handle(event, NULL) != 0) + printf("obio: stray irq %d\n", irq); } - - irq++; - irqstat >>= 1; } return (FILTER_HANDLED);