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: why need to call Cyg_Scheduler::get_current_thread()->set_saved_context(regs) in interrupt_end()?


Hi Nick:
   Thanks for your help. What I mean is: in interrupt_end() a call to
Cyg_Scheduler:: (1) get_current_thread()->set_saved_context(regs) will be
made and later on (2) Cyg_Scheduler::unlock() will be called (which will
call into unlock_inner() then hal_thread_context_switch() will be called).
So in step (1) the "regs"  is passed from the assembly code (eg. for sparc ,
in vec_ivsr.S), so before entering interrupt_end() "regs" should have been
already saved, Is "regs" the context before entering the
interrupt?(interrupted thread's context?), if so in step(2) when executing
the hal_thread_context_switch() the context of the old thread(the
interrupted thread's context) will be saved and new thread's context will be
switched in, then is that means the old thread's context(interrupted
thread's context) will be saved twice?

Sorry for the previous unclear question.

Thanks a lot.

-----Original Message-----
From: Nick Garnett [mailto:nickg@ecoscentric.com]
Sent: 01 October 2002 18:44
To: Qiang Huang
Cc: Ecos-Discuss
Subject: Re: [ECOS] why need to call
Cyg_Scheduler::get_current_thread()->set_saved_context(regs) in
interrupt_end()?


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

> Q1:
> Is the context for the thread is saved by the calling to the pending
dsr()?
> so will those context save be overlapped? or maybe I went to the wrong
way.
> Thanks
>

I'm not sure what you are asking here.

> Q2:
> If this is needed in interrupt_end() so when I implememting the assembly
> code for interrupt handling which context do I need to save? context in
the
> interrupt or the context before entering the interrupt?
>

The interrupt VSR must save the state of the interrupted code so it
can be restarted transparently later. But again, I am not sure I
actually understand what you are asking here.


The call to set_saved_context() is for debugging purposes only, as the
comment and ifdef surrounding it imply. It just saves a pointer to the
saved interrupt context so that the thread debug code can find it.



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