ARM swi service routine
Richard Earnshaw
rearnsha@gcc.gnu.org
Wed Jan 19 18:23:00 GMT 2005
On Wed, 2005-01-19 at 18:17, Shaun Jackman wrote:
> Hello,
>
> Is the ARM swi service routine allowed to trash r1-r3 and r12 like a
> function call, or must it preserve these values like an interrupt
> handler? The return value is in r0, so it's a moot point.
>
> Is there any code for an ARM swi service routine in libgloss perhaps
> or elsewhere?
There isn't really a single answer to this question. There's no 'ABI'
for SWI calls, so it depends on the SWI service.
On some OSes there might be a general rule, on others it might be
completely different from call to call. For example, some OSes have a
general rule that an error is reported by setting the V flag in the
CPSR, others do it through special return values.
R.
More information about the Newlib
mailing list