Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Update pci.h
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinAlavik authored Feb 25, 2024
1 parent 4807157 commit 2b9e3e6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/system/pci/pci.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
#ifndef __PCI_H__
#define __PCI_H__

#include <stdlib.h>
#include <printf.h>
#include <stdint.h>

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__

0 comments on commit 2b9e3e6

Please sign in to comment.