From 2b9e3e68ff11d5d08c11518e4ce17d8c4121e5e4 Mon Sep 17 00:00:00 2001 From: puffer Date: Sun, 25 Feb 2024 19:30:59 +0100 Subject: [PATCH] Update pci.h --- src/system/pci/pci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/system/pci/pci.h b/src/system/pci/pci.h index 2a82056..565c414 100644 --- a/src/system/pci/pci.h +++ b/src/system/pci/pci.h @@ -1,4 +1,32 @@ #ifndef __PCI_H__ #define __PCI_H__ +#include +#include +#include + +typedef struct device_descriptor +{ + uint32_t portBase; + uint32_t interrupt; + + uint16_t bus; + uint16_t device; + uint16_t function; + + uint16_t vendor_id; + uint16_t device_id; + + uint8_t class_id; + uint8_t subclass_id; + uint8_t interface_id; + + uint8_t revision; +} device_descriptor; + +uint32_t read_pci(uint16_t bus, uint16_t device, uint16_t function, uint32_t regoffset); +void write_pci(uint16_t bus, uint16_t device, uint16_t function, uint32_t regoffset, uint32_t data); +void register_pci(); +device_descriptor get_device_descriptor(uint16_t bus, uint16_t device, uint16_t function); + #endif // __PCI_H__ \ No newline at end of file