Date: Wed, 30 Sep 1998 11:59:06 +0200 From: Eivind Eklund <eivind@yes.no> To: Etienne de Bruin <Etienne.Debruin@KryptoKom.DE>, Hackers FreeBSD <freebsd-hackers@FreeBSD.ORG> Subject: Re: DATA_SET and SYSINIT question Message-ID: <19980930115906.36170@follo.net> In-Reply-To: <199809300759.JAA03170@borg.kryptokom.de>; from Etienne de Bruin on Wed, Sep 30, 1998 at 09:59:33AM %2B0200 References: <199809300759.JAA03170@borg.kryptokom.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <some-symbol> in <some-set>, using the syntax DATA_SET(<some-set>, <some-symbol>); 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980930115906.36170>