This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: ARM vector.s -- suspicious code in return_from_exception
- From: Mark Salter <msalter at redhat dot com>
- To: embeddedeng at hotmail dot com
- Cc: list_ericdejong_10 at gmx dot net, ecos-discuss at sources dot redhat dot com
- Date: Mon, 30 Jun 2003 08:25:44 -0400 (EDT)
- Subject: Re: [ECOS] ARM vector.s -- suspicious code in return_from_exception
- References: <Law15-F23Bi89QtpfTY0002badf@hotmail.com>
>>>>> Michael Anburaj writes:
> Hi,
> Well, I don?t know enough about ecos either. But after having looked at the
> code, I agree with you.
> I am also curious about yet other piece of code (if
> CYGOPT_HAL_ARM_PRESERVE_SVC_SPSR is defined the follow is the final piece of
> code executed by return_from_exception).
> // we are returning to svc mode thus we must restore the
> // pre-exception cpsr before returning to interrupted code
> msr cpsr, r0
> ldmfd sp, {r0-r14, pc}
> Can this handle both ARM & THUMB pre-exception code?
No, you are correct. I checked in a fix that returns to thumb/svc mode
correctly. It destroys spsr_svc. This could be avoided, but it would
take a lot of instructions. Since CYGOPT_HAL_ARM_PRESERVE_SVC_SPSR is
intended to allow a debugger to step through SWI handlers, thumb mode
is not likely. Destroying spsr_svc in this case shouldn't be a problem.
Thanks for pointing this out.
--Mark
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss