[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: DATA_SET and SYSINIT question
From:       Eivind Eklund <eivind () yes ! no>
Date:       1998-09-30 9:59:06
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic