X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/290981180b9abc454e017271a8ebe75478c00e86..aa2843fdbdd9b5cc579d198fd1a9ec874642706e:/lunaix-os/includes/lunaix/isrm.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/isrm.h b/lunaix-os/includes/lunaix/isrm.h index 32ba31d..6dd4a6f 100644 --- a/lunaix-os/includes/lunaix/isrm.h +++ b/lunaix-os/includes/lunaix/isrm.h @@ -11,35 +11,62 @@ #ifndef __LUNAIX_ISRM_H #define __LUNAIX_ISRM_H -#include #include - -#define IV_BASE 32 -#define IV_OS IV_BASE -#define IV_EX 48 -#define IV_MAX 256 +#include typedef void (*isr_cb)(const isr_param*); void isrm_init(); +/** + * @brief Release a iv resource + * + * @param iv + */ void -isrm_ivfree(uint32_t iv); +isrm_ivfree(int iv); -uint32_t +/** + * @brief Allocate an iv resource for os services + * + * @param iv + */ +int isrm_ivosalloc(isr_cb handler); -uint32_t +/** + * @brief Allocate an iv resource for external events + * + * @param iv + */ +int isrm_ivexalloc(isr_cb handler); -uint32_t -isrm_bindirq(uint32_t irq, isr_cb irq_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); -uint32_t -isrm_bindiv(uint32_t iv, isr_cb handler); +/** + * @brief Bind given iv with it's associated handler + * + * @param iv + * @param handler + */ +void +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(uint32_t iv); +isrm_get(int iv); #endif /* __LUNAIX_ISRM_H */