git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: better rtc framework which aims to remove single rtc restrictions.
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
isrm.h
diff --git
a/lunaix-os/includes/lunaix/isrm.h
b/lunaix-os/includes/lunaix/isrm.h
index afa8146a457143ea703b3baf154ec423dc13a630..e9f80b0027371be29e63577edad9c574ea849e81 100644
(file)
--- a/
lunaix-os/includes/lunaix/isrm.h
+++ b/
lunaix-os/includes/lunaix/isrm.h
@@
-11,35
+11,68
@@
#ifndef __LUNAIX_ISRM_H
#define __LUNAIX_ISRM_H
#ifndef __LUNAIX_ISRM_H
#define __LUNAIX_ISRM_H
-#include <arch/x86/interrupts.h>
#include <lunaix/types.h>
#include <lunaix/types.h>
-
-#define IV_BASE 32
-#define IV_OS IV_BASE
-#define IV_EX 48
-#define IV_MAX 256
+#include <sys/interrupts.h>
typedef void (*isr_cb)(const isr_param*);
void
isrm_init();
typedef void (*isr_cb)(const isr_param*);
void
isrm_init();
+/**
+ * @brief Release a iv resource
+ *
+ * @param iv
+ */
void
isrm_ivfree(int iv);
void
isrm_ivfree(int iv);
+/**
+ * @brief Allocate an iv resource for os services
+ *
+ * @param iv
+ */
int
isrm_ivosalloc(isr_cb handler);
int
isrm_ivosalloc(isr_cb handler);
+/**
+ * @brief Allocate an iv resource for external events
+ *
+ * @param iv
+ */
int
isrm_ivexalloc(isr_cb handler);
int
isrm_ivexalloc(isr_cb handler);
+/**
+ * @brief Bind a given irq and associated handler to an iv
+ *
+ * @param iv iv allocated by system
+ */
int
isrm_bindirq(int irq, isr_cb irq_handler);
int
isrm_bindirq(int irq, isr_cb irq_handler);
-int
+/**
+ * @brief Bind given iv with it's associated handler
+ *
+ * @param iv
+ * @param handler
+ */
+void
isrm_bindiv(int iv, isr_cb handler);
isrm_bindiv(int iv, isr_cb handler);
+/**
+ * @brief Get the handler associated with the given iv
+ *
+ * @param iv
+ * @return isr_cb
+ */
isr_cb
isrm_get(int iv);
isr_cb
isrm_get(int iv);
+ptr_t
+isrm_get_payload(int iv);
+
+void
+isrm_set_payload(int iv, ptr_t);
+
#endif /* __LUNAIX_ISRM_H */
#endif /* __LUNAIX_ISRM_H */