I have a customer who has a question about the run-time support library for TMS320F2812 DSP.
They would like to know:Are the functions included in the run-time support library re-entrant?
Thanks in advance,-Adam
No, they are not. It's the users responsibility to ensure that nothing happens. If you look at the rts source code, you'll find in many funcitons calls to a lock(). But you'll also see that this lock() is a "nop", so the lock functionality is not implemented. If you use DSP/BIOS, then a correct lock mechanism will be used. This is from the BIOS release notes:
...The DSP/BIOS Kernel uses internal lock/unlock function to protect the MEM heaps and certain runtime support library (RTS) functions from reentrancy. These functions use LCK_pend/post() but these APIs cannot be safely called from HWI or SWI context.There have been several customer problems where customers were unknowingly calling RTS and/or MEM from incorrect context which would cause intermittent/infrequent system crashes.We have therefore updated the internal lock function to verify calling context (with TSK_isTSK()) before calling LCK_pend().If the calling context is not a TSK, this API will call SYS_abort() which will typically halt the processor with interrupts disabled....
If your customer is not using BIOS, they shouldn't call any of the critical RTS functions from an ISR. And if they are using their own OS, they need to implement a lock() function.
That really helped.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.