Newer
Older
tree-os / src / include / pci.h
#ifndef PCI_H
#define PCI_H

#include <list.h>
#include <stdint.h>

typedef struct {
    uint8_t bus, device, function;
    uint8_t class, subclass;
    uint16_t deviceId, vendorId, programmingInterface;
    uint32_t bar0, bar1, bar2, bar3, bar4, bar5;
} PciDevice;

extern void scanPCIDevices();
extern ListElement **getPciDevices();
extern void pciConfigWriteByte(uint32_t bus, uint32_t device, uint32_t function,
                               uint8_t offset, uint8_t data);

#endif