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.

On Jul 2, 2008, at 2:43 PM, Chris Gilbert wrote:


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

Home | Main Index | Thread Index | Old Index