[Tinyos Core WG] TOSThreads TEP

Kevin Klues klueska at gmail.com
Wed May 21 16:15:07 PDT 2008


>> I agree that this is pretty risky to not have it at the bottom of each
>> handler.  I'm sure there is a way to streamline the cost here as John
>> suggests, but right now (on the msp430) it takes a couple hundered
>> cycles.....
>
> I think a standard trick is to add a "reschedule requested" flag.  Then
> the fast path for your epilogue is to observe that this flag is zero and
> just return from interrupt.

I just did some rearranging of code and on the msp430, the check to
see if the tos thread should be scheduled reduces to:

4396:       4f 43               clr.b   r15             ;
4398:       f2 93 f8 12     cmp.b   #-1,    &0x12f8 ;r3 As==11
439c:       01 24               jz      $+4             ;abs 0x43a0
439e:       5f 43                mov.b   #1,     r15     ;r3 As==01
43a0:       1f f3                 and     #1,     r15     ;r3 As==01
43a2:       5f 93                cmp.b   #1,     r15     ;r3 As==01
43a4:       02 20               jnz     $+6             ;abs 0x43aa

Kevin


More information about the Tinyos-2.0wg mailing list