2024-10-25 17:46:21 +08:00
|
|
|
|
|
2024-10-28 15:51:12 +08:00
|
|
|
|
|
|
|
|
|
|
#include "custom_ops.S"
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-28 18:01:25 +08:00
|
|
|
|
.extern main
|
|
|
|
|
|
.globl _prog_start
|
|
|
|
|
|
.section .text.init
|
2024-10-28 15:51:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-10-28 18:01:25 +08:00
|
|
|
|
_prog_start:
|
|
|
|
|
|
li x15, 0
|
2024-10-30 10:24:22 +08:00
|
|
|
|
# picorv32_maskirq_insn(zero, zero)
|
2024-10-28 18:01:25 +08:00
|
|
|
|
call main
|
2024-10-28 15:51:12 +08:00
|
|
|
|
|
2024-10-28 18:01:25 +08:00
|
|
|
|
li gp, 1;
|
|
|
|
|
|
ecall
|
2024-10-28 15:51:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-25 17:46:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-10-28 18:01:25 +08:00
|
|
|
|
.balign 32
|
2024-10-29 09:33:29 +08:00
|
|
|
|
.section .trap_entry, "ax", %progbits
|
2024-10-25 17:46:21 +08:00
|
|
|
|
trap_entry:
|
2024-10-28 18:01:25 +08:00
|
|
|
|
# q0 return address
|
|
|
|
|
|
# q1 bitmask of all IRQ to be handled, may be more than one IRQ
|
|
|
|
|
|
# q2 q3 unused, can be use as temp storage register
|
|
|
|
|
|
|
|
|
|
|
|
# q寄存器已经禁用, Without the q-registers, the irq return address will be stored in x3 (gp) and the IRQ bitmask in x4 (tp),
|
|
|
|
|
|
|
2024-10-30 10:24:22 +08:00
|
|
|
|
# addi x15, x4, 0
|
2024-10-28 18:01:25 +08:00
|
|
|
|
|
|
|
|
|
|
picorv32_retirq_insn()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|