规范化调整启动汇编,先初始化寄存器,再压栈,再开中断
This commit is contained in:
@@ -9,14 +9,7 @@
|
|||||||
|
|
||||||
_prog_start:
|
_prog_start:
|
||||||
|
|
||||||
la t0, trap_entry
|
|
||||||
csrw mtvec, t0
|
|
||||||
li t0, 1 << 11
|
|
||||||
csrw mie, t0
|
|
||||||
|
|
||||||
csrr t0, mstatus
|
|
||||||
ori t0, t0, 1<<3
|
|
||||||
csrw mstatus, t0
|
|
||||||
|
|
||||||
li x1, 0
|
li x1, 0
|
||||||
li x2, 0
|
li x2, 0
|
||||||
@@ -50,7 +43,17 @@ _prog_start:
|
|||||||
li x30, 0
|
li x30, 0
|
||||||
li x31, 0
|
li x31, 0
|
||||||
|
|
||||||
|
la t0, trap_entry
|
||||||
|
csrw mtvec, t0
|
||||||
|
li t0, 1 << 11
|
||||||
|
csrw mie, t0
|
||||||
|
|
||||||
li sp, 0x40011000
|
li sp, 0x40011000
|
||||||
|
|
||||||
|
csrr t0, mstatus
|
||||||
|
ori t0, t0, 1<<3
|
||||||
|
csrw mstatus, t0
|
||||||
|
|
||||||
call main
|
call main
|
||||||
|
|
||||||
ecall
|
ecall
|
||||||
|
|||||||
@@ -9,14 +9,7 @@
|
|||||||
|
|
||||||
_prog_start:
|
_prog_start:
|
||||||
|
|
||||||
la t0, trap_entry
|
|
||||||
csrw mtvec, t0
|
|
||||||
li t0, 1 << 11
|
|
||||||
csrw mie, t0
|
|
||||||
|
|
||||||
csrr t0, mstatus
|
|
||||||
ori t0, t0, 1<<3
|
|
||||||
csrw mstatus, t0
|
|
||||||
|
|
||||||
li x1, 0
|
li x1, 0
|
||||||
li x2, 0
|
li x2, 0
|
||||||
@@ -50,7 +43,17 @@ _prog_start:
|
|||||||
li x30, 0
|
li x30, 0
|
||||||
li x31, 0
|
li x31, 0
|
||||||
|
|
||||||
|
la t0, trap_entry
|
||||||
|
csrw mtvec, t0
|
||||||
|
li t0, 1 << 11
|
||||||
|
csrw mie, t0
|
||||||
|
|
||||||
li sp, 0x40011000
|
li sp, 0x40011000
|
||||||
|
|
||||||
|
csrr t0, mstatus
|
||||||
|
ori t0, t0, 1<<3
|
||||||
|
csrw mstatus, t0
|
||||||
|
|
||||||
call main
|
call main
|
||||||
|
|
||||||
ecall
|
ecall
|
||||||
|
|||||||
Reference in New Issue
Block a user