interrupt.h revision 38244
126156Sse/* 226156Sse * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 326156Sse * All rights reserved. 426156Sse * 526156Sse * Redistribution and use in source and binary forms, with or without 626156Sse * modification, are permitted provided that the following conditions 726156Sse * are met: 826156Sse * 1. Redistributions of source code must retain the above copyright 926156Sse * notice unmodified, this list of conditions, and the following 1026156Sse * disclaimer. 1126156Sse * 2. Redistributions in binary form must reproduce the above copyright 1226156Sse * notice, this list of conditions and the following disclaimer in the 1326156Sse * documentation and/or other materials provided with the distribution. 1426156Sse * 1526156Sse * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1626156Sse * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1726156Sse * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1826156Sse * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1926156Sse * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2026156Sse * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2126156Sse * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2226156Sse * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2326156Sse * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2426156Sse * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2526156Sse * 2638244Sbde * $Id: interrupt.h,v 1.6 1997/07/09 18:08:15 ache Exp $ 2726156Sse */ 2826156Sse 2926156Sse/* XXX currently dev_instance must be set to the ISA device_id or -1 for PCI */ 3026380Sdfr#define INTR_FAST 0x00000001 /* fast interrupt handler */ 3126380Sdfr#define INTR_EXCL 0x00010000 /* excl. intr, default is shared */ 3226380Sdfr 3338244Sbdetypedef void swihand_t __P((void)); 3438244Sbde 3526349Speterstruct intrec *intr_create(void *dev_instance, int irq, inthand2_t handler, 3626349Speter void *arg, intrmask_t *maskptr, int flags); 3726156Sse 3826349Speterint intr_destroy(struct intrec *idesc); 3926156Sse 4026349Speterint intr_connect(struct intrec *idesc); 4126349Speterint intr_disconnect(struct intrec *idesc); 4226349Speter 4338244Sbdevoid register_swi __P((int intr, swihand_t *handler)); 4438244Sbdevoid swi_dispatcher __P((int intr)); 4538244Sbdeswihand_t swi_generic; 4638244Sbdeswihand_t swi_null; 4738244Sbdevoid unregister_swi __P((int intr, swihand_t *handler)); 4838244Sbde 4926156Sse/* XXX emulate old interface for now ... */ 5026156Sseint register_intr __P((int intr, int device_id, u_int flags, 5126156Sse inthand2_t *handler, u_int *maskptr, int unit)); 5226156Sseint unregister_intr(int intr, inthand2_t handler); 5338244Sbde 5438244Sbde#ifdef NHWI 5538244Sbde/* XXX type change in middle; MI code uses only the top NSWI entries. */ 5638244Sbdeextern swihand_t *ihandlers[NHWI + NSWI]; 5738244Sbde#endif 58