1 /*
2 * \brief Hardware-interrupt subsystem
3 * \author Christian Helmuth
4 * \date 2008-08-15
5 *
6 * The DDE kit supports registration of one handler function per interrupt. If
7 * any specific DDE implementation needs to register more than one handler,
8 * multiplexing has to be implemented there!
9 */
10
11 /*
12 * Copyright (C) 2008-2013 Genode Labs GmbH
13 *
14 * This file is part of the Genode OS framework, which is distributed
15 * under the terms of the GNU General Public License version 2.
16 */
17
18 #ifndef _INCLUDE__DDE_KIT__INTERRUPT_H_
19 #define _INCLUDE__DDE_KIT__INTERRUPT_H_
20
21 /**
22 * Attach to hardware interrupt
23 *
24 * \param irq IRQ number to attach to
25 * \param shared set to 1 if interrupt sharing is supported; set to 0
26 * otherwise
27 * \param thread_init called just after DDE kit internal init and before any
28 * other function
29 * \param handler IRQ handler for interrupt irq
30 * \param priv private token (argument for thread_init and handler)
31 *
32 * \return attachment state
33 * \retval 0 success
34 * \retval !0 error
35 */
36 int dde_kit_interrupt_attach(int irq, int shared, void(*thread_init)(void *),
37 void(*handler)(void *), void *priv);
38
39 /**
40 * Detach from a previously attached interrupt.
41 *
42 * \param irq IRQ number
43 */
44 void dde_kit_interrupt_detach(int irq);
45
46 /**
47 * Block interrupt.
48 *
49 * \param irq IRQ number to block
50 */
51 void dde_kit_interrupt_disable(int irq);
52
53 /**
54 * Enable interrupt.
55 *
56 * \param irq IRQ number to block
57 */
58 void dde_kit_interrupt_enable(int irq);
59
60 #endif /* _INCLUDE__DDE_KIT__INTERRUPT_H_ */