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.

Passing arguments to an SWI

Under DSP/BIOS I could use SWI_getattrs and SWI_setattrs to set new argument values for an SWI.

 

In SYS/BIOS 6.x these functions are no longer there.

 

How do you change the value of the arguments to an SWI?

 

If I try:

mySwiHandle->arg0 = new value;

I get the error:

error #395: pointer to incomplete class type is not allowed

 

Thanks,

  Peter Steinberg

 

 

  • Peter --

    You should be able to use Swi_construct() API which will reinitialize the Swi object with new values.  Note that Swi_construct does not allocate any memory.  It just initializes the Swi object pointed to by the Swi_Handle to the new values.

    You can use Swi_getFunc() to get the prior function and args.  And Swi_getPri() and Swi_getTrigger() to get the other params necessary to initialize the Swi_Params structure.

    You also have to cast the SWI_Handle to (Swi_Struct *) since Swi_construct takes a 'Struct *' which might not match Swi_Handle.

    -Karl-

  • That sort of works, but it is ugly code to have to use repeatedly in a HWI.

     

    Also, Swi_getTrigger can only be called from an SWI.  The call does not take any arguments indicating which SWI you want to get the trigger information from so you cannot reconfigure an SWI and retain the trigger value

     

    Is there some reason why the ability to easily change the arguments of an SWI was removed?

  • Sorry about the bad info about the SWI_getTrigger().  You are right.  That API can only be used from a Swi.  And it returns the trigger value that launched that particular Swi.  Mainly only useful for Swi_or() and Swi_inc().

    Swi_getFunc() and Swi_getPri() were intended to serve the needs of SWI_getattrs().   And SYS/BIOS has the ability to create or construct any object, so Swi_construct() was deemed sufficient to cover the use case for prior SWI_setattrs().   I filed an enhancement request and we will consider adding short cut APIs for future SYS/BIOS release -- SDOCM00078998.

    -Karl-