37 lines
585 B
C
37 lines
585 B
C
#pragma once
|
|
|
|
#include <lcrash/types.h>
|
|
|
|
/**
|
|
* bwaaaaaa, the many ways to touch PCI things
|
|
*/
|
|
struct [[gnu::packed]] PciConfigurationSpaceHeader {
|
|
u16 VendorID;
|
|
u16 DeviceID;
|
|
u16 Status;
|
|
u16 Command;
|
|
u8 RevisionID : 8;
|
|
u32 ClassCode : 24;
|
|
u8 CacheLineSize;
|
|
u8 MasterLatencyTimer;
|
|
u8 HeaderType;
|
|
u8 BIST;
|
|
u8 Reserved[0x20];
|
|
u8 CapabilitiesPointer;
|
|
u8 Reserved2[7];
|
|
u8 InterruptLine;
|
|
u8 InterruptPin;
|
|
u8 Reserved3[2];
|
|
};
|
|
|
|
/**
|
|
* Initialize the PCI code.
|
|
*/
|
|
void PciInitialize();
|
|
|
|
/// PCI is usable
|
|
bool PciPresent();
|
|
|
|
/// PCIE is usable
|
|
bool PciePresent();
|