2 * \brief Hardware-interrupt subsystem
5 * DDEKit supports registration of one handler function per interrupt. If any
6 * specific DDE implementation needs to register more than one handler,
7 * multiplexing has to be implemented there!
11 * This file is part of DDEKit.
13 * (c) 2007-2012 Bjoern Doebel <doebel@os.inf.tu-dresden.de>
14 * Christian Helmuth <ch12@os.inf.tu-dresden.de>
15 * Thomas Friebel <tf13@os.inf.tu-dresden.de>
16 * economic rights: Technische Universitaet Dresden (Germany)
18 * This file is part of TUD:OS and distributed under the terms of the
19 * GNU General Public License 2.
20 * Please see the COPYING-GPL-2 file for details.
25 #include <l4/sys/compiler.h>
26 #include <l4/dde/ddekit/thread.h>
30 #define DDEKIT_IRQ_PRIO 0x11
32 #define IRQF_TRIGGER_NONE 0x00000000
33 #define IRQF_TRIGGER_RISING 0x00000001
34 #define IRQF_TRIGGER_FALLING 0x00000002
35 #define IRQF_TRIGGER_HIGH 0x00000004
36 #define IRQF_TRIGGER_LOW 0x00000008
37 #define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
38 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
39 #define IRQF_TRIGGER_PROBE 0x00000010
42 * Attach to hardware interrupt
44 * \param irq IRQ number to attach to
45 * \param shared set to 1 if interrupt sharing is supported; set to 0
47 * \param thread_init called just after DDEKit internal init and before any
49 * \param handler IRQ handler for interrupt irq
50 * \param priv private token (argument for thread_init and handler)
52 * \return pointer to interrupt thread created
54 ddekit_thread_t *ddekit_interrupt_attach(int irq, int shared,
55 void(*thread_init)(void *),
56 void(*handler)(void *), void *priv);
59 * Detach from a previously attached interrupt.
61 * \param irq IRQ number
63 void ddekit_interrupt_detach(int irq);
68 * \param irq IRQ number to block
70 void ddekit_interrupt_disable(int irq);
75 * \param irq IRQ number to block
77 void ddekit_interrupt_enable(int irq);
80 * Set the trigger mode flags
82 * \param irq IRQ number
85 int ddekit_irq_set_type(int irq, unsigned flags);
88 * Initialize internal data structures
90 void ddekit_init_irqs(void);