[ECOS] ARM vector.s -- suspicious code in return_from_exception
Mark Salter
msalter@redhat.com
Mon Jun 30 12:25:00 GMT 2003
>>>>> 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
More information about the Ecos-discuss
mailing list