[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [f-cpu] Smooth Register backup issues...



No no ! you people are mixing wrong things...

I don't think it's the same as for ARM with some special registers mapped.

The purpose of two sets is just to be able to use registers without waiting
for saving old values of registers.  I presume such "swapping" is only done
when switching CMB. So no need to have much more sets.

Now more seriously : take the case of ia32 (x86) where we have basically
three kinds of interrupts.

- task gate : TSS switching, very slow process
- interrupt gate : only CS:EIP and SS:ESP are saved, nested interrupts are
not allowed
- trap gate : only CS:EIP and SS:ESP are saved, nested interrupts are
allowed

Interrupt and trap gates are not so different each other : the first sets
the bit EFLAGS.IF so no interrupts can occur afterwards.

Usually, in most OS, trap and interrupt gates are used instead of task gate
because it is more efficient in time-cost. There is a lot of situations
where a task gate is not necessary, especially regarding with peripheral
IRQs and exceptions. I believe that Linux doesn't even use task gate for its
processes although task gate is designed for such a thing.

What I seem to understand is that you want to use a CMB switching far all
interrupts or exceptions, which sounds like a task gate. Is it really a good
idea ?

The main trouble is that having not a dedicated register for stack, we
cannot design interrupt and trap gates for F-CPU (that is, saving caller
return address in stack). So we are all kept in a struggle to find the best
way to accomodate CMB into a fast switching. But is it really worth ? I mean
is there any real situation where a handler really need to use all the 64
registers ? Im' quite doubtful...

/christophe





----- Original Message -----
From: "Nicolas Boulay" <nico@seul.org>
To: <f-cpu@seul.org>
Sent: Saturday, November 15, 2003 9:16 PM
Subject: Re: [f-cpu] Smooth Register backup issues...


Le Samedi 15 Novembre 2003 18:28, ben franchuk a écrit :
> The problem with the exchange type instructions with the
> Z80 is you never knew if the registers were swapped.
> You almost need 4 swap banks ...
> user
> kernel:TRAP
> kernel:IRQ
> kernal:CRITICAL

When do you have this cases ?

nicO

> Ben.
>
> *************************************************************
> 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/



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