[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:Re: [f-cpu] Stack handling



On Tue, 23 Jul 2002, Thomas Lavergne wrote:
>
>Have you ever written a compiler ?

Yeah, C and Pascal.

>A stack is the most simple and clean solution to handle a lot of thing. 
>We have a lot of register so most compiler simulate the first stack 
>push/pop with reg but when the stack grow we need a real stack handling.
>
>If we haven't stack we must reinvent the weel or back 50 years ago in 
>compiler theorie.
>
>The debat about the number of stack is another thing, I think we need 
>some instruction for stack (pre-dec) on all register so we can have all 
>stack we need.

I think the number of stack is the important case anyway.
Since every process has it's own stack with operating systems
like Linux one only has to take care that the scheduler timer
interrupt should not switch to other process stack without
properly resolving everything of the previous process. That's
why a lot of processors use different stacks for the interrupt
handling and normal operating modes (switched by hardware). In
which way the normal stack stays clean of interrupt/trap stuff.

The previous descriptions that I read on this list gave the
impression to me that each process' own stack can be implemented
without changes of architecture. Atomic INC/DEC with PUSH/POP
style operation is not really necessary for sequential code if
interrupts are handled separately.

JG


>Juergen Goeritz wrote:
>> No, it's not a stupid question at all. I had the same
>> first thought when I read the posting. You may just
>> have a need for a seperate stack for the scheduling
>> handler.
>> 
>> JG
>> 
>> 
>> On Tue, 23 Jul 2002, Nicolas Boulay wrote:
>> 
>>>Maybe it's a stupid question, but why it's forced to try to simulate a
>>>simple stack. There is no hardware support for stack in the f-cpu. Why
>>>not using a completely different pointer for such things ? Why must we
>>>stuck to the use of one single stack ?
>>>
>>>nicO
>>>
>
>
>
>-- 
>Thomas Lavergne                       "Le vrai rêveur est celui qui rêve
>                                        de l'impossible."  (Elsa Triolet)
>thomas.lavergne@laposte.net
>d-12@laposte.net    ICQ:#137121910     http://assoc.wanadoo.fr/thallium/
>
>
>*************************************************************
>To unsubscribe, send an e-mail to majordomo@seul.org with
>unsubscribe f-cpu       in the body. http://f-cpu.seul.org/
>

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/