Wedson Almeida Filho | 987c0ff | 2018-06-20 16:34:38 +0100 | [diff] [blame^] | 1 | #ifndef _IRQ_H |
| 2 | #define _IRQ_H |
| 3 | |
| 4 | #include <stdbool.h> |
| 5 | #include <stddef.h> |
| 6 | #include <stdint.h> |
| 7 | |
| 8 | struct irq_handle; |
| 9 | |
| 10 | enum irq_trigger { |
| 11 | irq_trigger_level, |
| 12 | irq_trigger_edge, |
| 13 | }; |
| 14 | |
| 15 | enum irq_polarity { |
| 16 | irq_polarity_active_high, |
| 17 | irq_polarity_active_low, |
| 18 | }; |
| 19 | |
| 20 | /* TODO: Add target CPUs here. */ |
| 21 | void irq_config(uint32_t num, enum irq_trigger t, enum irq_polarity p, |
| 22 | bool (*cb)(void *, struct irq_handle *), void *context); |
| 23 | void irq_enable(uint32_t num); |
| 24 | |
| 25 | void irq_dismiss(struct irq_handle *h); |
| 26 | |
| 27 | /* TODO: These don't really belong here, do they?. */ |
| 28 | bool irq_handle(uint32_t num, struct irq_handle *h); |
| 29 | void irq_init(void); |
| 30 | void irq_init_percpu(void); |
| 31 | |
| 32 | #endif |