From f110a2c0e04c782914254bbd515dde2a3d918bfa Mon Sep 17 00:00:00 2001 From: liangkangnan Date: Sat, 25 Apr 2020 17:05:48 +0800 Subject: [PATCH] set MPIE and MPP Signed-off-by: liangkangnan --- tests/example/init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/example/init.c b/tests/example/init.c index 337593f..a9f710d 100644 --- a/tests/example/init.c +++ b/tests/example/init.c @@ -16,5 +16,9 @@ void trap_handler(uint32_t mcause) void _init() { + // 设置中断入口函数 write_csr(mtvec, &trap_entry); + // 使能CPU全局中断 + // MIE = 1, MPIE = 1, MPP = 11 + write_csr(mstatus, 0x1888); }