21#if defined(EARLY_DEBUG)
110 &PciConfig->u.type0.BaseAddresses[
i],
115 NextBar = PciConfig->u.type0.BaseAddresses[
i + 1];
132 DPRINT0(
"BAR[%u] IO %lx, length 0x%lx, 0x%lx\n",
159 DPRINT0(
"BAR[%u] MEM %I64x, length 0x%lx, 0x%lx\n",
174 PciDevice->Bus = PciBus;
175 PciDevice->Slot = PciSlot.u.AsULONG;
176 PciDevice->VendorID = PciConfig->VendorID;
177 PciDevice->DeviceID = PciConfig->DeviceID;
178 PciDevice->BaseClass = PciConfig->BaseClass;
179 PciDevice->SubClass = PciConfig->SubClass;
180 PciDevice->ProgIf = PciConfig->ProgIf;
205 if (PciDevice->Bus == 0xFFFFFFFF && PciDevice->Slot == 0xFFFFFFFF)
207 if (PciDevice->DeviceID == 0xFFFF && PciDevice->VendorID == 0xFFFF)
209 if (PciDevice->BaseClass == PciConfig->BaseClass &&
210 PciDevice->SubClass == PciConfig->SubClass)
212 if (PciDevice->ProgIf == 0xFF ||
213 PciDevice->ProgIf == PciConfig->ProgIf)
219 else if (PciDevice->DeviceID == PciConfig->DeviceID &&
220 PciDevice->VendorID == PciConfig->VendorID)
225 else if (PciDevice->Bus == PciBus &&
226 PciDevice->Slot == PciSlot.u.AsULONG)
246 for (FunctionNumber = 0; FunctionNumber <
PCI_MAX_FUNCTION; ++FunctionNumber)
253 PciSlot.
u.
bits.FunctionNumber = FunctionNumber;
254 PciSlot.
u.
bits.Reserved = 0;
262 PciConfig.VendorID == 0)
264 if (FunctionNumber == 0)
276 DPRINT0(
"Check %02x:%02x.%x [%04x:%04x]\n",
278 PciConfig.VendorID, PciConfig.DeviceID);
338 L"CurrentControlSet\\Services\\PCI\\Debug");
494#if defined(EARLY_DEBUG)
506 DPRINT0(
"No device found matching given device descriptor!\n");
510 if (PciDevice->Initialized)
513 PciSlot.
u.
AsULONG = PciDevice->Slot;
520 if (DebuggingDevice->
InUse &&
523 DebuggingDevice->
BusNumber == PciDevice->Bus)
525 DPRINT0(
"Device %p(0x%lx) is already in use!\n", PciDevice, PciDevice->Slot);
535 if (!DebuggingDevice->
InUse)
539 DebuggingDevice->
BusNumber = PciDevice->Bus;
542 PciDevice->Initialized =
TRUE;
548 DPRINT0(
"Maximum device count reached!\n");
552 if (!PciDevice->Memory.Length)
558 if (!PciDevice->Memory.MaxEnd.QuadPart)
560 PciDevice->Memory.MaxEnd.QuadPart = (
ULONG64)-1;
562 MaxAddress =
min(PciDevice->Memory.MaxEnd.QuadPart, 0xFFFFFFFF);
ULONG HalpPhase0SetPciDataByOffset(_In_ ULONG Bus, _In_ PCI_SLOT_NUMBER PciSlot, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
ULONG HalpPhase0GetPciDataByOffset(_In_ ULONG Bus, _In_ PCI_SLOT_NUMBER PciSlot, _Out_writes_bytes_all_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
_In_ PCHAR _In_ ULONG DeviceNumber
#define NT_SUCCESS(StatCode)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
VOID NTAPI HalpUnmapVirtualAddress(IN PVOID VirtualAddress, IN PFN_COUNT PageCount)
PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN PFN_COUNT PageCount)
ULONG64 NTAPI HalpAllocPhysicalMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG64 MaxAddress, IN PFN_NUMBER PageCount, IN BOOLEAN Aligned)
NTSTATUS NTAPI HalpOpenRegistryKey(IN PHANDLE KeyHandle, IN HANDLE RootKey, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN BOOLEAN Create)
_In_ PUSB_DEVICE_HANDLE _Out_ PUSHORT DeviceAddress
#define CmResourceTypeMemory
#define CmResourceTypePort
VOID NTAPI HalpRegisterPciDebuggingDeviceInfo(VOID)
NTSTATUS NTAPI HalpReleasePciDeviceForDebugging(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Releases the PCI device MMIO mappings previously allocated with HalpSetupPciDeviceForDebugging().
static BOOLEAN HalpFindMatchingDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
PCI_TYPE1_CFG_CYCLE_BITS HalpPciDebuggingDevice[2]
static BOOLEAN HalpConfigureDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice, _In_ ULONG PciBus, _In_ PCI_SLOT_NUMBER PciSlot, _Inout_ PPCI_COMMON_HEADER PciConfig)
static BOOLEAN HalpMatchDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice, _In_ ULONG PciBus, _In_ PCI_SLOT_NUMBER PciSlot, _In_ PPCI_COMMON_HEADER PciConfig)
static ULONG HalpPciBarLength(_In_ ULONG CurrentBar, _In_ ULONG NextBar)
NTSTATUS NTAPI HalpSetupPciDeviceForDebugging(_In_opt_ PVOID LoaderBlock, _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Finds and fully initializes the PCI device associated with the supplied debug device descriptor.
#define _Printf_format_string_
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_INVALID_PARAMETER_1
#define STATUS_DEVICE_DOES_NOT_EXIST
BOOLEAN HasDebuggingDevice
struct _LOADER_PARAMETER_BLOCK * PLOADER_PARAMETER_BLOCK
struct _PCI_SLOT_NUMBER::@4018::@4019 bits
union _PCI_SLOT_NUMBER::@4018 u
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
#define PCI_INVALID_VENDORID
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
#define PCI_ADDRESS_IO_ADDRESS_MASK
#define PCI_ENABLE_BUS_MASTER
#define PCI_ENABLE_IO_SPACE
#define PCI_ADDRESS_IO_SPACE
#define PCI_CONFIGURATION_TYPE(PciData)
#define PCI_ENABLE_MEMORY_SPACE
#define PCI_ADDRESS_MEMORY_ADDRESS_MASK
#define PCI_COMMON_HDR_LENGTH
#define PCI_ADDRESS_MEMORY_TYPE_MASK
#define PCI_MULTIFUNCTION_DEVICE(PciData)
#define PCI_CARDBUS_BRIDGE_TYPE
#define MAXIMUM_DEBUG_BARS
#define BYTES_TO_PAGES(Size)