summaryrefslogtreecommitdiff
path: root/libddekit/ddekit/interrupt.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-21 23:37:19 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-22 01:45:54 +0000
commit36261f6f0909abc6893c920445b800d81c02c921 (patch)
tree48065ddf055f2b405b75096f3bced16352564650 /libddekit/ddekit/interrupt.h
parent29d0d8df649036b90c588d1e87f96b72b8342063 (diff)
Clean up includes
To use the standard hurd Makeconf rules and permit external dde_* build
Diffstat (limited to 'libddekit/ddekit/interrupt.h')
-rw-r--r--libddekit/ddekit/interrupt.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/libddekit/ddekit/interrupt.h b/libddekit/ddekit/interrupt.h
new file mode 100644
index 00000000..3f789210
--- /dev/null
+++ b/libddekit/ddekit/interrupt.h
@@ -0,0 +1,57 @@
+/*
+ * \brief Hardware-interrupt subsystem
+ * \author Thomas Friebel <tf13@os.inf.tu-dresden.de>
+ * \author Christian Helmuth <ch12@os.inf.tu-dresden.de>
+ * \date 2007-01-26
+ *
+ * DDEKit supports registration of one handler function per interrupt. If any
+ * specific DDE implementation needs to register more than one handler,
+ * multiplexing has to be implemented there!
+ */
+
+#ifndef _ddekit_interrupt_h
+#define _ddekit_interrupt_h
+
+#include "ddekit/thread.h"
+
+#define DDEKIT_IRQ_PRIO 2
+
+/**
+ * Attach to hardware interrupt
+ *
+ * \param irq IRQ number to attach to
+ * \param shared set to 1 if interrupt sharing is supported; set to 0
+ * otherwise
+ * \param thread_init called just after DDEKit internal init and before any
+ * other function
+ * \param handler IRQ handler for interrupt irq
+ * \param priv private token (argument for thread_init and handler)
+ *
+ * \return pointer to interrupt thread created
+ */
+ddekit_thread_t *ddekit_interrupt_attach(int irq, int shared,
+ void(*thread_init)(void *),
+ void(*handler)(void *), void *priv);
+
+/**
+ * Detach from a previously attached interrupt.
+ *
+ * \param irq IRQ number
+ */
+void ddekit_interrupt_detach(int irq);
+
+/**
+ * Block interrupt.
+ *
+ * \param irq IRQ number to block
+ */
+void ddekit_interrupt_disable(int irq);
+
+/**
+ * Enable interrupt.
+ *
+ * \param irq IRQ number to block
+ */
+void ddekit_interrupt_enable(int irq);
+
+#endif