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

Re: [f-cpu] optional SRB



> > How did you start to save your register ? You need a target address that
> > you must first put in a register to save your registers, so you always
> > lost at least one register... Puting the PC in the SR is not needed. If
> > you want it, use loopentry. If you want to modify it use jmp. No need to
> > complexify the SR unit for something like that.

> My previous email (18:45) was just addressing that ;)

> Note : you *cannot* use "jmp" or "loopentry" to return from an interrupt
> handler. You can't use any instruction that would use a general-purpose
> register. The interrupted task does not know it has been interrupted,
> so you must restore the whole of the register set when you return. Thus
> the return address cannot be taken from a general-purpose register.
> It can however be taken from a SR, because SRs are not meant to be
> used by ordinary code.

But I was thinking that we have "ret" for that purpose and in fact SR will be 
very slow. Of course, this can't be taken from "user" register because we 
can't trust them, but I don't see the need to access it throug SR.
	In fact, SR can be used by ordinary code, specially by one that adapt their 
SIMD code.

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