1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2021-10-19     JasonHu      first version
9  */
10 
11 #ifndef __INTERRUPT_H__
12 #define __INTERRUPT_H__
13 
14 #include <rthw.h>
15 
16 #define NR_CPUS       1
17 
18 #define IRQ_OFFSET          16
19 #ifndef IRQ_MAX_NR
20 #define IRQ_MAX_NR          207
21 #endif
22 #define INTERRUPTS_MAX      (IRQ_OFFSET + IRQ_MAX_NR)
23 
24 enum {
25     EP_INSTRUCTION_ADDRESS_MISALIGNED = 0,
26     EP_INSTRUCTION_ACCESS_FAULT,
27     EP_ILLEGAL_INSTRUCTION,
28     EP_BREAKPOINT,
29     EP_LOAD_ADDRESS_MISALIGNED,
30     EP_LOAD_ACCESS_FAULT,
31     EP_STORE_ADDRESS_MISALIGNED,
32     EP_STORE_ACCESS_FAULT,
33     EP_ENVIRONMENT_CALL_U_MODE,
34     EP_ENVIRONMENT_CALL_S_MODE,
35     EP_RESERVED10,
36     EP_ENVIRONMENT_CALL_M_MODE,
37     EP_INSTRUCTION_PAGE_FAULT,          /* page attr */
38     EP_LOAD_PAGE_FAULT,                 /* read data */
39     EP_RESERVED14,
40     EP_STORE_PAGE_FAULT,                /* write data */
41 };
42 
43 void rt_hw_interrupt_init(void);
44 void rt_hw_interrupt_mask(int vector);
45 void rt_hw_interrupt_umask(int vector);
46 rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, void *param, const char *name);
47 
48 #endif
49