添加 entry.S 文件的一些注释

This commit is contained in:
2025-03-29 13:01:18 +08:00
parent 4315af5d2c
commit 71bca532c5

View File

@@ -218,9 +218,12 @@ interrupt:
.global entry_mip .global entry_mip
.global entry_mcause .global entry_mcause
// cpu
trap_entry: trap_entry:
/* Interrupt trap */ /* Interrupt trap */
// t0
csrw mscratch, t0 csrw mscratch, t0
/* 保存mcause && mip 到pmpaddr中 */ /* 保存mcause && mip 到pmpaddr中 */
csrr t0, mcause csrr t0, mcause
@@ -228,11 +231,15 @@ trap_entry:
csrr t0, mip csrr t0, mip
csrw pmpaddr15, t0 csrw pmpaddr15, t0
// 线
andi t0, t0, -1912 // -1912 = 0x888 andi t0, t0, -1912 // -1912 = 0x888
// bnez jal x1 ra
bnez t0, interrupt bnez t0, interrupt
/* System call and other traps */ /* System call and other traps */
// mscratcht0 spmscratch
csrrw t0, mscratch, sp csrrw t0, mscratch, sp
//
la sp, _trap_sp la sp, _trap_sp
#ifndef __riscv_float_abi_soft #ifndef __riscv_float_abi_soft
addi sp, sp, -REGBYTES*64 addi sp, sp, -REGBYTES*64