Files
eb001/tb/sw/src/hlmSvrOpt.S

114 lines
2.3 KiB
ArmAsm
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include "tl2cdr.h"
#include "sysDef.h"
#include "plic.h"
#if 0
/*
使RV32E RV32I 使x0, x16~x31
便使ABI使x0, x16~x31x1~x15使ABI
*/
#endif
#if !(defined(__riscv_i) || defined(__USE_RV32I_ABI))
#error "must be compiled in RV32I"
#endif
.globl _prog_start
.globl _rv32i_plic_handle
.section .text.init, "ax", %progbits
_prog_start:
//a0 call_function no
li x16, SYS_INIT
beqz a0, init_func //
li x16, SYS_SEND_DATA
beq a0, x16, send_data_func
li x16, SYS_SET_RECV_INFO
beq a0, x16, set_recv_info_func
li x16, SYS_SLAVE_WORK
beq a0, x16, slave_work_func
10: j 10b //
ret //
//---------------------------------------------------------
//a1~a5
hlm_slave_work:
li x18, 1
i_rx0_txPair(x18)
i_rx0_limitTime(x0)
i_rx1_txPair(x0)
i_rx1_limitTime(x0)
1:
i_hlm_read_intflag(x17)
i_hlm_status(x16)
andi x18, x17, HLM_INT_RX0_START
ret
//---------------------------------------------------------
//
//a1, plic_claim,
init_func:
ret
//---------------------------------------------------------
//
//a1,
//a2,
//a3, dummy
//a4, dummy
send_data_func:
#warning ..................................................
ret
//---------------------------------------------------------
//,
//a1,
slave_work_func:
1:
i_hlm_status(x18)
andi x19, x18, HLM_RX0_VALID
beqz x19, 1b
i_rx0_rxFifo(x20)
srli x19, x20, 20
addi x19, x19, 4
i_tx1_txLen(x29)
i_tx1_txFifo(x29)
li x21, 4
1:
i_hlm_status(x29)
andi x18, x18, HLM_RX0_VALID
beqz x18, 1b
i_rx0_rxFifo(x29)
i_tx1_txFifo(x29)
addi x21, x21, 4
bltu x21, x19, 1b
ret
//---------------------------------------------------------
set_recv_info_func:
ret
//---------------------------------------------------------
//,使
.balign 32
_rv32i_plic_handle:
mret