2020-04-11 11:03:49 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "include/utils.h"
|
|
|
|
|
|
|
|
|
|
|
|
extern void trap_entry();
|
|
|
|
|
|
|
|
|
|
|
|
void _init()
|
|
|
|
{
|
2020-04-25 09:05:48 +00:00
|
|
|
// 设置中断入口函数
|
2020-04-11 11:03:49 +00:00
|
|
|
write_csr(mtvec, &trap_entry);
|
2020-04-25 09:05:48 +00:00
|
|
|
// 使能CPU全局中断
|
|
|
|
// MIE = 1, MPIE = 1, MPP = 11
|
|
|
|
write_csr(mstatus, 0x1888);
|
2020-04-11 11:03:49 +00:00
|
|
|
}
|