This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Re: ISR not causing an DSR in some rare conditions
- From: Sergei Organov <osv at javad dot com>
- To: Jay Foster <jay at systech dot com>
- Cc: "'ecos-discuss at sources dot redhat dot com'" <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 24 Jan 2006 13:26:42 +0300
- Subject: Re: [ECOS] Re: ISR not causing an DSR in some rare conditions
- References: <74C9525D67A5FF4791614FDB06593BB1028544@mail.systech.com>
Jay Foster <jay@systech.com> writes:
> It seems troubling to me that the context switching code does not save and
> restore all registers. Any register(s) not saved and restored by the
> context switching code could not be used anywhere, since you would never
> know when a context switch occurred, clobbering the registers. I agree that
> from the point of view of the ARM ABI this is acceptable, since you know
> when you called another function, but this is not so for context switches.
> I suspect that there is something else going on here, of which I am
> ignorant.
Yes, something else indeed happens here. What you miss is that context
switch, when it is asynchronous, is called from the interrupt handler
that itself saves and then restores (some of) the registers. Thus,
interrupt routines can save only those registers that "C" routines
called from them would modify, and context switch could save only those
that are to be saved by the functions being called according to the ABI.
-- Sergei.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss