ReactOS  0.4.14-dev-50-g13bb5e2
hardware.h File Reference

Go to the source code of this file.

Macros

#define CONFIG_CMD(bus, dev_fn, where)   (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))
 
#define TAG_HW_RESOURCE_LIST   'lRwH'
 
#define TAG_HW_DISK_CONTEXT   'cDwH'
 

Typedefs

typedef PCM_PARTIAL_RESOURCE_LIST(* GET_HARDDISK_CONFIG_DATA) (UCHAR DriveNumber, ULONG *pSize)
 
typedef BOOLEAN(* FIND_PCI_BIOS) (PPCI_REGISTRY_INFO BusData)
 
typedef ULONG(* GET_SERIAL_PORT) (ULONG Index, PULONG Irq)
 

Functions

VOID StallExecutionProcessor (ULONG Microseconds)
 
VOID HalpCalibrateStallExecution (VOID)
 
VOID DetectBiosDisks (PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey)
 
VOID DetectAcpiBios (PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 
VOID DetectApmBios (PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 
VOID DetectPciBios (PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 
ULONG_PTR __cdecl PnpBiosSupported (VOID)
 
ULONG __cdecl PnpBiosGetDeviceNodeCount (ULONG *NodeSize, ULONG *NodeCount)
 
ULONG __cdecl PnpBiosGetDeviceNode (UCHAR *NodeId, UCHAR *NodeBuffer)
 
USHORT __cdecl PxeCallApi (USHORT Segment, USHORT Offset, USHORT Service, VOID *Parameter)
 

Variables

GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
 
FIND_PCI_BIOS FindPciBios
 

Macro Definition Documentation

◆ CONFIG_CMD

#define CONFIG_CMD (   bus,
  dev_fn,
  where 
)    (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))

Definition at line 23 of file hardware.h.

◆ TAG_HW_DISK_CONTEXT

#define TAG_HW_DISK_CONTEXT   'cDwH'

Definition at line 27 of file hardware.h.

◆ TAG_HW_RESOURCE_LIST

#define TAG_HW_RESOURCE_LIST   'lRwH'

Definition at line 26 of file hardware.h.

Typedef Documentation

◆ FIND_PCI_BIOS

typedef BOOLEAN(* FIND_PCI_BIOS) (PPCI_REGISTRY_INFO BusData)

Definition at line 43 of file hardware.h.

◆ GET_HARDDISK_CONFIG_DATA

typedef PCM_PARTIAL_RESOURCE_LIST(* GET_HARDDISK_CONFIG_DATA) (UCHAR DriveNumber, ULONG *pSize)

Definition at line 37 of file hardware.h.

◆ GET_SERIAL_PORT

typedef ULONG(* GET_SERIAL_PORT) (ULONG Index, PULONG Irq)

Definition at line 49 of file hardware.h.

Function Documentation

◆ DetectAcpiBios()

VOID DetectAcpiBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 54 of file hwacpi.c.

55 {
57  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
58  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
59  PRSDP_DESCRIPTOR Rsdp;
60  PACPI_BIOS_DATA AcpiBiosData;
62 
63  Rsdp = FindAcpiBios();
64 
65  if (Rsdp)
66  {
67  /* Set up the flag in the loader block */
68  AcpiPresent = TRUE;
69 
70  /* Calculate the table size */
72  sizeof(ACPI_BIOS_DATA) - sizeof(BIOS_MEMORY_MAP);
73 
74  /* Set 'Configuration Data' value */
75  PartialResourceList =
78 
79  if (PartialResourceList == NULL)
80  {
81  ERR("Failed to allocate resource descriptor\n");
82  return;
83  }
84 
85  memset(PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize);
86  PartialResourceList->Version = 0;
87  PartialResourceList->Revision = 0;
88  PartialResourceList->Count = 1;
89 
90  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
91  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
92  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
93  PartialDescriptor->u.DeviceSpecificData.DataSize = TableSize;
94 
95  /* Fill the table */
96  AcpiBiosData = (PACPI_BIOS_DATA)&PartialResourceList->PartialDescriptors[1];
97 
98  if (Rsdp->revision > 0)
99  {
100  TRACE("ACPI >1.0, using XSDT address\n");
101  AcpiBiosData->RSDTAddress.QuadPart = Rsdp->xsdt_physical_address;
102  }
103  else
104  {
105  TRACE("ACPI 1.0, using RSDT address\n");
106  AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
107  }
108 
109  AcpiBiosData->Count = PcBiosMapCount;
110  memcpy(AcpiBiosData->MemoryMap, PcBiosMemoryMap,
111  PcBiosMapCount * sizeof(BIOS_MEMORY_MAP));
112 
113  TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address,
114  TableSize);
115 
116  /* Create new bus key */
117  FldrCreateComponentKey(SystemKey,
118  AdapterClass,
119  MultiFunctionAdapter,
120  0x0,
121  0x0,
122  0xFFFFFFFF,
123  "ACPI BIOS",
124  PartialResourceList,
126  &BiosKey);
127 
128  /* Increment bus number */
129  (*BusNumber)++;
130  }
131 }
UCHAR revision
Definition: winldr.h:25
PHYSICAL_ADDRESS RSDTAddress
Definition: pcbios.h:71
ULONGLONG xsdt_physical_address
Definition: winldr.h:28
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
BOOLEAN AcpiPresent
Definition: hwacpi.c:26
#define TRUE
Definition: types.h:120
GLint x0
Definition: linetemp.h:95
struct _ACPI_BIOS_DATA * PACPI_BIOS_DATA
ULONGLONG Count
Definition: pcbios.h:72
smooth NULL
Definition: ftsmooth.c:416
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371 u
#define TRACE(s)
Definition: solgame.cpp:4
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS]
Definition: pcmem.c:37
if(!(yy_init))
Definition: macro.lex.yy.c:714
static PRSDP_DESCRIPTOR FindAcpiBios(VOID)
Definition: hwacpi.c:29
BIOS_MEMORY_MAP MemoryMap[1]
Definition: pcbios.h:73
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@380 DeviceSpecificData
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
ULONG LowPart
Definition: typedefs.h:104
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
#define ERR(fmt,...)
Definition: debug.h:109
ULONG rsdt_physical_address
Definition: winldr.h:26
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:3971
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26
LONGLONG QuadPart
Definition: typedefs.h:112
ULONG PcBiosMapCount
Definition: pcmem.c:38

Referenced by PcHwDetect().

◆ DetectApmBios()

VOID DetectApmBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 57 of file hwapm.c.

58 {
60  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
61  ULONG Size;
62 
63  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
65 
66  if (FindApmBios())
67  {
68  /* Create 'Configuration Data' value */
69  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
70  memset(PartialResourceList, 0, Size);
71  PartialResourceList->Version = 0;
72  PartialResourceList->Revision = 0;
73  PartialResourceList->Count = 0;
74 
75  /* Create new bus key */
76  FldrCreateComponentKey(SystemKey,
78  MultiFunctionAdapter,
79  0x0,
80  0x0,
81  0xFFFFFFFF,
82  "APM",
83  PartialResourceList,
84  Size,
85  &BiosKey);
86 
87  /* Increment bus number */
88  (*BusNumber)++;
89  }
90 
91  /* FIXME: Add configuration data */
92 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
GLint x0
Definition: linetemp.h:95
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
unsigned int ULONG
Definition: retypes.h:1
static BOOLEAN FindApmBios(VOID)
Definition: hwapm.c:27
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26

Referenced by PcHwDetect().

◆ DetectBiosDisks()

VOID DetectBiosDisks ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
PCONFIGURATION_COMPONENT_DATA  BusKey 
)

Definition at line 339 of file hardware.c.

341 {
342  PCONFIGURATION_COMPONENT_DATA ControllerKey, DiskKey;
343  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
344  PCM_INT13_DRIVE_PARAMETER Int13Drives;
345  GEOMETRY Geometry;
346  UCHAR DiskCount, DriveNumber;
347  USHORT i;
348  ULONG Size;
349 
350  /* The pre-enumeration of the BIOS disks was already done in InitializeBootDevices() */
351  DiskCount = PcBiosDiskCount;
352 
353  /* Use the floppy disk controller as our controller */
354  ControllerKey = DetectBiosFloppyController(BusKey);
355  if (!ControllerKey)
356  {
357  ERR("Failed to detect BIOS disk controller\n");
358  return;
359  }
360 
361  /* Allocate resource descriptor */
362  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
363  sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
364  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
365  if (PartialResourceList == NULL)
366  {
367  ERR("Failed to allocate resource descriptor\n");
368  return;
369  }
370 
371  /* Initialize resource descriptor */
372  memset(PartialResourceList, 0, Size);
373  PartialResourceList->Version = 1;
374  PartialResourceList->Revision = 1;
375  PartialResourceList->Count = 1;
376  PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific;
377  PartialResourceList->PartialDescriptors[0].ShareDisposition = 0;
378  PartialResourceList->PartialDescriptors[0].Flags = 0;
379  PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
380  sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
381 
382  /* Get harddisk Int13 geometry data */
383  Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
384  for (i = 0; i < DiskCount; i++)
385  {
386  DriveNumber = 0x80 + i;
387 
388  if (MachDiskGetDriveGeometry(DriveNumber, &Geometry))
389  {
390  Int13Drives[i].DriveSelect = DriveNumber;
391  Int13Drives[i].MaxCylinders = Geometry.Cylinders - 1;
392  Int13Drives[i].SectorsPerTrack = (USHORT)Geometry.Sectors;
393  Int13Drives[i].MaxHeads = (USHORT)Geometry.Heads - 1;
394  Int13Drives[i].NumberDrives = DiskCount;
395 
396  TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
397  DriveNumber,
398  Geometry.Cylinders - 1,
399  Geometry.Heads - 1,
400  Geometry.Sectors,
401  Geometry.BytesPerSector);
402  }
403  }
404 
405  /* Update the 'System' key's configuration data with BIOS INT13h information */
406  FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
407 
408  /* Create and fill subkey for each harddisk */
409  for (i = 0; i < DiskCount; i++)
410  {
411  PCHAR Identifier;
412 
413  DriveNumber = 0x80 + i;
414 
415  /* Get disk values */
416  PartialResourceList = GetHarddiskConfigurationData(DriveNumber, &Size);
417  Identifier = GetHarddiskIdentifier(DriveNumber);
418 
419  /* Create disk key */
420  FldrCreateComponentKey(ControllerKey,
422  DiskPeripheral,
423  Output | Input,
424  0x0,
425  0xFFFFFFFF,
426  Identifier,
427  PartialResourceList,
428  Size,
429  &DiskKey);
430  }
431 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
signed char * PCHAR
Definition: retypes.h:7
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
struct _CM_INT13_DRIVE_PARAMETER CM_INT13_DRIVE_PARAMETER
GLint x0
Definition: linetemp.h:95
ULONG Cylinders
Definition: disk.h:26
Definition: arc.h:84
UCHAR PcBiosDiskCount
Definition: hwdisk.c:43
uint32_t ULONG_PTR
Definition: typedefs.h:63
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: hardware.c:40
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
smooth NULL
Definition: ftsmooth.c:416
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371 u
void * PVOID
Definition: retypes.h:9
#define MachDiskGetDriveGeometry(Drive, Geom)
Definition: machine.h:128
ULONG Sectors
Definition: disk.h:28
#define TRACE(s)
Definition: solgame.cpp:4
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
Definition: hwdisk.c:249
static PCONFIGURATION_COMPONENT_DATA DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hardware.c:266
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@380 DeviceSpecificData
unsigned char UCHAR
Definition: xmlstorage.h:181
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
Definition: arc.h:85
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
#define ERR(fmt,...)
Definition: debug.h:109
ULONG BytesPerSector
Definition: disk.h:29
unsigned short USHORT
Definition: pedump.c:61
Definition: disk.h:24
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
VOID NTAPI FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size)
Definition: archwsup.c:78
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26
ULONG Heads
Definition: disk.h:27

Referenced by DetectIsaBios().

◆ DetectPciBios()

VOID DetectPciBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 176 of file hwpci.c.

177 {
178  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
179  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
180  PCI_REGISTRY_INFO BusData;
182  ULONG Size;
184  ULONG i;
185 
186  /* Report the PCI BIOS */
187  if (FindPciBios(&BusData))
188  {
189  /* Set 'Configuration Data' value */
190  Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
191  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
192  if (PartialResourceList == NULL)
193  {
194  ERR("Failed to allocate resource descriptor\n");
195  return;
196  }
197 
198  /* Initialize resource descriptor */
199  memset(PartialResourceList, 0, Size);
200 
201  /* Create new bus key */
202  FldrCreateComponentKey(SystemKey,
203  AdapterClass,
204  MultiFunctionAdapter,
205  0x0,
206  0x0,
207  0xFFFFFFFF,
208  "PCI BIOS",
209  PartialResourceList,
210  Size,
211  &BiosKey);
212 
213  /* Increment bus number */
214  (*BusNumber)++;
215 
216  DetectPciIrqRoutingTable(BiosKey);
217 
218  /* Report PCI buses */
219  for (i = 0; i < (ULONG)BusData.NoBuses; i++)
220  {
221  /* Check if this is the first bus */
222  if (i == 0)
223  {
224  /* Set 'Configuration Data' value */
226  PartialDescriptors) +
228  sizeof(PCI_REGISTRY_INFO);
229  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
230  if (!PartialResourceList)
231  {
232  ERR("Failed to allocate resource descriptor\n");
233  return;
234  }
235 
236  /* Initialize resource descriptor */
237  memset(PartialResourceList, 0, Size);
238  PartialResourceList->Version = 1;
239  PartialResourceList->Revision = 1;
240  PartialResourceList->Count = 1;
241  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
242  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
243  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
244  PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(PCI_REGISTRY_INFO);
245  memcpy(&PartialResourceList->PartialDescriptors[1],
246  &BusData,
247  sizeof(PCI_REGISTRY_INFO));
248  }
249  else
250  {
251  /* Set 'Configuration Data' value */
253  PartialDescriptors);
254  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
255  if (!PartialResourceList)
256  {
257  ERR("Failed to allocate resource descriptor\n");
258  return;
259  }
260 
261  /* Initialize resource descriptor */
262  memset(PartialResourceList, 0, Size);
263  }
264 
265  /* Create the bus key */
266  FldrCreateComponentKey(SystemKey,
267  AdapterClass,
268  MultiFunctionAdapter,
269  0x0,
270  0x0,
271  0xFFFFFFFF,
272  "PCI",
273  PartialResourceList,
274  Size,
275  &BusKey);
276 
277  /* Increment bus number */
278  (*BusNumber)++;
279  }
280  }
281 }
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
GLint x0
Definition: linetemp.h:95
struct _PCI_REGISTRY_INFO PCI_REGISTRY_INFO
static VOID DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hwpci.c:117
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR
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
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
smooth NULL
Definition: ftsmooth.c:416
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371 u
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@380 DeviceSpecificData
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
#define ERR(fmt,...)
Definition: debug.h:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
UCHAR NoBuses
Definition: pci.h:109
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26

Referenced by PcHwDetect(), and XboxHwDetect().

◆ HalpCalibrateStallExecution()

VOID HalpCalibrateStallExecution ( VOID  )

Definition at line 100 of file hardware.c.

101 {
102  ULONG i;
103  ULONG calib_bit;
104  ULONG CurCount;
105 
106  /* Initialise timer interrupt with MILLISECOND ms interval */
107  WRITE_PORT_UCHAR((PUCHAR)0x43, 0x34); /* binary, mode 2, LSB/MSB, ch 0 */
108  WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH & 0xff); /* LSB */
109  WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH >> 8); /* MSB */
110 
111  /* Stage 1: Coarse calibration */
112 
113  delay_count = 1;
114 
115  do
116  {
117  /* Next delay count to try */
118  delay_count <<= 1;
119 
121 
122  /* Do the delay */
124 
125  CurCount = Read8254Timer();
126  }
127  while (CurCount > LATCH / 2);
128 
129  /* Get bottom value for delay */
130  delay_count >>= 1;
131 
132  /* Stage 2: Fine calibration */
133 
134  /* Which bit are we going to test */
135  calib_bit = delay_count;
136 
137  for (i = 0; i < PRECISION; i++)
138  {
139  /* Next bit to calibrate */
140  calib_bit >>= 1;
141 
142  /* If we have done all bits, stop */
143  if (!calib_bit) break;
144 
145  /* Set the bit in delay_count */
146  delay_count |= calib_bit;
147 
149 
150  /* Do the delay */
152 
153  CurCount = Read8254Timer();
154  /* If a tick has passed, turn the calibrated bit back off */
155  if (CurCount <= LATCH / 2)
156  delay_count &= ~calib_bit;
157  }
158 
159  /* We're finished: Do the finishing touches */
160 
161  /* Calculate delay_count for 1ms */
162  delay_count /= (MILLISEC / 2);
163 }
static VOID __StallExecutionProcessor(ULONG Loops)
Definition: hardware.c:49
unsigned char * PUCHAR
Definition: retypes.h:3
static VOID WaitFor8254Wraparound(VOID)
Definition: hardware.c:76
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 PRECISION
Definition: hardware.c:28
#define MILLISEC
Definition: hardware.c:27
static unsigned int delay_count
Definition: hardware.c:34
static ULONG Read8254Timer(VOID)
Definition: hardware.c:63
#define LATCH
Definition: hardware.c:32
unsigned int ULONG
Definition: retypes.h:1
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

◆ PnpBiosGetDeviceNode()

ULONG __cdecl PnpBiosGetDeviceNode ( UCHAR NodeId,
UCHAR NodeBuffer 
)

Referenced by DetectPnpBios().

◆ PnpBiosGetDeviceNodeCount()

ULONG __cdecl PnpBiosGetDeviceNodeCount ( ULONG NodeSize,
ULONG NodeCount 
)

Referenced by DetectPnpBios().

◆ PnpBiosSupported()

ULONG_PTR __cdecl PnpBiosSupported ( VOID  )

Referenced by DetectPnpBios().

◆ PxeCallApi()

USHORT __cdecl PxeCallApi ( USHORT  Segment,
USHORT  Offset,
USHORT  Service,
VOID Parameter 
)

◆ StallExecutionProcessor()

VOID StallExecutionProcessor ( ULONG  Microseconds)

Definition at line 55 of file hardware.c.

56 {
57  ULONGLONG LoopCount = ((ULONGLONG)delay_count * (ULONGLONG)Microseconds) / 1000ULL;
58  __StallExecutionProcessor((ULONG)LoopCount);
59 }
static VOID __StallExecutionProcessor(ULONG Loops)
Definition: hardware.c:49
#define ULL(a, b)
Definition: format_msg.c:27
uint64_t ULONGLONG
Definition: typedefs.h:65
static unsigned int delay_count
Definition: hardware.c:34
unsigned int ULONG
Definition: retypes.h:1

Variable Documentation

◆ FindPciBios

FIND_PCI_BIOS FindPciBios

Definition at line 26 of file hwpci.c.

Referenced by DetectPciBios(), PcHwDetect(), and XboxHwDetect().

◆ GetHarddiskConfigurationData

GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData

Definition at line 40 of file hardware.c.

Referenced by DetectBiosDisks(), PcHwDetect(), and XboxHwDetect().