X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/31be35cda26f033fe62db673a8a973f0b15c9de7..7e16b8e6b3c3aab2c91d9b54c8953201e111be50:/pci/pci.h diff --git a/pci/pci.h b/pci/pci.h new file mode 100644 index 0000000..729f9c0 --- /dev/null +++ b/pci/pci.h @@ -0,0 +1,17 @@ +#ifndef PCI_H +#define PCI_H + +/* General PCI functions. This is implemented by pci-linux.c and pci-raw.c; the + * former uses Linux's /proc/bus/pci interface for access from userspace, while + * the latter accesses the PCI hardware directly. + */ + +void pci_write32(int bus, int slot, int fn, int addr, uint32_t data); +void pci_write16(int bus, int slot, int fn, int addr, uint16_t data); +void pci_write8(int bus, int slot, int fn, int addr, uint8_t data); + +uint32_t pci_read32(int bus, int slot, int fn, int addr); +uint16_t pci_read16(int bus, int slot, int fn, int addr); +uint8_t pci_read8(int bus, int slot, int fn, int addr); + +#endif