ReactOS  0.4.15-dev-5142-g967f5b9
kdpci.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Hardware Abstraction Layer
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Kernel debugger PCI configurator
5  * COPYRIGHT: Copyright 2022 Dmitry Borisov <di.sean@protonmail.com>
6  */
7 
8 /*
9  * FIXME: We don't use a PCI resource allocator and rely on firmware to
10  * have configured PCI devices properly. The KD PCI configurator should
11  * allocate and assign PCI resources for all PCI buses
12  * before the debugging device can be enabled.
13  */
14 
15 /* INCLUDES *******************************************************************/
16 
17 #include <hal.h>
18 
19 /* GLOBALS ********************************************************************/
20 
21 #if defined(EARLY_DEBUG)
23 #else
24 #if defined(_MSC_VER)
25 #define DPRINT0 __noop
26 #else
27 #define DPRINT0
28 #endif
29 #endif
30 
32 
33 /* FUNCTIONS ******************************************************************/
34 
35 static
36 CODE_SEG("INIT")
37 ULONG
39  _In_ ULONG CurrentBar,
40  _In_ ULONG NextBar)
41 {
42  ULONG64 Bar;
43  ULONG Length;
44 
45  Bar = CurrentBar;
46 
47  if (CurrentBar & PCI_ADDRESS_IO_SPACE)
48  {
49  Length = 1 << 2;
50  }
51  else
52  {
53  if ((CurrentBar & PCI_ADDRESS_MEMORY_TYPE_MASK) == PCI_TYPE_64BIT)
54  {
55  Bar = ((ULONG64)NextBar << 32) | CurrentBar;
56  }
57 
58  Length = 1 << 4;
59  }
60 
61  while (!(Bar & Length) && Length)
62  {
63  Length <<= 1;
64  }
65 
66  return Length;
67 }
68 
69 static
70 CODE_SEG("INIT")
71 BOOLEAN
74  _In_ ULONG PciBus,
75  _In_ PCI_SLOT_NUMBER PciSlot,
76  _Inout_ PPCI_COMMON_HEADER PciConfig)
77 {
78  ULONG i, Register;
79 
80  Register = PciConfig->Command & ~(PCI_ENABLE_MEMORY_SPACE |
83  PciSlot,
84  &Register,
86  sizeof(USHORT));
87 
88  /* Fill out the device descriptor */
89  for (i = 0; i < MAXIMUM_DEBUG_BARS; ++i)
90  {
91  ULONG Length, NextBar;
93 
94  DeviceAddress = &PciDevice->BaseAddress[i];
95  DeviceAddress->Valid = FALSE;
96 
97  Register = 0xFFFFFFFF;
99  PciSlot,
100  &Register,
101  FIELD_OFFSET(PCI_COMMON_HEADER, u.type0.BaseAddresses[i]),
102  sizeof(ULONG));
104  PciSlot,
105  &Register,
106  FIELD_OFFSET(PCI_COMMON_HEADER, u.type0.BaseAddresses[i]),
107  sizeof(ULONG));
109  PciSlot,
110  &PciConfig->u.type0.BaseAddresses[i],
111  FIELD_OFFSET(PCI_COMMON_HEADER, u.type0.BaseAddresses[i]),
112  sizeof(ULONG));
113 
114  if (i < MAXIMUM_DEBUG_BARS - 1)
115  NextBar = PciConfig->u.type0.BaseAddresses[i + 1];
116  else
117  NextBar = 0;
118 
119  Length = HalpPciBarLength(Register, NextBar);
120  if (Register == 0 || Length == 0)
121  continue;
122 
123  /* I/O space */
124  if (Register & PCI_ADDRESS_IO_SPACE)
125  {
127  DeviceAddress->Length = Length;
128  DeviceAddress->Valid = TRUE;
129  DeviceAddress->TranslatedAddress =
130  UlongToPtr(PciConfig->u.type0.BaseAddresses[i] & PCI_ADDRESS_IO_ADDRESS_MASK);
131 
132  DPRINT0("BAR[%u] IO %lx, length 0x%lx, 0x%lx\n",
133  i,
134  DeviceAddress->TranslatedAddress,
135  Length,
136  Register);
137  }
138  else
139  {
141  BOOLEAN SkipBar = FALSE;
142 
144  DeviceAddress->Length = Length;
145  DeviceAddress->Valid = TRUE;
146 
147  /* 32-bit memory space */
150  PciConfig->u.type0.BaseAddresses[i] & PCI_ADDRESS_MEMORY_ADDRESS_MASK;
151 
152  /* 64-bit memory space */
153  if (((Register & PCI_ADDRESS_MEMORY_TYPE_MASK) == PCI_TYPE_64BIT))
154  {
155  PhysicalAddress.HighPart = NextBar;
156  SkipBar = TRUE;
157  }
158 
159  DPRINT0("BAR[%u] MEM %I64x, length 0x%lx, 0x%lx\n",
160  i,
162  Length,
163  Register);
164 
165  if (SkipBar)
166  {
167  ++i;
168  }
169 
170  DeviceAddress->TranslatedAddress =
172  }
173  }
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;
181 
182  /* Enable decodes */
183  PciConfig->Command |= (PCI_ENABLE_MEMORY_SPACE |
187  PciSlot,
188  &PciConfig->Command,
190  sizeof(USHORT));
191 
192  return TRUE;
193 }
194 
195 static
196 CODE_SEG("INIT")
197 BOOLEAN
199  _In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice,
200  _In_ ULONG PciBus,
201  _In_ PCI_SLOT_NUMBER PciSlot,
202  _In_ PPCI_COMMON_HEADER PciConfig)
203 {
204  /* Check if we weren't given a specific device location */
205  if (PciDevice->Bus == 0xFFFFFFFF && PciDevice->Slot == 0xFFFFFFFF)
206  {
207  if (PciDevice->DeviceID == 0xFFFF && PciDevice->VendorID == 0xFFFF)
208  {
209  if (PciDevice->BaseClass == PciConfig->BaseClass &&
210  PciDevice->SubClass == PciConfig->SubClass)
211  {
212  if (PciDevice->ProgIf == 0xFF ||
213  PciDevice->ProgIf == PciConfig->ProgIf)
214  {
215  return TRUE;
216  }
217  }
218  }
219  else if (PciDevice->DeviceID == PciConfig->DeviceID &&
220  PciDevice->VendorID == PciConfig->VendorID)
221  {
222  return TRUE;
223  }
224  }
225  else if (PciDevice->Bus == PciBus &&
226  PciDevice->Slot == PciSlot.u.AsULONG)
227  {
228  return TRUE;
229  }
230 
231  return FALSE;
232 }
233 
234 static
235 CODE_SEG("INIT")
236 BOOLEAN
238  _In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
239 {
240  ULONG BusNumber, DeviceNumber, FunctionNumber;
241 
242  for (BusNumber = 0; BusNumber < 0xFF; ++BusNumber)
243  {
245  {
246  for (FunctionNumber = 0; FunctionNumber < PCI_MAX_FUNCTION; ++FunctionNumber)
247  {
248  ULONG Bytes;
249  PCI_SLOT_NUMBER PciSlot;
250  PCI_COMMON_HEADER PciConfig;
251 
252  PciSlot.u.bits.DeviceNumber = DeviceNumber;
253  PciSlot.u.bits.FunctionNumber = FunctionNumber;
254  PciSlot.u.bits.Reserved = 0;
256  PciSlot,
257  &PciConfig,
258  0,
260  if (Bytes != PCI_COMMON_HDR_LENGTH ||
261  PciConfig.VendorID == PCI_INVALID_VENDORID ||
262  PciConfig.VendorID == 0)
263  {
264  if (FunctionNumber == 0)
265  {
266  /* This slot has no single- or a multi-function device */
267  break;
268  }
269  else
270  {
271  /* Continue scanning the functions */
272  continue;
273  }
274  }
275 
276  DPRINT0("Check %02x:%02x.%x [%04x:%04x]\n",
277  BusNumber, DeviceNumber, FunctionNumber,
278  PciConfig.VendorID, PciConfig.DeviceID);
279 
280  switch (PCI_CONFIGURATION_TYPE(&PciConfig))
281  {
282  case PCI_DEVICE_TYPE:
283  {
284  if (HalpMatchDebuggingDevice(PciDevice, BusNumber, PciSlot, &PciConfig))
285  {
286  DPRINT0("Found device\n");
287 
288  if (HalpConfigureDebuggingDevice(PciDevice,
289  BusNumber,
290  PciSlot,
291  &PciConfig))
292  {
293  DPRINT0("Device is ready\n");
294  return TRUE;
295  }
296  }
297  break;
298  }
299 
300  case PCI_BRIDGE_TYPE:
301  {
302  /* FIXME: Implement PCI resource allocator */
303  break;
304  }
305 
307  {
308  /* FIXME: Implement PCI resource allocator */
309  break;
310  }
311 
312  default:
313  break;
314  }
315 
316  if (!PCI_MULTIFUNCTION_DEVICE(&PciConfig))
317  {
318  /* The device is a single function device */
319  break;
320  }
321  }
322  }
323  }
324 
325  return FALSE;
326 }
327 
328 CODE_SEG("INIT")
329 VOID
330 NTAPI
332 {
333  ULONG i;
335  WCHAR StringBuffer[16];
337  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\"
338  L"CurrentControlSet\\Services\\PCI\\Debug");
340 
341  PAGED_CODE();
342 
343  for (i = 0; i < RTL_NUMBER_OF(HalpPciDebuggingDevice); ++i)
344  {
345  if (HalpPciDebuggingDevice[i].InUse)
346  {
348  break;
349  }
350  }
351  if (!HasDebuggingDevice)
352  {
353  /* Nothing to register */
354  return;
355  }
356 
358  if (!NT_SUCCESS(Status))
359  return;
360 
361  for (i = 0; i < RTL_NUMBER_OF(HalpPciDebuggingDevice); ++i)
362  {
363  ULONG Value;
364  PCI_SLOT_NUMBER PciSlot;
365 
366  if (!HalpPciDebuggingDevice[i].InUse)
367  continue;
368 
369  RtlInitEmptyUnicodeString(&KeyName, StringBuffer, sizeof(StringBuffer));
372  Handle,
373  &KeyName,
375  TRUE);
376  if (!NT_SUCCESS(Status))
377  continue;
378 
381  ZwSetValueKey(KeyHandle,
382  &KeyName,
383  0,
384  REG_DWORD,
385  &Value,
386  sizeof(Value));
387 
388  PciSlot.u.AsULONG = 0;
389  PciSlot.u.bits.DeviceNumber = HalpPciDebuggingDevice[i].DeviceNumber;
390  PciSlot.u.bits.FunctionNumber = HalpPciDebuggingDevice[i].FunctionNumber;
391  Value = PciSlot.u.AsULONG;
392  RtlInitUnicodeString(&KeyName, L"Slot");
393  ZwSetValueKey(KeyHandle,
394  &KeyName,
395  0,
396  REG_DWORD,
397  &Value,
398  sizeof(Value));
399 
401  }
402 
403  ZwClose(Handle);
404 }
405 
418 CODE_SEG("INIT")
419 NTSTATUS
420 NTAPI
423 {
424  ULONG i;
425 
426  DPRINT0("%s(%p) called\n", __FUNCTION__, PciDevice);
427 
428  for (i = 0; i < MAXIMUM_DEBUG_BARS; ++i)
429  {
430  PDEBUG_DEVICE_ADDRESS DeviceAddress = &PciDevice->BaseAddress[i];
431 
432  if (DeviceAddress->Type == CmResourceTypeMemory && DeviceAddress->Valid)
433  {
434  HalpUnmapVirtualAddress(DeviceAddress->TranslatedAddress,
435  BYTES_TO_PAGES(DeviceAddress->Length));
436 
437  DeviceAddress->Valid = FALSE;
438  }
439  }
440 
441  return STATUS_SUCCESS;
442 }
443 
480 CODE_SEG("INIT")
481 NTSTATUS
482 NTAPI
484  _In_opt_ PVOID LoaderBlock,
486 {
487  ULONG i;
488  ULONG64 MaxAddress;
489  PFN_NUMBER PageCount;
490  PCI_SLOT_NUMBER PciSlot;
492  PPCI_TYPE1_CFG_CYCLE_BITS DebuggingDevice;
493 
494 #if defined(EARLY_DEBUG)
495  if (LoaderBlock)
496  {
497  /* Define your own function or use the trick with FreeLoader */
498  DPRINT0 = ((PLOADER_PARAMETER_BLOCK)LoaderBlock)->u.I386.CommonDataArea;
499  }
500 #endif
501 
502  DPRINT0("%s(%p, %p) called\n", __FUNCTION__, LoaderBlock, PciDevice);
503 
504  if (!HalpFindMatchingDebuggingDevice(PciDevice))
505  {
506  DPRINT0("No device found matching given device descriptor!\n");
508  }
509 
510  if (PciDevice->Initialized)
511  return STATUS_SUCCESS;
512 
513  PciSlot.u.AsULONG = PciDevice->Slot;
514 
515  /* Check if the device is already present */
516  for (i = 0; i < RTL_NUMBER_OF(HalpPciDebuggingDevice); ++i)
517  {
518  DebuggingDevice = &HalpPciDebuggingDevice[i];
519 
520  if (DebuggingDevice->InUse &&
521  DebuggingDevice->DeviceNumber == PciSlot.u.bits.DeviceNumber &&
522  DebuggingDevice->FunctionNumber == PciSlot.u.bits.FunctionNumber &&
523  DebuggingDevice->BusNumber == PciDevice->Bus)
524  {
525  DPRINT0("Device %p(0x%lx) is already in use!\n", PciDevice, PciDevice->Slot);
526  return STATUS_UNSUCCESSFUL;
527  }
528  }
529 
530  /* Save the device location */
531  for (i = 0; i < RTL_NUMBER_OF(HalpPciDebuggingDevice); ++i)
532  {
533  DebuggingDevice = &HalpPciDebuggingDevice[i];
534 
535  if (!DebuggingDevice->InUse)
536  {
537  DebuggingDevice->DeviceNumber = PciSlot.u.bits.DeviceNumber;
538  DebuggingDevice->FunctionNumber = PciSlot.u.bits.FunctionNumber;
539  DebuggingDevice->BusNumber = PciDevice->Bus;
540  DebuggingDevice->InUse = TRUE;
541 
542  PciDevice->Initialized = TRUE;
543  break;
544  }
545  }
547  {
548  DPRINT0("Maximum device count reached!\n");
549  return STATUS_UNSUCCESSFUL;
550  }
551 
552  if (!PciDevice->Memory.Length)
553  return STATUS_SUCCESS;
554 
555  if (!LoaderBlock)
557 
558  if (!PciDevice->Memory.MaxEnd.QuadPart)
559  {
560  PciDevice->Memory.MaxEnd.QuadPart = (ULONG64)-1;
561  }
562  MaxAddress = min(PciDevice->Memory.MaxEnd.QuadPart, 0xFFFFFFFF);
563  PageCount = BYTES_TO_PAGES(PciDevice->Memory.Length);
564 
565  /* Allocate the device context */
567  MaxAddress,
568  PageCount,
569  FALSE);
570  PciDevice->Memory.Start = PhysicalAddress;
572  {
574  }
575  PciDevice->Memory.VirtualAddress = HalpMapPhysicalMemory64(PhysicalAddress, PageCount);
576 
577  return STATUS_SUCCESS;
578 }
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
Definition: glfuncs.h:240
#define STATUS_DEVICE_DOES_NOT_EXIST
Definition: ntstatus.h:428
#define PCI_ADDRESS_IO_ADDRESS_MASK
Definition: iotypes.h:4233
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define _In_opt_
Definition: ms_sal.h:309
#define _Inout_
Definition: ms_sal.h:378
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
#define PCI_ENABLE_IO_SPACE
Definition: iotypes.h:3616
#define TRUE
Definition: types.h:120
PCI_TYPE1_CFG_CYCLE_BITS HalpPciDebuggingDevice[2]
Definition: kdpci.c:31
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN PFN_COUNT PageCount)
Definition: memory.c:140
LONG NTSTATUS
Definition: precomp.h:26
_In_ UINT Bytes
Definition: mmcopy.h:9
#define PCI_ADDRESS_MEMORY_TYPE_MASK
Definition: iotypes.h:4231
struct _LOADER_PARAMETER_BLOCK * PLOADER_PARAMETER_BLOCK
Definition: shell.h:41
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define L(x)
Definition: ntvdm.h:50
ULONG PFN_NUMBER
Definition: ke.h:9
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
_In_ PUSB_DEVICE_HANDLE _Out_ PUSHORT DeviceAddress
Definition: hubbusif.h:359
#define PCI_ADDRESS_MEMORY_ADDRESS_MASK
Definition: iotypes.h:4234
NTSTATUS NTAPI HalpOpenRegistryKey(IN PHANDLE KeyHandle, IN HANDLE RootKey, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN BOOLEAN Create)
Definition: misc.c:104
void Bar(void)
Definition: terminate.cpp:70
union _PCI_SLOT_NUMBER::@3805 u
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
static BOOLEAN HalpMatchDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice, _In_ ULONG PciBus, _In_ PCI_SLOT_NUMBER PciSlot, _In_ PPCI_COMMON_HEADER PciConfig)
Definition: kdpci.c:198
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
* PDEBUG_DEVICE_ADDRESS
Definition: kdtypes.h:21
#define UlongToPtr(u)
Definition: config.h:106
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
struct _PCI_SLOT_NUMBER::@3805::@3806 bits
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
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.
Definition: kdpci.c:483
Status
Definition: gdiplustypes.h:24
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3601
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI HalpReleasePciDeviceForDebugging(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Releases the PCI device MMIO mappings previously allocated with HalpSetupPciDeviceForDebugging().
Definition: kdpci.c:421
#define PCI_ENABLE_BUS_MASTER
Definition: iotypes.h:3618
#define PCI_MAX_DEVICES
Definition: iotypes.h:3598
#define PCI_DEVICE_TYPE
Definition: iotypes.h:3605
#define MAXIMUM_DEBUG_BARS
Definition: kdtypes.h:53
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned __int64 ULONG64
Definition: imports.h:198
#define BYTES_TO_PAGES(Size)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
#define DPRINT0
Definition: kdpci.c:27
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:475
ULONG LowPart
Definition: typedefs.h:106
#define PCI_MULTIFUNCTION_DEVICE(PciData)
Definition: iotypes.h:3612
BOOLEAN HasDebuggingDevice
Definition: pci.c:32
static BOOLEAN HalpFindMatchingDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdpci.c:237
#define PCI_MAX_FUNCTION
Definition: iotypes.h:3599
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
Definition: glfuncs.h:248
#define PCI_TYPE_64BIT
Definition: iotypes.h:4239
static ULONG HalpPciBarLength(_In_ ULONG CurrentBar, _In_ ULONG NextBar)
Definition: kdpci.c:38
unsigned short USHORT
Definition: pedump.c:61
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
VOID NTAPI HalpUnmapVirtualAddress(IN PVOID VirtualAddress, IN PFN_COUNT PageCount)
Definition: memory.c:148
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define min(a, b)
Definition: monoChain.cc:55
#define _Printf_format_string_
Definition: ms_sal.h:561
#define PCI_ENABLE_MEMORY_SPACE
Definition: iotypes.h:3617
static BOOLEAN HalpConfigureDebuggingDevice(_In_ PDEBUG_DEVICE_DESCRIPTOR PciDevice, _In_ ULONG PciBus, _In_ PCI_SLOT_NUMBER PciSlot, _Inout_ PPCI_COMMON_HEADER PciConfig)
Definition: kdpci.c:72
_In_ HANDLE Handle
Definition: extypes.h:390
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3609
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
const char * PCSTR
Definition: typedefs.h:52
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG64 NTAPI HalpAllocPhysicalMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG64 MaxAddress, IN PFN_NUMBER PageCount, IN BOOLEAN Aligned)
Definition: memory.c:29
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1229
ULONG HalpPhase0GetPciDataByOffset(_In_ ULONG Bus, _In_ PCI_SLOT_NUMBER PciSlot, _Out_writes_bytes_all_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: pcibus.c:368
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
#define PCI_ADDRESS_IO_SPACE
Definition: iotypes.h:4230
#define __FUNCTION__
Definition: types.h:112
#define REG_DWORD
Definition: sdbapi.c:596
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
#define PCI_CARDBUS_BRIDGE_TYPE
Definition: iotypes.h:3607
LONGLONG QuadPart
Definition: typedefs.h:114
VOID NTAPI HalpRegisterPciDebuggingDeviceInfo(VOID)
Definition: kdpci.c:331
ULONG HalpPhase0SetPciDataByOffset(_In_ ULONG Bus, _In_ PCI_SLOT_NUMBER PciSlot, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: pcibus.c:437
#define PAGED_CODE()
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1216
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3594
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
#define PCI_BRIDGE_TYPE
Definition: iotypes.h:3606