TI implements mailboxes for DSP-host and inter-DSP data exchanges, see http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.1_PCIe_Demo_Development_Guide#Control_Message_Exchange_via_Pipes_and_Mailboxes
When inspecting the TI code, I am not sure about something and would appreciate helps.
A mailbox is accessed from both sender and receiver (can be on PC and a DSP core respectively or on two DSP cores on same/different chips); dsp_memory_read() and dsp_memory_write() are used for processing mailbox content (mem allocated in the DSP address space). dsp_memory_read/dsp_memory_write are implemented basically via memcpy. Since both sender and receiver need to access/update (both read and write the mailbox header (as well as mail slot header), I'd expect some kind of lock/semaphore is needed to ensure the header updating is protected. However I'm able to find any such things in the code.
Is there actually a locking/unlocking mechanism implemented with the "mailbox" model for mutual exclusion in shared memory update/access from the sender/receiver?
- If there is one, what is it and how is it implemented? and which part of the TI code does it?
- If not, then is it because it is unnecessary (and for what reason) or has the TI SDK code simply overlooked it?
- If indeed TI SDK overlooks it, then one needs to implement a locking/unlocking mechanism. How can one implement it?
- If both sender and receiver (from different cores) are on the same chip, I'd assume a hardware semaphore can be used, right?
- If sender and receiver are on PC host and DSP respectively via PCIe, what can be used as a lock/semaphore?
- If sender and receiver are on separate DSP chips, what's available? perhaps the same thing as host-DSP or something similar for via PCIE?
Any comment/helpful info is very much appreciated!
Yuangao