guo ecf2d82159
sync branch rt-smart. (#6641)
* Synchronize the code of the rt mart branch to the master branch.
  * TTY device
  * Add lwP code from rt-smart
  * Add vnode in DFS, but DFS will be re-write for rt-smart
  * There are three libcpu for rt-smart:
    * arm/cortex-a, arm/aarch64
    * riscv64

Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
Co-authored-by: zhkag <zhkag@foxmail.com>
2022-12-03 12:07:44 +08:00

52 lines
984 B
C

#ifndef SUNXI_HAL_INTERRUPT_H
#define SUNXI_HAL_INTERRUPT_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
#include <stddef.h>
#include <interrupt.h>
typedef enum hal_irqreturn {
HAL_IRQ_OK = (0 << 0),
HAL_IRQ_ERR = (1 << 0),
} hal_irqreturn_t;
#ifdef CONFIG_KERNEL_FREERTOS
enum irqreturn
{
IRQ_NONE = (0 << 0),
IRQ_HANDLED = (1 << 0),
IRQ_WAKE_THREAD = (1 << 1),
};
typedef enum irqreturn irqreturn_t;
typedef irqreturn_t (*irq_handler_t)(int, void *);
int request_irq(unsigned int irq, irq_handler_t handler,
unsigned long flags, const char *name, void *dev);
void *free_irq(unsigned int irq, void *data);
void enable_irq(unsigned int irq);
void disable_irq(unsigned int irq);
#endif
void hal_interrupt_enable(void);
void hal_interrupt_disable(void);
uint32_t hal_interrupt_save(void);
void hal_interrupt_restore(uint32_t flag);
uint32_t hal_interrupt_get_nest(void);
#ifdef __cplusplus
}
#endif
#endif