This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

source code for DSP/BIOS 5.x

i would like to get my hands on the source code of DSP/BIOS 5.x to add some instrumentation. I have found this:

http://processors.wiki.ti.com/index.php/Source_code_for_DSP_BIOS

but i wonder if the licensing fee has changed over the years?

some background info: we have a multi-tasking c++ application running on DSP/BIOS 5.x and i suspect a priority inversion happening when memory is dynamically allocated. to prove this, i would like to instrument the resource lock that must happen deep down in malloc() and free(), (mem_allo.o64P and mem_free.o64P)

cheers,

sam

  • The memory code uses _MEM_lock/unlock for the critical section.   These are function pointers.

    The signature is void _MEM_lock(void) and void _MEM_unlock(void).

    You could replace these function pointers with a function of your own which should internally call the original.   You could then add instrumentation to your custom lock/unlock functions.

    The function pointers are registered during boot time to allow boot code to use the MEM module before tasking subsystem has been initialized, so you need to override them from a TSK context.

    #define _MEM_lock() ((*MEM_D_lockaddr)())

    #define _MEM_unlock() ((*MEM_D_unlockaddr)())

  • thanks karl, this worked great! <mem.h> even defines

    #define MEM_register_lock(fxn) MEM_D_lockaddr = (fxn)
    #define MEM_register_unlock(fxn) MEM_D_unlockaddr = (fxn)

    so i really should have figured this out myself. ah well...

    also, it seems like there is no need to internally call the original as i have it running now with a custom lock function that doesn't call the original (i need to have access to the underlying LCK_Handle and hence call LCK_pend/post in this function).

    cheers,

    sam