From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 17 17:52:37 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E37D61065678 for ; Mon, 17 Nov 2008 17:52:37 +0000 (UTC) (envelope-from arhimed@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 86A068FC22 for ; Mon, 17 Nov 2008 17:52:35 +0000 (UTC) (envelope-from arhimed@gmx.net) Received: (qmail invoked by alias); 17 Nov 2008 17:25:51 -0000 Received: from BAD92f2.bad.pppool.de (EHLO localhost) [77.131.146.242] by mail.gmx.net (mp027) with SMTP; 17 Nov 2008 18:25:51 +0100 X-Authenticated: #18080636 X-Provags-ID: V01U2FsdGVkX18mFGgdyn4mKIOlUMLqnIEJn74EU5ZKpodA46xyVA G2pNhyiXV3vuI5 Date: Mon, 17 Nov 2008 18:25:24 +0100 From: Alexandre Fiveg To: freebsd-hackers@freebsd.org Message-ID: <20081117172524.GC2732@debian.samsung.router> Mail-Followup-To: freebsd-hackers@freebsd.org References: <671bb5fc0811151927j6dcb5155oeffbf4cc95cbccb6@mail.gmail.com> <20081116100923.GU81783@hoeg.nl> <20081117113522.GA2732@debian.samsung.router> <868wri3284.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <868wri3284.fsf@ds4.des.no> User-Agent: Mutt/1.5.18 (2008-05-17) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5600000000000001 X-Mailman-Approved-At: Mon, 17 Nov 2008 18:00:01 +0000 Subject: Re: KLD loading, liking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexandre Fiveg List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2008 17:52:38 -0000 On Mon, Nov 17, 2008 at 02:34:28PM +0100, Dag-Erling Smørgrav wrote: > Alexej Sokolov writes: > > Not only that. The use of the MODULE_DEPEND macro allows one module to > > access the variables of modules on which it depends. > > No. Any module X can access any public variable or function in the > kernel or in any other module Y, but loading X will fail if Y is not > already loaded. The only effect of MODULE_DEPEND is to tell the loader > that Y must be loaded before X. No, Example: two modules kld.c and kld1.1: kld: http://pastebin.com/m67799565 Makefile: http://pastebin.com/m5418e5a7 kld1: http://pastebin.com/d154e8474 Makefile: http://pastebin.com/m79723138 In kld is public int var_from_kld declared. To access this variable from kld1 you have to uncomment macro MODULE_DEPEND My system: % uname -v FreeBSD 7.0-RELEASE-p5 #0: Tue Oct 7 19:05:20 CEST 2008 Tell me please if I do something wrong! Thanx > > DES > -- > Dag-Erling Smørgrav - des@des.no > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Alexandre Fiveg Key fingerprint = 0B23 EB52 3944 E440 CFF3 C1F1 7D05 8D00 34F7 A6BD