This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: ARM swi service routine
- From: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- To: Shaun Jackman <sjackman at gmail dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Wed, 19 Jan 2005 18:23:22 +0000
- Subject: Re: ARM swi service routine
- Organization: GNU
- References: <7f45d939050119101749dff3c6@mail.gmail.com>
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.