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: Sparc context switching enhancement possibility?


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

> Hi:
>     I have looked into the source code for switching the context between for
> sparc target. There are something I can't really understand:
> 
> When saving the old thread's register window set ( 8 or less), it seems it
> makes sequence of " save %sp, -16 * 4, %sp" instructions in order to cause
> the register window overflow happens then the trap handler will store all
> the register window set onto the stack of the old thread(is this correct??).
> But why can't we just save the the register windows which have already been
> used in the old thread rather than open all the register window to get a reg
> win overflow trap for saving onto the old thread's stack? Will that save
> time?

While we could put the code to save the register windows directly into
the context switch code, this would greatly increase its size and
complexity. It is much tidier to use the save trap mechanism that is
already present.


> 
> 
> BTW I tried to follow the flow of the context switching in sparc but just
> can't get through the stack. attached is a pic of how I think the stack is
> changing during the context switching, hope anybody can piont out any
> mistake.
> 

Most of this seems to be questions about how the sparc architecture
handles save traps. I am afraid you have reached the limit of my
knowledge of the sparc architecture. I do not have an architecture
manual here, and in any case I have better things to do that read it
and explain it to you.  I suggest you read the architecture manual for
yourself.

-- 
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]