From owner-freebsd-hackers Wed Sep 30 02:59:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA04660 for freebsd-hackers-outgoing; Wed, 30 Sep 1998 02:59:26 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA04655 for ; Wed, 30 Sep 1998 02:59:22 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id LAA06600; Wed, 30 Sep 1998 11:59:06 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id LAA02053; Wed, 30 Sep 1998 11:59:06 +0200 (MET DST) Message-ID: <19980930115906.36170@follo.net> Date: Wed, 30 Sep 1998 11:59:06 +0200 From: Eivind Eklund To: Etienne de Bruin , Hackers FreeBSD Subject: Re: DATA_SET and SYSINIT question References: <199809300759.JAA03170@borg.kryptokom.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199809300759.JAA03170@borg.kryptokom.de>; from Etienne de Bruin on Wed, Sep 30, 1998 at 09:59:33AM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Sep 30, 1998 at 09:59:33AM +0200, Etienne de Bruin wrote: > Greetings, > > I have the following questions: > > 1. in pci device drivers, what exactely does DATA_SET() do? DATA_SET() does the same in all drivers - it register in , using the syntax DATA_SET(, ); The code for {TEXT,DATA,BSS,ABS}_SET() is in src/sys/sys/kernel.h > 2. in device drivers, what exactely does SYSINIT() do? Registers init functions, ie functions that are to be called as part of the initialization procedure. See the header file mentioned above and sys/kern/init_main.c for relevant code. > 3. should i do a DATA_SET() AND a SYSINIT() for a pci device driver? Depends on what you want to accomplish. Usually, no. And one question you forgot to ask, but probably is the one you really mean: 4. What should I do to make my shiny new PCI-device be probed by the PCI-code? A: You should create a struct pci_device with suitable probe() and attach() functions, and register this in the pcidevice_set using DATA_SET(pcidevice_set, my_device); With this, your probe() function will be called when the PCI-code is trying to find a suitable driver, and your attach function will be called at the relevant point. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message