Subject: Re: One LKM calls functions exported by another LKM
To: Christos Zoulas <christos@astron.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 03/10/2006 14:55:32
--8FceN5h68k46+V7B
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 10, 2006 at 01:49:52PM +0000, Christos Zoulas wrote:
> In article <20060309100243.BD4E763B102@mail.netbsd.org>,
> George Chen <george.chen@semptian.com> wrote:
> >
> >Hi guys,
> >
> >I'm writing LKM (Loadable Kernel Module) and find I have to let LKM-A ca=
ll
> >functions exported by LKM-B. But I don't know how to implement it.
> >
> >The function is spucall(), declared as usual function in LKM-B.=20
> >LKM-B: int spucall(int cmd);
> >
> >it is referred to in LKM-A as below.
> >LKM-A: extern int spucall(int cmd);
[...]
> I don't think you can do this with our current lkm framework. The closest
> you can get is to link both lkms into one and load it as one unit.

Of course he can.  It's been very easy since ksyms(4), but it was
already possible before that by keeping the result of the link and using
it to load the second module.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--8FceN5h68k46+V7B
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBRBGFVNgoQloHrPnoAQKQ1wgAoxYJxrkLBKu1O8lgYlV7ijG94G0QvUK6
GcXi0WCje8ht9LfiYv/7gQiQdzT59zHgNR9d/kp7Iys7kqYmYj5+iJRU4KSK9Xyb
qssCazP9KuvqO1iXoe62IfVJcsY/C08t1Jx2WBRF7/l40nPHNkH+kuhEsA5RxZsh
MAPIvgG6KL83Lmnx0YSBKepJiVDoKd0ikAIwBQU/Jgayixzu3lNlAHD4Td+pKrzg
OhKITxYF1P8KvQTF+gBT9pAdJWtmqrsOrQ3fkdaVzXRCI32rfHkVrQjbU+Dk6fQt
c4D/FBenE6OY6KPNMlzQoT64rwW61VAWkaF61c82ywGVtBCp+oYZPw==
=7NV3
-----END PGP SIGNATURE-----

--8FceN5h68k46+V7B--