Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.23.18.1
      1  1.23.18.1     matt /*	$NetBSD: intr.h,v 1.23.18.1 2010/12/29 08:14:43 matt 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.23.18.1     matt #include <mips/intr.h>
     36       1.13  tsutsui 
     37        1.4   tsubai #ifdef _KERNEL
     38  1.23.18.1     matt #ifdef __INTR_PRIVATE
     39       1.13  tsutsui 
     40  1.23.18.1     matt #include <sys/evcnt.h>
     41       1.20  tsutsui #include <mips/locore.h>
     42       1.13  tsutsui 
     43  1.23.18.1     matt extern const struct ipl_sr_map newmips_ipl_sr_map;
     44       1.18     yamt 
     45       1.12  tsutsui struct newsmips_intrhand {
     46       1.12  tsutsui 	LIST_ENTRY(newsmips_intrhand) ih_q;
     47       1.12  tsutsui 	struct evcnt intr_count;
     48       1.12  tsutsui 	int (*ih_func)(void *);
     49       1.12  tsutsui 	void *ih_arg;
     50       1.12  tsutsui 	u_int ih_level;
     51       1.12  tsutsui 	u_int ih_mask;
     52       1.12  tsutsui 	u_int ih_priority;
     53       1.12  tsutsui };
     54       1.12  tsutsui 
     55       1.12  tsutsui struct newsmips_intr {
     56       1.12  tsutsui 	LIST_HEAD(,newsmips_intrhand) intr_q;
     57       1.12  tsutsui };
     58        1.1   tsubai 
     59        1.1   tsubai /*
     60        1.1   tsubai  * Index into intrcnt[], which is defined in locore
     61        1.1   tsubai  */
     62       1.13  tsutsui #define SERIAL0_INTR	0
     63       1.13  tsutsui #define SERIAL1_INTR	1
     64       1.13  tsutsui #define SERIAL2_INTR	2
     65       1.13  tsutsui #define LANCE_INTR	3
     66       1.13  tsutsui #define SCSI_INTR	4
     67       1.13  tsutsui #define ERROR_INTR	5
     68       1.13  tsutsui #define HARDCLOCK_INTR	6
     69       1.13  tsutsui #define FPU_INTR	7
     70       1.13  tsutsui #define SLOT1_INTR	8
     71       1.13  tsutsui #define SLOT2_INTR	9
     72       1.13  tsutsui #define SLOT3_INTR	10
     73       1.13  tsutsui #define FLOPPY_INTR	11
     74       1.13  tsutsui #define STRAY_INTR	12
     75        1.1   tsubai 
     76        1.2   tsubai extern u_int intrcnt[];
     77        1.1   tsubai 
     78        1.2   tsubai /* handle i/o device interrupts */
     79  1.23.18.1     matt void news3400_intr(int, vaddr_t, uint32_t);
     80  1.23.18.1     matt void news5000_intr(int, vaddr_t, uint32_t);
     81  1.23.18.1     matt extern void (*hardware_intr)(int, vaddr_t, uint32_t);
     82        1.5   tsubai 
     83       1.15  tsutsui extern void (*enable_intr)(void);
     84       1.15  tsutsui extern void (*disable_intr)(void);
     85       1.15  tsutsui extern void (*enable_timer)(void);
     86        1.4   tsubai 
     87  1.23.18.1     matt #endif /* __INTR_PRIVATE */
     88        1.4   tsubai #endif /* _KERNEL */
     89        1.1   tsubai #endif /* _MACHINE_INTR_H_ */
     90