xref: /minix3/minix/include/ddekit/interrupt.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /*-
2*433d6423SLionel Sambuc  * Copyright (c) 2006 TU Dresden, All rights reserved.
3*433d6423SLionel Sambuc  *
4*433d6423SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
5*433d6423SLionel Sambuc  * modification, are permitted provided that the following conditions
6*433d6423SLionel Sambuc  * are met:
7*433d6423SLionel Sambuc  *
8*433d6423SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
9*433d6423SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
10*433d6423SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
11*433d6423SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in
12*433d6423SLionel Sambuc  *    the documentation and/or other materials provided with the
13*433d6423SLionel Sambuc  *    distribution.
14*433d6423SLionel Sambuc  *
15*433d6423SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16*433d6423SLionel Sambuc  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17*433d6423SLionel Sambuc  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18*433d6423SLionel Sambuc  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
19*433d6423SLionel Sambuc  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20*433d6423SLionel Sambuc  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
21*433d6423SLionel Sambuc  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22*433d6423SLionel Sambuc  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23*433d6423SLionel Sambuc  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24*433d6423SLionel Sambuc  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25*433d6423SLionel Sambuc  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*433d6423SLionel Sambuc  * SUCH DAMAGE.
27*433d6423SLionel Sambuc  */
28*433d6423SLionel Sambuc 
29*433d6423SLionel Sambuc #ifndef _DDEKIT_INTERUPT_H
30*433d6423SLionel Sambuc #define _DDEKIT_INTERUPT_H
31*433d6423SLionel Sambuc #include <ddekit/ddekit.h>
32*433d6423SLionel Sambuc #include <ddekit/thread.h>
33*433d6423SLionel Sambuc 
34*433d6423SLionel Sambuc /** Attach to an interrupt */
35*433d6423SLionel Sambuc ddekit_thread_t *ddekit_interrupt_attach( int irq, int shared,
36*433d6423SLionel Sambuc 	void(*thread_init)(void *), void(*handler)(void *), void *priv);
37*433d6423SLionel Sambuc 
38*433d6423SLionel Sambuc /* Detach from a previously attached interrupt. */
39*433d6423SLionel Sambuc void ddekit_interrupt_detach(int irq);
40*433d6423SLionel Sambuc 
41*433d6423SLionel Sambuc /* Block interrupt. */
42*433d6423SLionel Sambuc void ddekit_interrupt_disable(int irq);
43*433d6423SLionel Sambuc 
44*433d6423SLionel Sambuc /* Enable interrupt */
45*433d6423SLionel Sambuc void ddekit_interrupt_enable(int irq);
46*433d6423SLionel Sambuc 
47*433d6423SLionel Sambuc #endif
48