AnsweredAssumed Answered

There are some bugs in the adi_int_NestingISR of uCOS

Question asked by YuSong on Jul 22, 2010
Latest reply on Jul 22, 2010 by CraigG

Hi,

 

  I want to use SSL(System Services Library) in the uCOS, but when porting the interrupt processing, I found there are some bugs in the adi_int_NestingISR.

  In the flowing code, R0 has the IVG number, the code want to save the IVG number to the stack, and restore it from stack after OS_CPU_ISR_Entry call, but in the OS_CPU_ISR_Entry function, there are always many registers be saved to the stack, and the SP is decreased when return  from OS_CPU_ISR_Entry, so the "R0 = [SP++];" does not works as wanted, the R0 is not the IVG number now.

 

__STARTFUNC(_adi_int_NestingISR)
    /* Anomaly 05000428 does not apply here because the memory read is from MMR space */
    .MESSAGE/SUPPRESS 5517;
    WORKAROUND_05000283()
    .MESSAGE/POP 5517;
#if defined(ADI_SSL_UCOS)
    /* Save the RETS before making the call */
    [ -- SP ] = RETS ;
   
    /* this function takes care of incrementing OSIntNesting and saving */
    /* processor context.                                               */
   [--SP] = R0;    /* since OS_CPU_ISR_Entry is an external function (uCOS port), it's register usage  */
                    /* is not known, so it's just better to save the argument on the stack */
    R0 = NESTED;
    CALL.X _OS_CPU_ISR_Entry;
    R0 = [SP++];
    /* Setup C Run-Time stack */
    LINK 0;
    SP += -12 ;/* make space for outgoing arguments when calling C-functions */
#else
    ADI_INT_ISR_PROLOG(__NESTED)
#endif

Outcomes