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: ARM vector.s -- suspicious code in return_from_exception


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]