[En-Nut-Discussion] Bug in Nut Init?

Harald Kipp harald.kipp at egnite.de
Thu Apr 3 10:38:42 CEST 2003


>
>Non optimised code doesn't get inline functions - thus NutEnter/Exit
>Critical break the stack. I have changed these to be macros (under GCC) and
>all seems OK in debug.

Yes, this appeared first when compiling with GCC 3.3.


>Also, I noticed that the context switch saves all the registers, from the
>GCC documentation it seems that r0,r1,r18-r27,r31,r31 do not need saving -
>(giving a 14 byte of stack space saving). The complete save would be needed
>if it was premeptive, but as it's a function call it doesn't appear to be
>necessary. Is there some underlying reason that I have overlooked?

Looks like this is a very good advice. I never thought about this.


>I also implemented a ThreadKill, it basically uses a priority of 255 to kill
>a thread (meaning Idle becomes 254)

The original Liquorice code uses the idle thread to release
memory occupied by dead threads. After a general change of
the timer and event handling, this didn't work anymore and
I decided, that one can write applications easily without
any need to kill threads. That was meant as a temporary solution,
but...as often...temporary solutions exist longer than expected. :-)

Thanks, I'll try your solution.

Harald




More information about the En-Nut-Discussion mailing list