ReactOS  0.4.13-dev-479-gec9c8fd
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)
 

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
 

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

◆ 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.

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  AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
98  AcpiBiosData->Count = PcBiosMapCount;
99  memcpy(AcpiBiosData->MemoryMap, PcBiosMemoryMap,
100  PcBiosMapCount * sizeof(BIOS_MEMORY_MAP));
101 
102  TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address,
103  TableSize);
104 
105  /* Create new bus key */
106  FldrCreateComponentKey(SystemKey,
107  AdapterClass,
108  MultiFunctionAdapter,
109  0x0,
110  0x0,
111  0xFFFFFFFF,
112  "ACPI BIOS",
113  PartialResourceList,
115  &BiosKey);
116 
117  /* Increment bus number */
118  (*BusNumber)++;
119  }
120 }
PHYSICAL_ADDRESS RSDTAddress
Definition: pcbios.h:63
#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
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369 u
ULONGLONG Count
Definition: pcbios.h:64
smooth NULL
Definition: ftsmooth.c:416
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369::@378 DeviceSpecificData
#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:40
static PRSDP_DESCRIPTOR FindAcpiBios(VOID)
Definition: hwacpi.c:29
BIOS_MEMORY_MAP MemoryMap[1]
Definition: pcbios.h:65
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:47
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:3970
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
ULONG PcBiosMapCount
Definition: pcmem.c:41

Referenced by PcHwDetect().

◆ DetectApmBios()

VOID DetectApmBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 58 of file hwapm.c.

59 {
61  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
62  ULONG Size;
63 
64  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
66 
67  if (FindApmBios())
68  {
69  /* Create 'Configuration Data' value */
70  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
71  memset(PartialResourceList, 0, Size);
72  PartialResourceList->Version = 0;
73  PartialResourceList->Revision = 0;
74  PartialResourceList->Count = 0;
75 
76  /* Create new bus key */
77  FldrCreateComponentKey(SystemKey,
79  MultiFunctionAdapter,
80  0x0,
81  0x0,
82  0xFFFFFFFF,
83  "APM",
84  PartialResourceList,
85  Size,
86  &BiosKey);
87 
88  /* Increment bus number */
89  (*BusNumber)++;
90  }
91 
92  /* FIXME: Add configuration data */
93 }
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:28
#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 353 of file hardware.c.

355 {
356  PCONFIGURATION_COMPONENT_DATA ControllerKey, DiskKey;
357  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
358  PCM_INT13_DRIVE_PARAMETER Int13Drives;
359  GEOMETRY Geometry;
360  UCHAR DiskCount, DriveNumber;
361  USHORT i;
362  ULONG Size;
363 
364  /* The pre-enumeration of the BIOS disks was already done in InitializeBootDevices() */
365  DiskCount = PcBiosDiskCount;
366 
367  /* Use the floppy disk controller as our controller */
368  ControllerKey = DetectBiosFloppyController(BusKey);
369  if (!ControllerKey)
370  {
371  ERR("Failed to detect BIOS disk controller\n");
372  return;
373  }
374 
375  /* Allocate resource descriptor */
376  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
377  sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
378  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
379  if (PartialResourceList == NULL)
380  {
381  ERR("Failed to allocate resource descriptor\n");
382  return;
383  }
384 
385  /* Initialize resource descriptor */
386  memset(PartialResourceList, 0, Size);
387  PartialResourceList->Version = 1;
388  PartialResourceList->Revision = 1;
389  PartialResourceList->Count = 1;
390  PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific;
391  PartialResourceList->PartialDescriptors[0].ShareDisposition = 0;
392  PartialResourceList->PartialDescriptors[0].Flags = 0;
393  PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
394  sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
395 
396  /* Get harddisk Int13 geometry data */
397  Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
398  for (i = 0; i < DiskCount; i++)
399  {
400  DriveNumber = 0x80 + i;
401 
402  if (MachDiskGetDriveGeometry(DriveNumber, &Geometry))
403  {
404  Int13Drives[i].DriveSelect = DriveNumber;
405  Int13Drives[i].MaxCylinders = Geometry.Cylinders - 1;
406  Int13Drives[i].SectorsPerTrack = (USHORT)Geometry.Sectors;
407  Int13Drives[i].MaxHeads = (USHORT)Geometry.Heads - 1;
408  Int13Drives[i].NumberDrives = DiskCount;
409 
410  TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
411  DriveNumber,
412  Geometry.Cylinders - 1,
413  Geometry.Heads - 1,
414  Geometry.Sectors,
415  Geometry.BytesPerSector);
416  }
417  }
418 
419  /* Update the 'System' key's configuration data with BIOS INT13h information */
420  FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
421 
422  /* Create and fill subkey for each harddisk */
423  for (i = 0; i < DiskCount; i++)
424  {
425  PCHAR Identifier;
426 
427  DriveNumber = 0x80 + i;
428 
429  /* Get disk values */
430  PartialResourceList = GetHarddiskConfigurationData(DriveNumber, &Size);
431  Identifier = GetHarddiskIdentifier(DriveNumber);
432 
433  /* Create disk key */
434  FldrCreateComponentKey(ControllerKey,
436  DiskPeripheral,
437  Output | Input,
438  0x0,
439  0xFFFFFFFF,
440  Identifier,
441  PartialResourceList,
442  Size,
443  &DiskKey);
444  }
445 }
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
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369 u
UCHAR PcBiosDiskCount
Definition: hwdisk.c:44
uint32_t ULONG_PTR
Definition: typedefs.h:63
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: hardware.c:42
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
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369::@378 DeviceSpecificData
void * PVOID
Definition: retypes.h:9
#define MachDiskGetDriveGeometry(Drive, Geom)
Definition: machine.h:122
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:203
static PCONFIGURATION_COMPONENT_DATA DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hardware.c:280
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 175 of file hwpci.c.

176 {
177  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
178  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
179  PCI_REGISTRY_INFO BusData;
181  ULONG Size;
183  ULONG i;
184 
185  /* Report the PCI BIOS */
186  if (FindPciBios(&BusData))
187  {
188  /* Set 'Configuration Data' value */
189  Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
190  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
191  if (PartialResourceList == NULL)
192  {
193  ERR("Failed to allocate resource descriptor\n");
194  return;
195  }
196 
197  /* Initialize resource descriptor */
198  memset(PartialResourceList, 0, Size);
199 
200  /* Create new bus key */
201  FldrCreateComponentKey(SystemKey,
202  AdapterClass,
203  MultiFunctionAdapter,
204  0x0,
205  0x0,
206  0xFFFFFFFF,
207  "PCI BIOS",
208  PartialResourceList,
209  Size,
210  &BiosKey);
211 
212  /* Increment bus number */
213  (*BusNumber)++;
214 
215  DetectPciIrqRoutingTable(BiosKey);
216 
217  /* Report PCI buses */
218  for (i = 0; i < (ULONG)BusData.NoBuses; i++)
219  {
220  /* Check if this is the first bus */
221  if (i == 0)
222  {
223  /* Set 'Configuration Data' value */
225  PartialDescriptors) +
227  sizeof(PCI_REGISTRY_INFO);
228  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
229  if (!PartialResourceList)
230  {
231  ERR("Failed to allocate resource descriptor\n");
232  return;
233  }
234 
235  /* Initialize resource descriptor */
236  memset(PartialResourceList, 0, Size);
237  PartialResourceList->Version = 1;
238  PartialResourceList->Revision = 1;
239  PartialResourceList->Count = 1;
240  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
241  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
242  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
243  PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(PCI_REGISTRY_INFO);
244  memcpy(&PartialResourceList->PartialDescriptors[1],
245  &BusData,
246  sizeof(PCI_REGISTRY_INFO));
247  }
248  else
249  {
250  /* Set 'Configuration Data' value */
252  PartialDescriptors);
253  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
254  if (!PartialResourceList)
255  {
256  ERR("Failed to allocate resource descriptor\n");
257  return;
258  }
259 
260  /* Initialize resource descriptor */
261  memset(PartialResourceList, 0, Size);
262  }
263 
264  /* Create the bus key */
265  FldrCreateComponentKey(SystemKey,
266  AdapterClass,
267  MultiFunctionAdapter,
268  0x0,
269  0x0,
270  0xFFFFFFFF,
271  "PCI",
272  PartialResourceList,
273  Size,
274  &BusKey);
275 
276  /* Increment bus number */
277  (*BusNumber)++;
278  }
279  }
280 }
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
GLint x0
Definition: linetemp.h:95
struct _PCI_REGISTRY_INFO PCI_REGISTRY_INFO
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369 u
static VOID DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hwpci.c:116
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
smooth NULL
Definition: ftsmooth.c:416
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369::@378 DeviceSpecificData
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
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
static BOOLEAN FindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:79
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().

◆ HalpCalibrateStallExecution()

VOID HalpCalibrateStallExecution ( VOID  )

Definition at line 102 of file hardware.c.

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

◆ 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 57 of file hardware.c.

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

Variable Documentation

◆ GetHarddiskConfigurationData

GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData

Definition at line 42 of file hardware.c.

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