From 0a4146be809fdf57b3d3833bdf63d3f2d3605542 Mon Sep 17 00:00:00 2001 From: "lishuang.xie" Date: Mon, 24 Jul 2023 09:43:59 +0800 Subject: [PATCH] 1. add synch to spu_sw_queue.s.c 2. change memcpy bu spu_shell.s.c The above are possible problems found during the current process --- public/common/platform/src/spu_shell.s.c | 5 +++-- public/common/platform/src/spu_sw_queue.s.c | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/common/platform/src/spu_shell.s.c b/public/common/platform/src/spu_shell.s.c index 977a262..8b67a69 100644 --- a/public/common/platform/src/spu_shell.s.c +++ b/public/common/platform/src/spu_shell.s.c @@ -116,10 +116,11 @@ void spu_insert_cmd_ext(char *name, OSP_FUNCPTR pfunc, char *desc, uint32_t argn UCP_PRINT_EMPTY("osp_insert_cmd_ext num:%u beyond MAX_EXT_CMD_NUM:%d\r\n", num, MAX_EXT_CMD_NUM); return; } - + memcpy_ucp(tlb[num].cmd, name, strlen(name) + 1); memcpy_ucp(tlb[num].descption, desc, strlen(desc) + 1); - memcpy_ucp(tlb[num].wrapper, (OSP_FUNCPTR)spu_shell_wrapper, sizeof(OSP_FUNCPTR)); + tlb[num].wrapper = (OSP_FUNCPTR)spu_shell_wrapper; + //memcpy_ucp(tlb[num].wrapper, (OSP_FUNCPTR)spu_shell_wrapper, sizeof(OSP_FUNCPTR)); //memcpy_ucp(tlb[num].routine, pfunc, sizeof(OSP_FUNCPTR)); tlb[num].routine = pfunc; tlb[num].argnum = argnum; diff --git a/public/common/platform/src/spu_sw_queue.s.c b/public/common/platform/src/spu_sw_queue.s.c index 2f1263f..d5b96df 100644 --- a/public/common/platform/src/spu_sw_queue.s.c +++ b/public/common/platform/src/spu_sw_queue.s.c @@ -520,11 +520,14 @@ uint8_t spu_sw_enque(spu_sw_queue_index_e emqueue_idx, int8_t *pi8addr) u16enqueue_cnt++; u32msg_addr = u32queue_share_addr + SPU_APE_RFM_MSG_OFFSET + SPU_APE_RFM_MSG_SIZE*u16enqueue_idx; + __ucps2_synch(0); do_write_short(u32msg_addr, u16enque_idx); debug_write(DBG_DDR_COMMON_IDX(core_id, 124), u16enque_idx); //debug_write(DBG_DDR_COMMON_IDX(core_id, 125), u16enqueue_cnt); debug_write(DBG_DDR_COMMON_IDX(core_id, 126), u32msg_addr); debug_write(DBG_DDR_COMMON_IDX(core_id, 127), u32enque_addr); + + __ucps2_synch(0); do_write_short(u32enque_addr, u16enqueue_cnt); return 0; } @@ -563,6 +566,7 @@ uint8_t spu_sw_deque(spu_sw_queue_index_e emqueue_idx, uint32_t **pu32value) u16queue_msg_idx = do_read_short(u32msg_addr); *pu32value = (uint32_t *)(gst_sw_queue_mem[emqueue_idx].u32addr + (u16queue_msg_idx)*SPU_APE_RFM_QUE_SIG_SIZE); + __ucps2_synch(0); do_write_short(u32deque_addr, u16dequeue_cnt); return 0;