提交 a57e022a 编写于 作者: Z Zihao Yu

riscv64,intr: add longjmp_raise_intr()

上级 f986a097
#include "cpu/exec.h"
#include "all-instr.h"
#include <setjmp.h>
static make_EHelper(load) {
static OpcodeEntry table [8] = {
......@@ -136,6 +137,15 @@ static OpcodeEntry rvc_table [3][8] = {
};
void isa_exec(vaddr_t *pc) {
extern jmp_buf intr_buf;
int setjmp_ret;
if ((setjmp_ret = setjmp(intr_buf)) != 0) {
int exception = setjmp_ret - 1;
void raise_intr(word_t, vaddr_t);
raise_intr(exception, cpu.pc);
return;
}
decinfo.isa.instr.val = instr_fetch(pc, 4);
if (decinfo.isa.instr.opcode1_0 == 0x3) {
idex(pc, &opcode_table[decinfo.isa.instr.opcode6_2]);
......
#include "rtl/rtl.h"
#include "csr.h"
#include <setjmp.h>
#define INTR_BIT (1ULL << 63)
enum {
......@@ -57,3 +58,8 @@ bool isa_query_intr(void) {
}
return false;
}
jmp_buf intr_buf;
void longjmp_raise_intr(uint32_t NO) {
longjmp(intr_buf, NO + 1);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册