Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.25.36.1
      1  1.25.36.1  pgoyette /*	$NetBSD: intr.h,v 1.25.36.1 2016/07/26 03:24:18 pgoyette Exp $	*/
      2        1.1    tsubai 
      3       1.13   tsutsui /*-
      4       1.13   tsutsui  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
      5       1.13   tsutsui  * All rights reserved.
      6       1.13   tsutsui  *
      7       1.13   tsutsui  * This code is derived from software contributed to The NetBSD Foundation
      8       1.13   tsutsui  * by Jason R. Thorpe.
      9        1.1    tsubai  *
     10        1.1    tsubai  * Redistribution and use in source and binary forms, with or without
     11        1.1    tsubai  * modification, are permitted provided that the following conditions
     12        1.1    tsubai  * are met:
     13        1.1    tsubai  * 1. Redistributions of source code must retain the above copyright
     14        1.1    tsubai  *    notice, this list of conditions and the following disclaimer.
     15        1.1    tsubai  * 2. Redistributions in binary form must reproduce the above copyright
     16        1.1    tsubai  *    notice, this list of conditions and the following disclaimer in the
     17        1.1    tsubai  *    documentation and/or other materials provided with the distribution.
     18        1.1    tsubai  *
     19       1.13   tsutsui  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.13   tsutsui  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.13   tsutsui  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.13   tsutsui  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.13   tsutsui  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.13   tsutsui  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.13   tsutsui  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.13   tsutsui  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.13   tsutsui  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.13   tsutsui  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.13   tsutsui  * POSSIBILITY OF SUCH DAMAGE.
     30        1.1    tsubai  */
     31        1.1    tsubai 
     32        1.1    tsubai #ifndef _MACHINE_INTR_H_
     33        1.1    tsubai #define _MACHINE_INTR_H_
     34        1.1    tsubai 
     35       1.25      matt #include <mips/intr.h>
     36       1.13   tsutsui 
     37        1.4    tsubai #ifdef _KERNEL
     38       1.25      matt #ifdef __INTR_PRIVATE
     39       1.13   tsutsui 
     40       1.24   tsutsui #include <sys/evcnt.h>
     41       1.13   tsutsui 
     42       1.25      matt extern const struct ipl_sr_map newmips_ipl_sr_map;
     43       1.18      yamt 
     44       1.12   tsutsui struct newsmips_intrhand {
     45       1.12   tsutsui 	LIST_ENTRY(newsmips_intrhand) ih_q;
     46       1.12   tsutsui 	struct evcnt intr_count;
     47       1.12   tsutsui 	int (*ih_func)(void *);
     48       1.12   tsutsui 	void *ih_arg;
     49       1.12   tsutsui 	u_int ih_level;
     50       1.12   tsutsui 	u_int ih_mask;
     51       1.12   tsutsui 	u_int ih_priority;
     52       1.12   tsutsui };
     53       1.12   tsutsui 
     54       1.12   tsutsui struct newsmips_intr {
     55       1.12   tsutsui 	LIST_HEAD(,newsmips_intrhand) intr_q;
     56       1.12   tsutsui };
     57        1.1    tsubai 
     58        1.1    tsubai /*
     59        1.1    tsubai  * Index into intrcnt[], which is defined in locore
     60        1.1    tsubai  */
     61       1.13   tsutsui #define SERIAL0_INTR	0
     62       1.13   tsutsui #define SERIAL1_INTR	1
     63       1.13   tsutsui #define SERIAL2_INTR	2
     64       1.13   tsutsui #define LANCE_INTR	3
     65       1.13   tsutsui #define SCSI_INTR	4
     66       1.13   tsutsui #define ERROR_INTR	5
     67       1.13   tsutsui #define HARDCLOCK_INTR	6
     68       1.13   tsutsui #define FPU_INTR	7
     69       1.13   tsutsui #define SLOT1_INTR	8
     70       1.13   tsutsui #define SLOT2_INTR	9
     71       1.13   tsutsui #define SLOT3_INTR	10
     72       1.13   tsutsui #define FLOPPY_INTR	11
     73       1.13   tsutsui #define STRAY_INTR	12
     74        1.1    tsubai 
     75        1.2    tsubai extern u_int intrcnt[];
     76        1.1    tsubai 
     77        1.2    tsubai /* handle i/o device interrupts */
     78       1.25      matt void news3400_intr(int, vaddr_t, uint32_t);
     79       1.25      matt void news5000_intr(int, vaddr_t, uint32_t);
     80       1.25      matt extern void (*hardware_intr)(int, vaddr_t, uint32_t);
     81        1.5    tsubai 
     82       1.15   tsutsui extern void (*enable_intr)(void);
     83       1.15   tsutsui extern void (*disable_intr)(void);
     84       1.15   tsutsui extern void (*enable_timer)(void);
     85        1.4    tsubai 
     86       1.25      matt #endif /* __INTR_PRIVATE */
     87        1.4    tsubai #endif /* _KERNEL */
     88        1.1    tsubai #endif /* _MACHINE_INTR_H_ */
     89