1295498Sadrian/* $NetBSD: intr.h,v 1.7 2003/06/16 20:01:00 thorpej Exp $ */ 2295498Sadrian 3295498Sadrian/*- 4295498Sadrian * Copyright (c) 1997 Mark Brinicombe. 5295498Sadrian * All rights reserved. 6295498Sadrian * 7295498Sadrian * Redistribution and use in source and binary forms, with or without 8295498Sadrian * modification, are permitted provided that the following conditions 9295498Sadrian * are met: 10295498Sadrian * 1. Redistributions of source code must retain the above copyright 11295498Sadrian * notice, this list of conditions and the following disclaimer. 12295498Sadrian * 2. Redistributions in binary form must reproduce the above copyright 13295498Sadrian * notice, this list of conditions and the following disclaimer in the 14295498Sadrian * documentation and/or other materials provided with the distribution. 15295498Sadrian * 3. All advertising materials mentioning features or use of this software 16295498Sadrian * must display the following acknowledgement: 17295498Sadrian * This product includes software developed by Mark Brinicombe 18295498Sadrian * for the NetBSD Project. 19295498Sadrian * 4. The name of the company nor the name of the author may be used to 20295498Sadrian * endorse or promote products derived from this software without specific 21295498Sadrian * prior written permission. 22295498Sadrian * 23295498Sadrian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 24295498Sadrian * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25295498Sadrian * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26295498Sadrian * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 27295498Sadrian * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28295498Sadrian * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29295498Sadrian * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30295498Sadrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31295498Sadrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32295498Sadrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33295498Sadrian * SUCH DAMAGE. 34295498Sadrian * 35295498Sadrian * $FreeBSD: stable/11/sys/mips/include/intr.h 308333 2016-11-05 10:23:02Z mmel $ 36295498Sadrian * 37295498Sadrian */ 38295498Sadrian 39295498Sadrian#ifndef _MACHINE_INTR_H_ 40295498Sadrian#define _MACHINE_INTR_H_ 41295498Sadrian 42298068Sandrew#ifdef INTRNG 43295498Sadrian 44295498Sadrian#ifdef FDT 45295498Sadrian#include <dev/ofw/openfirm.h> 46295498Sadrian#endif 47295498Sadrian 48295498Sadrian#include <sys/intr.h> 49295498Sadrian 50298065Ssgalabov#ifndef MIPS_NIRQ 51298065Ssgalabov#define MIPS_NIRQ 128 52295498Sadrian#endif 53295498Sadrian 54298065Ssgalabov#ifndef NIRQ 55298065Ssgalabov#define NIRQ MIPS_NIRQ 56298065Ssgalabov#endif 57298065Ssgalabov 58295498Sadrian#define INTR_IRQ_NSPC_SWI 4 59295498Sadrian 60295498Sadrian/* MIPS compatibility for legacy mips code */ 61295498Sadrianvoid cpu_init_interrupts(void); 62295498Sadrianvoid cpu_establish_hardintr(const char *, driver_filter_t *, driver_intr_t *, 63295498Sadrian void *, int, int, void **); 64295498Sadrianvoid cpu_establish_softintr(const char *, driver_filter_t *, void (*)(void*), 65295498Sadrian void *, int, int, void **); 66308333Smmelint cpu_create_intr_map(int); 67308333Smmelstruct resource *cpu_get_irq_resource(int); 68295498Sadrian/* MIPS interrupt C entry point */ 69295498Sadrianvoid cpu_intr(struct trapframe *); 70295498Sadrian 71298068Sandrew#endif /* INTRNG */ 72295498Sadrian 73295498Sadrian#endif /* _MACHINE_INTR_H */ 74