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.

BIOS 5.41 for C6000, SWI_getattrs function callability.

Hi,

about the function SWI_getattrs and the spru403r (c6000 DSP/BIOS API user's guide).

At page 2-490 in the function description we state that: "SWI_getattrs cannot be called from a SWI or HWI."

But in the Function Callability Table at page A-9 we read that it is callable by TSK/SWI/HWI/main.

What is the correct statement?

Best regards

Massimo

  • Hi Massimo,

    SWI_getattrs cannot be called from a SWI or HWI. (Due to a possible race condition)

    I filled a bug (SDOCM00090215) against the docs to update this.

  • Hi,

    A couple quick followup questions related ot this...

    1. Could SWI_getattrs() be called from an HWI if global interrupts are disabled?

    2. Does the mailbox attribute return the current mailbox value or the initial mailbox value when the SWI was created?

     

    Thanks

  • I think it is safe to call SWI_getattrs() from a HWI or a SWI as long as you bear in mind that the info you collect may be old or partially inconsistent.

    The reason for this is that the SWI_getattrs() function does not disable interrupts while it populates the attrs structure passed to it.

    Consequently, the SWI referenced could run while the API is executing, resulting in inconsistent or old attrs content being returned.

    If you surround your call to SWI_getattrs() with HWI_disable/restore(), you'll get internally consistent attrs.

    If you call Hwi_restore() before processing the attrs returned by SWI_getattrs(), the SWI could run while you're examining the attrs contents and thus make them stale.

    The 'mailbox' value returned is the current value of the mailbox, NOT the initial value.