1 #ifndef SUNXI_HAL_INTERRUPT_H
2 #define SUNXI_HAL_INTERRUPT_H
3 
4 #ifdef __cplusplus
5 extern "C"
6 {
7 #endif
8 
9 #include <stdint.h>
10 #include <stddef.h>
11 #include "../../../libos/include/interrupt.h"
12 
13 typedef enum hal_irqreturn {
14     HAL_IRQ_OK      = (0 << 0),
15     HAL_IRQ_ERR     = (1 << 0),
16 } hal_irqreturn_t;
17 
18 #ifdef CONFIG_KERNEL_FREERTOS
19 enum irqreturn
20 {
21     IRQ_NONE        = (0 << 0),
22     IRQ_HANDLED     = (1 << 0),
23     IRQ_WAKE_THREAD     = (1 << 1),
24 };
25 typedef enum irqreturn irqreturn_t;
26 typedef irqreturn_t (*irq_handler_t)(int, void *);
27 
28 int request_irq(unsigned int irq, irq_handler_t handler,
29         unsigned long flags, const char *name, void *dev);
30 
31 void *free_irq(unsigned int irq, void *data);
32 
33 void enable_irq(unsigned int irq);
34 
35 void disable_irq(unsigned int irq);
36 
37 #endif
38 
39 
40 void hal_interrupt_enable(void);
41 void hal_interrupt_disable(void);
42 uint32_t hal_interrupt_save(void);
43 void hal_interrupt_restore(uint32_t flag);
44 
45 uint32_t hal_interrupt_get_nest(void);
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 
51 #endif
52