mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-12-26 17:19:04 +00:00
Encapsulate some types related to cpu word length.
The purpose is to facilitate porting to RV64. Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
This commit is contained in:
@@ -29,9 +29,9 @@ void external_interrupt_handler()
|
||||
reg_t trap_handler(reg_t epc, reg_t cause)
|
||||
{
|
||||
reg_t return_pc = epc;
|
||||
reg_t cause_code = cause & 0xfff;
|
||||
reg_t cause_code = cause & MCAUSE_MASK_ECODE;
|
||||
|
||||
if (cause & 0x80000000) {
|
||||
if (cause & MCAUSE_MASK_INTERRUPT) {
|
||||
/* Asynchronous trap - interrupt */
|
||||
switch (cause_code) {
|
||||
case 3:
|
||||
|
||||
Reference in New Issue
Block a user