4 * @brief ISR Manager, managing the interrupt service routine allocations
8 * @copyright Copyright (c) 2022
11 #ifndef __LUNAIX_ISRM_H
12 #define __LUNAIX_ISRM_H
14 #include <lunaix/types.h>
15 #include <lunaix/hart_state.h>
17 #include <hal/devtree.h>
19 typedef void (*isr_cb)(const struct hart_state*);
26 #define msi_addr(msiv) ((msiv).msi_addr)
27 #define msi_data(msiv) ((msiv).msi_data)
28 #define msi_vect(msiv) ((msiv).mapped_iv)
34 * @brief Release a iv resource
42 * @brief Allocate an iv resource for os services
47 isrm_ivosalloc(isr_cb handler);
50 * @brief Allocate an iv resource for external events
55 isrm_ivexalloc(isr_cb handler);
58 * @brief Allocate an iv resource for MSI use
63 isrm_msialloc(isr_cb handler);
66 * @brief Bind the iv according to given device tree node
71 isrm_bind_dtnode(struct dt_intr_node* node);
74 * @brief Get the handler associated with the given iv
83 isrm_get_payload(const struct hart_state*);
86 isrm_set_payload(int iv, ptr_t);
89 * @brief Notify end of interrupt event
94 isrm_notify_eoi(cpu_t id, int iv);
97 * @brief Notify end of scheduling event
102 isrm_notify_eos(cpu_t id);
104 #endif /* __LUNAIX_ISRM_H */