Home | History | Annotate | Line # | Download | only in arm32
      1  1.36    skrll /*	$NetBSD: intr.c,v 1.36 2020/06/20 07:10:36 skrll Exp $	*/
      2   1.1    chris 
      3   1.1    chris /*
      4   1.1    chris  * Copyright (c) 1994-1998 Mark Brinicombe.
      5   1.1    chris  * All rights reserved.
      6   1.1    chris  *
      7   1.1    chris  * Redistribution and use in source and binary forms, with or without
      8   1.1    chris  * modification, are permitted provided that the following conditions
      9   1.1    chris  * are met:
     10   1.1    chris  * 1. Redistributions of source code must retain the above copyright
     11   1.1    chris  *    notice, this list of conditions and the following disclaimer.
     12   1.1    chris  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1    chris  *    notice, this list of conditions and the following disclaimer in the
     14   1.1    chris  *    documentation and/or other materials provided with the distribution.
     15   1.1    chris  * 3. All advertising materials mentioning features or use of this software
     16   1.1    chris  *    must display the following acknowledgement:
     17   1.1    chris  *	This product includes software developed by Mark Brinicombe
     18   1.1    chris  *	for the NetBSD Project.
     19   1.1    chris  * 4. The name of the company nor the name of the author may be used to
     20   1.1    chris  *    endorse or promote products derived from this software without specific
     21   1.1    chris  *    prior written permission.
     22   1.1    chris  *
     23   1.1    chris  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24   1.1    chris  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25   1.1    chris  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26   1.1    chris  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     27   1.1    chris  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     28   1.1    chris  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     29   1.1    chris  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30   1.1    chris  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31   1.1    chris  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32   1.1    chris  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33   1.1    chris  * SUCH DAMAGE.
     34   1.1    chris  *
     35   1.1    chris  * Soft interrupt and other generic interrupt functions.
     36   1.1    chris  */
     37  1.12    lukem 
     38  1.12    lukem #include <sys/cdefs.h>
     39  1.36    skrll __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.36 2020/06/20 07:10:36 skrll Exp $");
     40   1.1    chris 
     41   1.1    chris #include <sys/param.h>
     42  1.36    skrll 
     43  1.34     matt #include <sys/conf.h>
     44  1.34     matt #include <sys/cpu.h>
     45  1.34     matt #include <sys/intr.h>
     46  1.36    skrll #include <sys/systm.h>
     47   1.1    chris 
     48  1.34     matt #include <uvm/uvm_extern.h>
     49   1.1    chris 
     50   1.6    chris #include <arm/arm32/machdep.h>
     51  1.35    skrll 
     52  1.28     matt u_int spl_masks[NIPL];
     53   1.7  thorpej 
     54   1.8    chris extern u_int irqmasks[];
     55   1.4  thorpej 
     56   1.4  thorpej void
     57  1.15     matt set_spl_masks(void)
     58   1.4  thorpej {
     59   1.4  thorpej 	int loop;
     60   1.4  thorpej 
     61  1.28     matt 	for (loop = 0; loop < NIPL; ++loop) {
     62   1.4  thorpej 		spl_masks[loop] = 0xffffffff;
     63   1.4  thorpej 	}
     64   1.4  thorpej 
     65  1.31  tsutsui 	spl_masks[IPL_VM]	  = irqmasks[IPL_VM];
     66  1.31  tsutsui 	spl_masks[IPL_SCHED]	  = irqmasks[IPL_SCHED];
     67  1.31  tsutsui 	spl_masks[IPL_HIGH]	  = irqmasks[IPL_HIGH];
     68  1.31  tsutsui 	spl_masks[IPL_SOFTSERIAL] = irqmasks[IPL_SOFTSERIAL];
     69  1.31  tsutsui 	spl_masks[IPL_SOFTNET]	  = irqmasks[IPL_SOFTNET];
     70  1.31  tsutsui 	spl_masks[IPL_SOFTBIO]	  = irqmasks[IPL_SOFTBIO];
     71  1.31  tsutsui 	spl_masks[IPL_SOFTCLOCK]  = irqmasks[IPL_SOFTCLOCK];
     72  1.31  tsutsui 	spl_masks[IPL_NONE]	  = irqmasks[IPL_NONE];
     73   1.4  thorpej 
     74  1.14     yamt }
     75  1.14     yamt 
     76   1.4  thorpej #ifdef DIAGNOSTIC
     77   1.4  thorpej void
     78  1.15     matt dump_spl_masks(void)
     79   1.4  thorpej {
     80   1.4  thorpej 	int loop;
     81   1.4  thorpej 
     82  1.28     matt 	for (loop = 0; loop < NIPL; ++loop)
     83  1.28     matt 		printf("spl_masks[%d]=%08x\n", loop, spl_masks[loop]);
     84   1.4  thorpej }
     85   1.4  thorpej #endif
     86   1.1    chris 
     87   1.1    chris /* End of intr.c */
     88