Subject: Re: Kernel calls - args in registers
To: John S. Dyson <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 11/20/1996 00:32:23
>It is likely that if we use the register passing conventions in the
>kernel -- it'll be because there is a worthwhile improvement.  I haven't
>seen a significant one -- YET.  If you see one -- let me know!!!

The x86 just doesn't have enough registers for this to be worth
much.  But for NetBSD, looking in a non-x86-specific direction:

I experimented with this on 68030s running More/BSD (Mt.Xinu's
version of the Utah port of 4.3bsd-Tahoe, or thereabouts) to hp300s.
I measured worthwhile savings from both passing arguments
in registers and using callee-pops for non-variadic functions.

That was with gcc 1.33; I don't know how much saving to expect from
gcc2, if and when the -mregparm works again.  I'd definitely encourage
the NetBSD people with access to m68k machines to try it, though.

Are there better alternatives, these days, than rewriting
all the locore routines to use different calling convention?
Like maybe adding attributes to a declaration to disable -mrtd?

And of course, passing _syscall_ args in registers rather
than on the normal stack saves copyin/copyout, and reduces
syscall latency, which is a Good Thing for us time vultures.