This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4807157
commit 2b9e3e6
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__ |