提交 909b6aed 编写于 作者: Z Zihao Yu

riscv32-noop,cte: use S-mode CSR to match NOOP

上级 1e651284
......@@ -20,7 +20,7 @@ _Context* __am_irq_handle(_Context *c) {
case 2:
if (__am_illegal_instr(c)) c->epc += 4;
break;
case 11:
case 9:
ev.event = (c->GPR1 == -1) ? _EVENT_YIELD : _EVENT_SYSCALL;
c->epc += 4;
break;
......@@ -42,7 +42,7 @@ extern void __am_asm_trap(void);
int _cte_init(_Context*(*handler)(_Event, _Context*)) {
// initialize exception entry
asm volatile("csrw mtvec, %0" : : "r"(__am_asm_trap));
asm volatile("csrw stvec, %0" : : "r"(__am_asm_trap));
// register event handler
user_handler = handler;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册