Rev 4204 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4204 | Rev 4221 | ||
---|---|---|---|
Line 20... | Line 20... | ||
20 | #include <ipc/services.h> |
20 | #include <ipc/services.h> |
21 | #include <errno.h> |
21 | #include <errno.h> |
22 | 22 | ||
23 | #include "libpci/pci.h" |
23 | #include "libpci/pci.h" |
24 | 24 | ||
25 | #define PCI_CONF1 0xcf8 |
- | |
26 | #define PCI_CONF1_SIZE 8 |
- | |
27 | - | ||
28 | #define NAME "PCI" |
25 | #define NAME "PCI" |
29 | 26 | ||
30 | static struct pci_access *pacc; |
27 | static struct pci_access *pacc; |
31 | 28 | ||
32 | int main(int argc, char *argv[]) |
29 | int main(int argc, char *argv[]) |
Line 36... | Line 33... | ||
36 | char buf[80]; |
33 | char buf[80]; |
37 | ipcarg_t ns_in_phone_hash; |
34 | ipcarg_t ns_in_phone_hash; |
38 | 35 | ||
39 | printf("%s: HelenOS PCI driver\n", NAME); |
36 | printf("%s: HelenOS PCI driver\n", NAME); |
40 | 37 | ||
41 | /* |
- | |
42 | * Gain control over PCI configuration ports. |
- | |
43 | */ |
- | |
44 | void * addr; |
- | |
45 | pio_enable((void *) PCI_CONF1, PCI_CONF1_SIZE, &addr); |
- | |
46 | - | ||
47 | pacc = pci_alloc(); /* Get the pci_access structure */ |
38 | pacc = pci_alloc(); /* Get the pci_access structure */ |
48 | pci_init(pacc); /* Initialize the PCI library */ |
39 | pci_init(pacc); /* Initialize the PCI library */ |
49 | pci_scan_bus(pacc); /* We want to get the list of devices */ |
40 | pci_scan_bus(pacc); /* We want to get the list of devices */ |
50 | for(dev=pacc->devices; dev; dev=dev->next) { /* Iterate over all devices */ |
41 | for(dev=pacc->devices; dev; dev=dev->next) { /* Iterate over all devices */ |
51 | pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_IRQ); |
42 | pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_IRQ); |