From owner-p4-projects@FreeBSD.ORG Sun Feb 20 22:22:17 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AE97416A4D0; Sun, 20 Feb 2005 22:22:16 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6578316A4CE for ; Sun, 20 Feb 2005 22:22:16 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BC1643D1D for ; Sun, 20 Feb 2005 22:22:16 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j1KMMGjq067181 for ; Sun, 20 Feb 2005 22:22:16 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1KMMFq0067178 for perforce@freebsd.org; Sun, 20 Feb 2005 22:22:15 GMT (envelope-from cognet@freebsd.org) Date: Sun, 20 Feb 2005 22:22:15 GMT Message-Id: <200502202222.j1KMMFq0067178@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Subject: PERFORCE change 71419 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2005 22:22:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=71419 Change 71419 by cognet@cognet on 2005/02/20 22:21:20 Convert sa11x0 specific code to the new irq api. Affected files ... .. //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_irqhandler.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_irqhandler.c#2 (text+ko) ==== @@ -102,20 +102,24 @@ extern struct sa11x0_softc *sa11x0_softc; +static uint32_t sa11x0_irq_mask = 0xfffffff; + /* Recalculate the interrupt masks from scratch. * We could code special registry and deregistry versions of this function that * would be faster, but the code would be nastier, and we don't expect this to * happen very much anyway. */ int -arm_get_irqnb(void *frame) +arm_get_next_irq() { - struct sa11x0_softc *sc = sa11x0_softc; + int irq; - return(bus_space_read_4(sc->sc_iot, sc->sc_ioh, SAIPIC_IP)); + if ((irq = (bus_space_read_4(sc->sc_iot, sc->sc_ioh, SAIPIC_IP) & + sa11x0_irq_mask)) != 0) + return (ffs(irq) - 1); + return (-1); } -static uint32_t sa11x0_irq_mask = 0xfffffff; extern vm_offset_t saipic_base; @@ -123,7 +127,7 @@ arm_mask_irqs(int irq) { - sa11x0_irq_mask &= ~irq; + sa11x0_irq_mask &= ~(1 << irq); __asm __volatile("str %0, [%1, #0x04]" /* SAIPIC_MR */ : : "r" (sa11x0_irq_mask), "r" (saipic_base)); } @@ -132,7 +136,7 @@ arm_unmask_irqs(int irq) { - sa11x0_irq_mask |= irq; + sa11x0_irq_mask |= (1 << irq); __asm __volatile("str %0, [%1, #0x04]" /* SAIPIC_MR */ : : "r" (sa11x0_irq_mask), "r" (saipic_base)); }