Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: converting SWIs to pass swi number in a register.

Matt Thomas wrote:
> On Jul 2, 2008, at 2:43 PM, Chris Gilbert wrote:
>> Hi,
>> I was wondering if anyone had an opinion on switching to passing the
>> SWI  number into syscall.  I know Linux did this a while back.
>> I think it particularly makes sense for processors with seperate
>> instruction and data caches, as it save taking a data cache miss for
>> every SWI call.
>> Looking at the current code and our current ABI, I'm thinking we could
>> use ip (r12) to pass the SWI to the kernel, eg SYSTRAP becomes similar
>> to this:
>> #define SYSTRAP(x)      \
>>                         mov r12, # ((SYS_ ## x) & 0xff) ;\
>>                         add r12, r12, #((SYS_ ## x) & 0xff00) ;\
>>                         swi SWI_OS_NETBSD | SYS_ ## x
>> Note I thinking we can probably a bit of tweaking to remove an
>> instruction count if the swi is < 256
>> This would allow a post 5.0 kernel to only need to look at the r12/ip
>> to work out the SWI call.
> I'm already doing that for the THUMB SWI where syscall # > 255.
> One question is how do we know we are using ip?  Think binary
> compat with older binaries...

If you have COMPAT_40 or earlier defined then we load the SWI from the
instruction stream and look at it.  By putting the change into 5.0 it
means that COMPAT_50 won't need to look at the SWI instruction.

(Note I may be mis-understanding what the COMPAT_XX means, I thought it
was a tag for the kernel can run stuff from that release...)


Home | Main Index | Thread Index | Old Index