diff --git a/docs/doc/kernel/imagesrc/int_exception_table.png b/docs/doc/kernel/imagesrc/int_exception_table.png deleted file mode 100644 index 8d33caf..0000000 Binary files a/docs/doc/kernel/imagesrc/int_exception_table.png and /dev/null differ diff --git a/docs/doc/kernel/int.md b/docs/doc/kernel/int.md index d6f0f15..ee65c31 100644 --- a/docs/doc/kernel/int.md +++ b/docs/doc/kernel/int.md @@ -55,9 +55,14 @@ + mstatus(Machine Status Register):机器模式状态寄存器 mcause寄存器的Exception Code域标识是何种异常或者何种中断。定义如下图表格所示: -![XiUOS EXCEPTION TABLE](./imagesrc/int_exception_table.png) -+ 退出异常时,需要从异常服务程序中退出,并返回主程序。RISC-V架构定义了一组专门的退出异常指令:MRET、SRET、URET,分别对应机器模式、监督模式、用户模式的退出。 +| Interrupt/Exception
mcause[XLEN-1] | Exception Code
mcause[XLEN-2:0] | Description | +| :---: | :---: | --- | +| 1
1
1
1
1
1 | 1
3
5
7
9
11 | Supervisor software interrupt
Machine software interrupt
Supervisor timer interrupt
Machine timer interrupt
Supervisor external interrupt
Machine external interrupt | +| 0
0
0
0
0
0
0
0
0
0
0
0
0
0 | 0
1
2
3
4
5
6
7
8
9
11
12
13
15 | Intruction address misaligned
Instruction access fault
Illegal instruction
Breakpoint
Load address misaligned
Load access fault
store address misaligned
Store access fault
Environment call from U-mode
Environment call from S-mode
Environment call from M-mode
Instruction page fault
Load page fault
Store page fault | + + ++ 退出异常时,需要从异常服务程序中退出,并返回主程序。RISC-V架构定义了一组专images门的退出异常指令:MRET、SRET、URET,分别对应机器模式、监督模式、用户模式的退出。 以MRET为例,当处理器执行MRET指令后,硬件行为如下: 1、当前程序执行流程停止执行,跳转到mepc的地址运行; 2、更新mstatus状态寄存器(具体情况可参考RISC-V架构介绍);