Thursday, February 13, 2014

Task exception: Enable and Disable of exception

① Enable and Disable of Task Exception

Disabling is just disabling the task exception flag. But, enabling of task exception is not only the enabling of the task exception, but immediately executing the exception handler if there are pending exceptions. Remember in RTOS at each point of instruction execution, the prioritized execution should be secured.

② uITRON implementation of ena_tex

ER ena_tex()
{
        Sanity check on arguments
        Enter critical section
        Get the TCB of the calling task
        Set the flag Exception enabled on the TCB
        if (there is pending exception and Task execution is not inside exception handler)
                raise the exception
        Exit critical section
        return E_OK;
}
③ uITRON implementation of dis_tex

ER dis_tex()
{
        Sanity check on arguments
        Enter critical section
        Get the TCB of the calling task
        Set the flag Exception disabled on the TCB
        Exit critical section
        return E_OK;
}
RTOS is an box of springs each with own compression...

No comments: