Subject: RE: Do LKMs work *at*all* on powerpc platforms?
To: David A. Gatwood <dgatwood@deepspace.mklinux.org>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 08/07/2000 14:33:26
On Mon, 7 Aug 2000, David A. Gatwood wrote:

> On Mon, 7 Aug 2000, Bill Studenmund wrote:
> 
> > I mis-spoke a little. All function call prototypes in the kernel would
> > need something like this. :-)
> 
> I hope not.  Ideally, the module API should limit the number of calls to a
> handful -- io_map, poss. some sort of malloc, and a handful of others. 
> The rest of the calls into the kernel would be between the kernel-resident
> part of the module (the module hooks)  and the module itself, and
> obviously those would also be so flagged.

I don't think lkm's work the way you are thinking. In NetBSD, an LKM has
access to ALL the symbols in the kernel, including all of the other
function calls. When it is working right (or done right), an LKM even has
access to symbols in other loaded lkm's.

The original proposal was to add something along the lines of
__attribute__ ((long-call)) to the prototypes of functions outside the lkm
so that the lkm's calls used a long-style jump or branch rather than a
short one. As we open up all of the functions in the kernel to LKM's, that
means that ALL of the prototypes need to have this __attribute__
((long-call)) added. Only when we're compiling an lkm. :-)

I think adding something like -mlong-call and __attribute__ ((short-call))
would be the most efficient thing. :-)

Take care,

Bill