The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/arm/sa11x0/sa11x0_irqhandler.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: sa11x0_irqhandler.c,v 1.5 2003/08/07 16:26:54 agc Exp $        */
    2 
    3 /*-
    4  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
    5  * All rights reserved.
    6  *
    7  * This code is derived from software contributed to the NetBSD Foundation
    8  * by IWAMOTO Toshihiro.
    9  *
   10  * This code is derived from software contributed to The NetBSD Foundation
   11  * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace
   12  * Simulation Facility, NASA Ames Research Center.
   13  *
   14  * Redistribution and use in source and binary forms, with or without
   15  * modification, are permitted provided that the following conditions
   16  * are met:
   17  * 1. Redistributions of source code must retain the above copyright
   18  *    notice, this list of conditions and the following disclaimer.
   19  * 2. Redistributions in binary form must reproduce the above copyright
   20  *    notice, this list of conditions and the following disclaimer in the
   21  *    documentation and/or other materials provided with the distribution.
   22  * 3. All advertising materials mentioning features or use of this software
   23  *    must display the following acknowledgement:
   24  *      This product includes software developed by the NetBSD
   25  *      Foundation, Inc. and its contributors.
   26  * 4. Neither the name of The NetBSD Foundation nor the names of its
   27  *    contributors may be used to endorse or promote products derived
   28  *    from this software without specific prior written permission.
   29  *
   30  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   31  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   32  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   33  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   34  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   35  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   36  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   37  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   38  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   39  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   40  * POSSIBILITY OF SUCH DAMAGE.
   41  */
   42 
   43 /*-
   44  * Copyright (c) 1991 The Regents of the University of California.
   45  * All rights reserved.
   46  *
   47  * This code is derived from software contributed to Berkeley by
   48  * William Jolitz.
   49  *
   50  * Redistribution and use in source and binary forms, with or without
   51  * modification, are permitted provided that the following conditions
   52  * are met:
   53  * 1. Redistributions of source code must retain the above copyright
   54  *    notice, this list of conditions and the following disclaimer.
   55  * 2. Redistributions in binary form must reproduce the above copyright
   56  *    notice, this list of conditions and the following disclaimer in the
   57  *    documentation and/or other materials provided with the distribution.
   58  * 3. Neither the name of the University nor the names of its contributors
   59  *    may be used to endorse or promote products derived from this software
   60  *    without specific prior written permission.
   61  *
   62  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   63  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   64  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   65  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   66  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   67  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   68  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   69  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   70  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   71  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   72  * SUCH DAMAGE.
   73  *
   74  *      @(#)isa.c       7.2 (Berkeley) 5/13/91
   75  */
   76 
   77 
   78 #include <sys/cdefs.h>
   79 __FBSDID("$FreeBSD: releng/6.1/sys/arm/sa11x0/sa11x0_irqhandler.c 147166 2005-06-09 12:26:20Z cognet $");
   80 
   81 #include <sys/param.h>
   82 #include <sys/kernel.h>
   83 #include <sys/systm.h>
   84 #include <sys/syslog.h>
   85 #include <sys/malloc.h>
   86 #include <sys/types.h>
   87 #include <sys/bus.h>
   88 #include <sys/interrupt.h>
   89 #include <vm/vm.h>
   90 #include <vm/vm_extern.h>
   91 
   92 #include <arm/sa11x0/sa11x0_reg.h>
   93 #include <arm/sa11x0/sa11x0_var.h>
   94 
   95 #include <machine/cpu.h>
   96 #include <machine/intr.h>
   97 
   98 #define NIRQS 0x20
   99 struct intrhand *irqhandlers[NIRQS];
  100 
  101 int current_intr_depth;
  102 extern struct sa11x0_softc *sa11x0_softc;
  103 
  104 
  105 static uint32_t sa11x0_irq_mask = 0xfffffff;
  106 
  107 extern vm_offset_t saipic_base;
  108 
  109 int
  110 arm_get_next_irq()
  111 {
  112         int irq;
  113 
  114         if ((irq = (bus_space_read_4(sc->sc_iot, sc->sc_ioh, SAIPIC_IP) &
  115             sa11x0_irq_mask)) != 0)
  116                 return (ffs(irq) - 1);
  117         return (-1);
  118 }
  119 
  120 void
  121 arm_mask_irq(uintptr_t irq)
  122 {
  123 
  124         sa11x0_irq_mask &= ~(1 << irq);
  125         __asm __volatile("str   %0, [%1, #0x04]" /* SAIPIC_MR */
  126             : : "r" (sa11x0_irq_mask), "r" (saipic_base));
  127 }
  128 
  129 void
  130 arm_unmask_irq(uintptr_t irq)
  131 {
  132 
  133         sa11x0_irq_mask |= (1 << irq);
  134         __asm __volatile("str   %0, [%1, #0x04]" /* SAIPIC_MR */
  135             : : "r" (sa11x0_irq_mask), "r" (saipic_base));
  136 }
  137 
  138 void stray_irqhandler(void *);
  139 
  140 
  141 
  142 void
  143 stray_irqhandler(void *p)
  144 {
  145 
  146         printf("stray interrupt %p\n", p);
  147 }
  148 /* End of irqhandler.c */

Cache object: e89998db8214e0ef1311c70db135dd14


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.