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,

> We have options in some HALs to control exactly
> which registers get saved in an interrupt and which
> get saved in a context switch.
> When these are enabled only caller-saved registers
> are saved in the interrupt 
I don't understand this point. Every interrupt may not
be  a timer interrupt thus leading to context switch,
hence the "entier CPU state ... distributed
across....duplicated." is bit confusing to me.

Otherwise too, I am not able to comprehend your
interrupt related explanation above. What I understand
in above explanations of yours, is that in interrupt
state saving, only those registers will be saved that
caller function saves before calling another function.
right?

Since interrupt can come at any point of time if we
don't save all the registers in interrupt, then how
can we have the same state back after returning from
interrupt???

Won't other (callee saved) regs be corrupted?  Or is
it that the assembly code saves callee saved regs also
(after saving interrupted CPU state) before calling
any other interrupt handling routine?

Please clear the confusion. May be I get the confusion
as I don't have any experience with the kind of
hardwares you mentioned.

> and only callee-saved registers are saved in the
> context switch. Hence the entire CPU state of an
> interrupted thread is actually distributed across
> two save areas, and very little is duplicated.

brij



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.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]