set MPIE and MPP

Signed-off-by: liangkangnan <liangkangnan@163.com>
pull/1/head
liangkangnan 2020-04-25 17:05:48 +08:00
parent 6cf86e0286
commit f110a2c0e0
1 changed files with 4 additions and 0 deletions

View File

@ -16,5 +16,9 @@ void trap_handler(uint32_t mcause)
void _init() void _init()
{ {
// 设置中断入口函数
write_csr(mtvec, &trap_entry); write_csr(mtvec, &trap_entry);
// 使能CPU全局中断
// MIE = 1, MPIE = 1, MPP = 11
write_csr(mstatus, 0x1888);
} }