From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 20 15:09:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15E5A16A4DF for ; Sun, 20 Aug 2006 15:09:10 +0000 (UTC) (envelope-from rik@inse.ru) Received: from mail.inse.ru (inse.ru [144.206.128.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0E3A43D45 for ; Sun, 20 Aug 2006 15:09:09 +0000 (GMT) (envelope-from rik@inse.ru) Received: from [127.0.0.1] (www.inse.ru [144.206.128.1]) by mail.inse.ru (Postfix) with ESMTP id 7738A33C46 for ; Sun, 20 Aug 2006 19:09:08 +0400 (MSD) Message-ID: <44E87CCD.30105@inse.ru> Date: Sun, 20 Aug 2006 19:16:29 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.7.12) Gecko/20060103 ASPLinux/1.7.12-1.5.1.1asp X-Accept-Language: ru-ru, ru MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Subject: global date via module howto X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Aug 2006 15:09:10 -0000 Hi, I have the following problem: module A int x; module B extern int x; Module A is loaded, module B can't be loaded cause of unknow 'x'. What should I do to make x global? PS. I am working on porting irda support for USB devices from NetBSD. The current model consists of two layers hw and sw. hw is the usb device driver. sw is some software layer the same for all device and it is a child on top of hw 'bus'. To make this working I need to add DRIVER_MODULE for each 'bus'. To make sw independent from the bus I need to export _driver and _class structures and put DRIVER_MODULE in 'bus' code instead of 'child'. rik