HyperDbg Debugger
Loading...
Searching...
No Matches
Pcie.h
Go to the documentation of this file.
1
12#pragma once
13#pragma pack(1)
14
16// Headers //
18
19//
20// TODO
21// - Add support for domains beyond 0000
22// - Add ECAM support
23//
24// PCIe Base Specification, Rev. 4.0, Version 1.0, Table 7-59: Link Address for Link Type 1
25// Bus: 0-255 (8 bit)
26// Device: 0-31 (5 bit)
27// Function: 0-7 (3 bit)
28//
29#define BUS_BIT_WIDTH 8
30#define DEVICE_BIT_WIDTH 5
31#define FUNCTION_BIT_WIDTH 3
32
33//
34// NOTE
35// On real-world systems, the number of endpoints will likely not exceed 255.
36// If increasing DEV_MAX_NUM is necessary, ensure PCI_DEV_MINIMAL[DEV_MAX_NUM] does not result in exceeding MaxSerialPacketSize.
37//
38#define DOMAIN_MAX_NUM 0
39#define BUS_MAX_NUM 255
40#define DEVICE_MAX_NUM 32
41#define FUNCTION_MAX_NUM 8
42#define DEV_MAX_NUM 255
43#define CAM_CONFIG_SPACE_LENGTH 255
44
62
113
127
139
151
161
175
176#pragma pack()
int BOOL
Definition BasicTypes.h:25
unsigned short UINT16
Definition BasicTypes.h:53
unsigned char BYTE
Definition BasicTypes.h:40
unsigned char UINT8
Definition BasicTypes.h:52
unsigned int UINT32
Definition BasicTypes.h:54
struct _PCI_DEV_MMIOBAR_INFO PCI_DEV_MMIOBAR_INFO
PCI Device MMIO BAR Metadata.
struct _PCI_DEV * PPCI_DEV
struct _PCI_DEV_MINIMAL PCI_DEV_MINIMAL
PCI Device Minimal Data Structure for !pcitree.
struct _PCI_DEV_MINIMAL * PPCI_DEV_MINIMAL
struct _PORTABLE_PCI_COMMON_HEADER PORTABLE_PCI_COMMON_HEADER
PCI Common Header.
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL * PPORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER * PPORTABLE_PCI_CONFIG_SPACE_HEADER
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER PORTABLE_PCI_CONFIG_SPACE_HEADER
PCI Configuration Space Header.
union _PORTABLE_PCI_DEVICE_HEADER PORTABLE_PCI_DEVICE_HEADER
PCI Device Header.
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL
PCI Configuration Space Minimal Header for !pcitree.
struct _PCI_DEV_MMIOBAR_INFO * PPCI_DEV_MMIOBAR_INFO
struct _PORTABLE_PCI_COMMON_HEADER * PPORTABLE_PCI_COMMON_HEADER
union _PORTABLE_PCI_DEVICE_HEADER * PPORTABLE_PCI_DEVICE_HEADER
struct _PCI_DEV PCI_DEV
PCI Device Data Structure.
#define BUS_BIT_WIDTH
Definition Pcie.h:29
struct _PCI_DEV_MMIOBAR_INFO PCI_DEV_MMIOBAR_INFO
PCI Device MMIO BAR Metadata.
#define DEVICE_BIT_WIDTH
Definition Pcie.h:30
struct _PORTABLE_PCI_COMMON_HEADER PORTABLE_PCI_COMMON_HEADER
PCI Common Header.
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER PORTABLE_PCI_CONFIG_SPACE_HEADER
PCI Configuration Space Header.
union _PORTABLE_PCI_DEVICE_HEADER PORTABLE_PCI_DEVICE_HEADER
PCI Device Header.
struct _PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL
PCI Configuration Space Minimal Header for !pcitree.
#define FUNCTION_BIT_WIDTH
Definition Pcie.h:31
#define CAM_CONFIG_SPACE_LENGTH
Definition Pcie.h:43
PCI Device Minimal Data Structure for !pcitree.
Definition Pcie.h:133
PORTABLE_PCI_CONFIG_SPACE_HEADER_MINIMAL ConfigSpace
Definition Pcie.h:137
UINT8 Bus
Definition Pcie.h:134
UINT8 Function
Definition Pcie.h:136
UINT8 Device
Definition Pcie.h:135
PCI Device MMIO BAR Metadata.
Definition Pcie.h:145
BOOL IsEnabled
Definition Pcie.h:147
BOOL Is64Bit
Definition Pcie.h:146
UINT64 BarSize
Definition Pcie.h:149
UINT64 BarOffsetEnd
Definition Pcie.h:148
PCI Device Data Structure.
Definition Pcie.h:167
UINT8 Device
Definition Pcie.h:169
BYTE ConfigSpaceAdditional[CAM_CONFIG_SPACE_LENGTH - sizeof(PORTABLE_PCI_CONFIG_SPACE_HEADER)]
Definition Pcie.h:172
UINT8 Bus
Definition Pcie.h:168
UINT8 Function
Definition Pcie.h:170
PCI_DEV_MMIOBAR_INFO MmioBarInfo[6]
Definition Pcie.h:173
PORTABLE_PCI_CONFIG_SPACE_HEADER ConfigSpace
Definition Pcie.h:171
PCI Common Header.
Definition Pcie.h:50
UINT8 Bist
Definition Pcie.h:60
UINT8 ClassCode[3]
Definition Pcie.h:56
UINT8 RevisionId
Definition Pcie.h:55
UINT16 Command
Definition Pcie.h:53
UINT8 CacheLineSize
Definition Pcie.h:57
UINT16 VendorId
Definition Pcie.h:51
UINT16 DeviceId
Definition Pcie.h:52
UINT8 HeaderType
Definition Pcie.h:59
UINT16 Status
Definition Pcie.h:54
UINT8 PrimaryLatencyTimer
Definition Pcie.h:58
PCI Configuration Space Minimal Header for !pcitree.
Definition Pcie.h:119
UINT8 ClassCode[3]
Definition Pcie.h:125
UINT16 VendorId
Definition Pcie.h:123
UINT16 DeviceId
Definition Pcie.h:124
PCI Configuration Space Header.
Definition Pcie.h:157
PORTABLE_PCI_COMMON_HEADER CommonHeader
Definition Pcie.h:158
PORTABLE_PCI_DEVICE_HEADER DeviceHeader
Definition Pcie.h:159
PCI Device Header.
Definition Pcie.h:68
struct _PORTABLE_PCI_DEVICE_HEADER::_PORTABLE_PCI_EP_HEADER ConfigSpaceEp
struct _PORTABLE_PCI_DEVICE_HEADER::_PORTABLE_PCI_BRIDGE_HEADER ConfigSpacePtpBridge