请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:AM4377 工具/软件:TI-RTOS
您好!
tisebsp.c 文件的"bsp_send_command_to_firmware"函数中有一个中断锁定和解锁调用。 中断锁定下的关键段代码包含多个函数调用以及一个 DO 循环、该循环进而调用另一个函数来验证 while 真/假条件、这可能会持续更长时间。 请参阅以下代码:
void bsp_send_command_TO_firmware (PRUICSS_handle pruIcssHandle、uint32命令、uint16 param1、uint16 param2) { uint32_t evtoutNum = 0; volatile t_host_interface* pHost2PruIntfc =(volatile t_host_interface *)(((((PRUICSS_HwAttrs *)(pruIcsHandle->hwAttrs))->baseAddr)+ PRU_ICSS_DataRAM (0); { #if defined (enable_PDI_task)|| defined (enable_PDI_SWI)(如果已定义) Semaphore_pend (semcmdlow_handle、BIOS_wait_forever); #else Hwi_disable(); #endif bsp_pruss_cmd_intfc_write_word (命令、&pHost2PruIntfc->cmdlow); bsp_pruss_cmd_intfc_write_word (param1、&pHost2PruIntfc->param1low); bsp_pruss_cmd_intfc_write_word (param2、&pHost2PruIntfc->param2low); #ifdef support_cmdac_poll_mode bsp_pruss_cmd_intfc_write_word (1、&pHost2PruIntfc->cmdlow_ack); #endif PRUICSS_pruSendEvent (pruIcss1Handle、ARM_PRU_EVENT1); ASSERT_DMB(); ASSERT_DSB(); { #ifdef support_CMDACK_POLL_MODE 易失性 uint16 ack; 执行{ ACK = bsp_pruss_cmd_intfc_read_word (&pHost2PruIntfc->cmdlow_ack); } while (ack); #else evtoutNum = HOST_CMD_LOW_ACK_EVENT - 20; PRUICSS_pruWaitEvent ((PRUICSS_Handle) pruIcss1Handle、evtoutNum); #endif } bsp_pruss_cmd_intfc_write_word (0xFF、&pHost2PruIntfc->cmdlow); #if defined (enable_PDI_task)|| defined (enable_PDI_SWI) Semaphore_post (semcmdlow_handle); #else Hwi_enable(); #endif } }
1.为什么需要在中断模式下进行硬件锁定?
2.如果需要、在中断锁定中有一个重要的代码段是正确的吗?
由于此处的中断锁定、我们面临的问题是 CPU 完全被该函数单独使用、并且预期接收的应用任务中断丢失。
希望您能提前回复。
谢谢、
Sunil。