[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Re: [avr-chat] task/thread stack usage
From: |
Larry Barello |
Subject: |
[avr-gcc-list] Re: [avr-chat] task/thread stack usage |
Date: |
Fri, 25 Apr 2003 05:58:35 -0700 |
My rtos, AvrX, does the same thing with a separate stack for
interrupts. Switching stacks slows down processing a tad, but saves a
lot of SRAM. It is not necessary to patch the kernel: I used the
"naked" attribute which had the problem of not setting up a local
frame properly (usually not a problem). IIRC, the "noreturn"
attribute works now with only two bytes of wasted stack storing the
previous frame pointer, or something like that.
Cheers!
----- Original Message -----
From: "Tvrtko A. Ursulin" <address@hidden>
So in case if interrupts are not nested, each task must accomodate
"largest"
interrupt stack? In my own micro-kernel I have optimized that case in
a way
that interrupts have their own stack. Therefore task stack size is not
related to interrupts. In this way I save (n-1)*max_irq_stack bytes of
RAM.
Where n is total number of tasks.
Drawback is that you need to patch your gcc with my __attribute__
((irq))
patch to be able to write proper interrupt handlers.
- [avr-gcc-list] Re: [avr-chat] task/thread stack usage,
Larry Barello <=