UbixOS V2 2.0

Data Structures | Macros | Functions
pci.h File Reference
`#include <sys/types.h>`
Include dependency graph for pci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | confadd
struct | pciConfig

## Macros
#define | countof(a) (sizeof(a) / sizeof(a[0]))

## Functions
int | pci_init ()
uint32_t | pciProbe (int bus, int dev, int func)
uInt32 | pciRead (int bus, int dev, int func, int reg, int bytes)
void | pciWrite (int bus, int dev, int func, int reg, uInt32 v, int bytes)

## Macro Definition Documentation

## ◆ countof

#define countof | ( |  | a | ) | (sizeof(a) / sizeof(a[0]))

Definition at line 98 of file pci.h.

## Function Documentation

## ◆ pci_init()

int pci_init | ( |  | ) |

Definition at line 244 of file pci.c.

References pciConfig::bus, pciConfig::classCode, countof, pciConfig::dev, pciConfig::func, pciConfig::intLine, pciConfig::intPin, kprintf(), name, pciClasses, pciProbe(), pciConfig::progIf, pciConfig::subClass, and pciConfig::vendorID.

Here is the call graph for this function:

## ◆ pciProbe()

uint32_t pciProbe | ( | int | bus,
|  | int | dev,
|  | int | func
| ) |  |

Definition at line 139 of file pci.c.

References pciConfig::bar, pciConfig::bist, pciConfig::bus, pciConfig::cacheLineSize, pciConfig::classCode, pciConfig::command, pciConfig::dev, pciConfig::deviceID, pciConfig::func, pciConfig::headerType, pciConfig::intLine, pciConfig::intPin, kfree(), kmalloc(), kprintf(), pciConfig::latencyTimer, memset(), pciRead(), pciWrite(), pciConfig::progIf, pciConfig::status, pciConfig::subClass, and pciConfig::vendorID.

Referenced by pci_init().

Here is the call graph for this function:

## ◆ pciRead()

uInt32 pciRead | ( | int | bus,
|  | int | dev,
|  | int | func,
|  | int | reg,
|  | int | bytes
| ) |  |

Definition at line 76 of file pci.c.

References confadd::bus, confadd::dev, confadd::enable, confadd::func, inportByte(), inportDWord(), inportWord(), outportDWord(), and confadd::reg.

Referenced by pciProbe().

Here is the call graph for this function:

## ◆ pciWrite()

void pciWrite | ( | int | bus,
|  | int | dev,
|  | int | func,
|  | int | reg,
|  | uInt32 | v,
|  | int | bytes
| ) |  |

Definition at line 108 of file pci.c.

References confadd::bus, confadd::dev, confadd::enable, confadd::func, outportByte(), outportDWord(), outportWord(), and confadd::reg.

Referenced by pciProbe().

Here is the call graph for this function: