This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Qustion about Overflow and Underflow in Sparc?


"Qiang Huang" <jameshq@liverpool.ac.uk> writes:

> Hi all:
>    I just looked at the code for handling the under/over-flow in sparc in
> ecos. A stack is growing while making function call, but why I can't find
> the code saving the whole register windows (not only one) when underflow
> happens? If for two threads how the register windows is used? while
> switching context should the whole reg win(8 win) be saved to the thread
> stack(so this will cause delay)? or other way? Thanks a lot
> 

I am no expert on the SPARC code, so the following is only my best
recollection.

The SPARC code handles overflow and underflow on a window-by-window
basis for each thread. When a thread switch happens, then the entire
set for the outgoing thread is saved. Windows are then loaded on an
as-need basis for the incoming thread.

This approach keeps the costs of window handling deterministic, and
avoids the more complex issues of dealing with windows that belong to
threads other than the current one.

-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]