Subject: RE: Do LKMs work *at*all* on powerpc platforms?
To: Todd Vierling <tv@wasabisystems.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 08/08/2000 09:35:18
On Mon, 7 Aug 2000, Todd Vierling wrote:
> On Mon, 7 Aug 2000, Bill Studenmund wrote:
>
> : > : > > I think adding something like -mlong-call and __attribute__ ((short-call))
> : > : > > would be the most efficient thing. :-)
> :
> : Oops! This option would ONLY be for the LKM's, not the kernel compile. :-)
>
> However, does this mean that there's a `different' calling convention for
> the kernel vs. LKMs? i.e. stack has `more' on it with one method than the
> other, you can't just rts from long-call code into shortcall. An example of
> `incompatible' calling conventions is the m68020 CALLM/RTM vs. the usual
> [JB]SR/RTS.
I hope not. If that's what long-call means, then that's not what we want.
The intent was to use "long-call" to tell the compiler that when it makes
a call TO this fucntion (or with -mlong-call, when it makes a call to all
functions), it uses the can-jump-anyhwere-in-4GB method. I lost a quote of
the asm's 4 instructions, but it loads a register, then jups to the
address in the register.
As I understand it, to the callee, it looks the same as if the 24-bit
relative subroutine call had been used. So routine exit is the same.
> : Also, could we teach all other ports about it, -mlong-call (and to ignore
> : it), or make some sort of include file magic happen?
>
> That's probably not the best idea; you're probably better off adding it to
> <bsd.kmod.mk>, which is used by LKMs to build. Additional CFLAGS can easily
> be added there.
Probably better. :-)
Take care,
Bill