ReactOS 0.4.16-dev-2293-g4d8327b
hardware.h File Reference

Go to the source code of this file.

Classes

struct  _PCI_TYPE1_CFG_BITS
 

Macros

#define TAG_HW_RESOURCE_LIST   'lRwH'
 
#define TAG_HW_DISK_CONTEXT   'cDwH'
 
#define READ_PORT_BUFFER_UCHAR(port, buffer, count)   __inbytestring(H2I(port), buffer, count)
 
#define READ_PORT_BUFFER_USHORT(port, buffer, count)   __inwordstring(H2I(port), buffer, count)
 
#define READ_PORT_BUFFER_ULONG(port, buffer, count)   __indwordstring(H2I(port), buffer, count)
 
#define WRITE_PORT_BUFFER_UCHAR(port, buffer, count)   __outbytestring(H2I(port), buffer, count)
 
#define WRITE_PORT_BUFFER_USHORT(port, buffer, count)   __outwordstring(H2I(port), buffer, count)
 
#define WRITE_PORT_BUFFER_ULONG(port, buffer, count)   __outdwordstring(H2I(port), buffer, count)
 
#define PCI_TYPE1_ADDRESS_PORT   (PULONG)0xCF8
 
#define PCI_TYPE1_DATA_PORT   0xCFC
 

Typedefs

typedef struct _PCI_TYPE1_CFG_BITS PCI_TYPE1_CFG_BITS
 
typedef struct _PCI_TYPE1_CFG_BITSPPCI_TYPE1_CFG_BITS
 
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)
 
ULONG __cdecl PnpBiosGetDockStationInformation (UCHAR *DockingStationInfo)
 
USHORT __cdecl PxeCallApi (USHORT Segment, USHORT Offset, USHORT Service, VOID *Parameter)
 

Variables

GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
 
FIND_PCI_BIOS FindPciBios
 

Macro Definition Documentation

◆ PCI_TYPE1_ADDRESS_PORT

#define PCI_TYPE1_ADDRESS_PORT   (PULONG)0xCF8

Definition at line 44 of file hardware.h.

◆ PCI_TYPE1_DATA_PORT

#define PCI_TYPE1_DATA_PORT   0xCFC

Definition at line 45 of file hardware.h.

◆ READ_PORT_BUFFER_UCHAR

#define READ_PORT_BUFFER_UCHAR (   port,
  buffer,
  count 
)    __inbytestring(H2I(port), buffer, count)

Definition at line 30 of file hardware.h.

◆ READ_PORT_BUFFER_ULONG

#define READ_PORT_BUFFER_ULONG (   port,
  buffer,
  count 
)    __indwordstring(H2I(port), buffer, count)

Definition at line 32 of file hardware.h.

◆ READ_PORT_BUFFER_USHORT

#define READ_PORT_BUFFER_USHORT (   port,
  buffer,
  count 
)    __inwordstring(H2I(port), buffer, count)

Definition at line 31 of file hardware.h.

◆ TAG_HW_DISK_CONTEXT

#define TAG_HW_DISK_CONTEXT   'cDwH'

Definition at line 24 of file hardware.h.

◆ TAG_HW_RESOURCE_LIST

#define TAG_HW_RESOURCE_LIST   'lRwH'

Definition at line 23 of file hardware.h.

◆ WRITE_PORT_BUFFER_UCHAR

#define WRITE_PORT_BUFFER_UCHAR (   port,
  buffer,
  count 
)    __outbytestring(H2I(port), buffer, count)

Definition at line 33 of file hardware.h.

◆ WRITE_PORT_BUFFER_ULONG

#define WRITE_PORT_BUFFER_ULONG (   port,
  buffer,
  count 
)    __outdwordstring(H2I(port), buffer, count)

Definition at line 35 of file hardware.h.

◆ WRITE_PORT_BUFFER_USHORT

#define WRITE_PORT_BUFFER_USHORT (   port,
  buffer,
  count 
)    __outwordstring(H2I(port), buffer, count)

Definition at line 34 of file hardware.h.

Typedef Documentation

◆ FIND_PCI_BIOS

typedef BOOLEAN(* FIND_PCI_BIOS) (PPCI_REGISTRY_INFO BusData)

Definition at line 73 of file hardware.h.

◆ GET_HARDDISK_CONFIG_DATA

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

Definition at line 67 of file hardware.h.

◆ GET_SERIAL_PORT

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

Definition at line 79 of file hardware.h.

◆ PCI_TYPE1_CFG_BITS

◆ PPCI_TYPE1_CFG_BITS

Function Documentation

◆ DetectAcpiBios()

VOID DetectAcpiBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 59 of file hwacpi.c.

60{
62 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
63 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
65 PACPI_BIOS_DATA AcpiBiosData;
67
68 Rsdp = FindAcpiBios();
69
70 if (Rsdp)
71 {
72 /* Set up the flag in the loader block */
74
75 /* Calculate the table size */
77 sizeof(ACPI_BIOS_DATA) - sizeof(BIOS_MEMORY_MAP);
78
79 /* Set 'Configuration Data' value */
80 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[1]) + TableSize;
81 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
82 if (PartialResourceList == NULL)
83 {
84 ERR("Failed to allocate resource descriptor\n");
85 return;
86 }
87
88 RtlZeroMemory(PartialResourceList, Size);
89 PartialResourceList->Version = 0;
90 PartialResourceList->Revision = 0;
91 PartialResourceList->Count = 1;
92
93 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
94 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
96 PartialDescriptor->u.DeviceSpecificData.DataSize = TableSize;
97
98 /* Fill the table */
99 AcpiBiosData = (PACPI_BIOS_DATA)(PartialDescriptor + 1);
100
101 if (Rsdp->revision > 0)
102 {
103 TRACE("ACPI >1.0, using XSDT address\n");
104 AcpiBiosData->RSDTAddress.QuadPart = Rsdp->xsdt_physical_address;
105 }
106 else
107 {
108 TRACE("ACPI 1.0, using RSDT address\n");
109 AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
110 }
111
112 AcpiBiosData->Count = PcBiosMapCount;
115
116 TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address,
117 TableSize);
118
119 /* Create new bus key */
120 FldrCreateComponentKey(SystemKey,
123 0,
124 0,
125 0xFFFFFFFF,
126 "ACPI BIOS",
127 PartialResourceList,
128 Size,
129 &BiosKey);
130
131 /* Increment bus number */
132 (*BusNumber)++;
133 }
134}
VOID 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_ PCSTR IdentifierString, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size, _Out_ PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:198
#define ERR(fmt,...)
Definition: precomp.h:57
BOOLEAN AcpiPresent
Definition: hwacpi.c:26
static PRSDP_DESCRIPTOR FindAcpiBios(VOID)
Definition: hwacpi.c:34
PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: heap.c:533
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
struct _ACPI_BIOS_DATA * PACPI_BIOS_DATA
ULONG PcBiosMapCount
Definition: pcmem.c:38
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS]
Definition: pcmem.c:37
#define CmResourceTypeDeviceSpecific
Definition: restypes.h:108
@ AdapterClass
Definition: arc.h:102
@ MultiFunctionAdapter
Definition: arc.h:125
#define TRACE(s)
Definition: solgame.cpp:4
ULONG rsdt_physical_address
Definition: winldr.h:26
UCHAR revision
Definition: winldr.h:25
ULONGLONG xsdt_physical_address
Definition: winldr.h:28
PHYSICAL_ADDRESS RSDTAddress
Definition: pcbios.h:77
BIOS_MEMORY_MAP MemoryMap[1]
Definition: pcbios.h:79
ULONGLONG Count
Definition: pcbios.h:78
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@391 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382 u
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: restypes.h:100
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define TAG_HW_RESOURCE_LIST
Definition: uefidisk.c:15
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:4330

Referenced by Pc98HwDetect(), PcHwDetect(), and UefiHwDetect().

◆ DetectApmBios()

VOID DetectApmBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 46 of file hwapm.c.

47{
49 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
50 ULONG Size;
51
52 if (!FindApmBios())
53 return;
54
55 /* Set 'Configuration Data' value */
56 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
57 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
58 if (PartialResourceList == NULL)
59 {
60 ERR("Failed to allocate resource descriptor\n");
61 return;
62 }
63 RtlZeroMemory(PartialResourceList, Size);
64 PartialResourceList->Version = 0;
65 PartialResourceList->Revision = 0;
66 PartialResourceList->Count = 0;
67
68 /* FIXME: Add configuration data */
69
70 /* Create new bus key */
71 FldrCreateComponentKey(SystemKey,
74 0,
75 0,
76 0xFFFFFFFF,
77 "APM",
78 PartialResourceList,
79 Size,
80 &BiosKey);
81
82 /* Increment bus number */
83 (*BusNumber)++;
84}
static BOOLEAN FindApmBios(VOID)
Definition: hwapm.c:14

Referenced by Pc98HwDetect(), and PcHwDetect().

◆ DetectBiosDisks()

VOID DetectBiosDisks ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
PCONFIGURATION_COMPONENT_DATA  BusKey 
)

Definition at line 342 of file pchw.c.

344{
345 PCONFIGURATION_COMPONENT_DATA ControllerKey, DiskKey;
346 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
347 PCM_INT13_DRIVE_PARAMETER Int13Drives;
348 GEOMETRY Geometry;
349 UCHAR DiskCount, DriveNumber;
350 USHORT i;
351 ULONG Size;
352
353 /* The pre-enumeration of the BIOS disks was already done in InitializeBootDevices() */
354 DiskCount = PcBiosDiskCount;
355
356 /* Use the floppy disk controller as our controller */
357 ControllerKey = DetectBiosFloppyController(BusKey);
358 if (!ControllerKey)
359 {
360 ERR("Failed to detect BIOS disk controller\n");
361 return;
362 }
363
364 /* Allocate resource descriptor */
365 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[1]) +
366 sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
367 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
368 if (PartialResourceList == NULL)
369 {
370 ERR("Failed to allocate resource descriptor\n");
371 return;
372 }
373
374 /* Initialize resource descriptor */
375 RtlZeroMemory(PartialResourceList, Size);
376 PartialResourceList->Version = 1;
377 PartialResourceList->Revision = 1;
378 PartialResourceList->Count = 1;
379 PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific;
380 PartialResourceList->PartialDescriptors[0].ShareDisposition = 0;
381 PartialResourceList->PartialDescriptors[0].Flags = 0;
382 PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
383 sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
384
385 /* Get harddisk Int13 geometry data */
386 Int13Drives = (PCM_INT13_DRIVE_PARAMETER)&PartialResourceList->PartialDescriptors[1];
387 for (i = 0; i < DiskCount; i++)
388 {
389 DriveNumber = 0x80 + i;
390
391 if (MachDiskGetDriveGeometry(DriveNumber, &Geometry))
392 {
393 Int13Drives[i].DriveSelect = DriveNumber;
394 Int13Drives[i].MaxCylinders = Geometry.Cylinders - 1;
395 Int13Drives[i].SectorsPerTrack = (USHORT)Geometry.SectorsPerTrack;
396 Int13Drives[i].MaxHeads = (USHORT)Geometry.Heads - 1;
397 Int13Drives[i].NumberDrives = DiskCount;
398
399 TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
400 DriveNumber,
401 Geometry.Cylinders - 1,
402 Geometry.Heads - 1,
403 Geometry.SectorsPerTrack,
404 Geometry.BytesPerSector);
405 }
406 }
407
408 /* Update the 'System' key's configuration data with BIOS INT13h information */
409 FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
410
411 /* Create and fill subkey for each harddisk */
412 for (i = 0; i < DiskCount; i++)
413 {
415
416 DriveNumber = 0x80 + i;
417
418 /* Get disk values */
419 PartialResourceList = GetHarddiskConfigurationData(DriveNumber, &Size);
420 Identifier = GetHarddiskIdentifier(DriveNumber);
421
422 /* Create disk key */
423 FldrCreateComponentKey(ControllerKey,
426 Output | Input,
427 i,
428 0xFFFFFFFF,
430 PartialResourceList,
431 Size,
432 &DiskKey);
433 }
434}
VOID FldrSetConfigurationData(_Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size)
Definition: archwsup.c:124
@ Identifier
Definition: asmpp.cpp:95
#define MachDiskGetDriveGeometry(Drive, Geom)
Definition: machine.h:122
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 for
Definition: utility.h:88
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pchw.c:45
static PCONFIGURATION_COMPONENT_DATA DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: pchw.c:271
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
Definition: hwdisk.c:254
UCHAR PcBiosDiskCount
Definition: hwdisk.c:47
unsigned short USHORT
Definition: pedump.c:61
@ PeripheralClass
Definition: arc.h:104
@ DiskPeripheral
Definition: arc.h:138
@ Input
Definition: arc.h:93
@ Output
Definition: arc.h:94
Definition: disk.h:26
ULONG BytesPerSector
Number of bytes per sector.
Definition: disk.h:30
ULONG Cylinders
Number of cylinders on the disk.
Definition: disk.h:27
ULONG SectorsPerTrack
Number of sectors per track.
Definition: disk.h:29
ULONG Heads
Number of heads on the disk.
Definition: disk.h:28
const char * PCSTR
Definition: typedefs.h:52
struct _CM_INT13_DRIVE_PARAMETER * PCM_INT13_DRIVE_PARAMETER
struct _CM_INT13_DRIVE_PARAMETER CM_INT13_DRIVE_PARAMETER
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by DetectCBusBios(), and DetectIsaBios().

◆ DetectPciBios()

VOID DetectPciBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)

Definition at line 174 of file hwpci.c.

175{
176 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
177 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
178 PCI_REGISTRY_INFO BusData;
181 ULONG Size;
182 ULONG i;
183
184 /* Report the PCI BIOS */
185 if (FindPciBios(&BusData))
186 {
187 /* Set 'Configuration Data' value */
188 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
189 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
190 if (PartialResourceList == NULL)
191 {
192 ERR("Failed to allocate resource descriptor\n");
193 return;
194 }
195
196 /* Initialize resource descriptor */
197 RtlZeroMemory(PartialResourceList, Size);
198
199 /* Create new bus key */
200 FldrCreateComponentKey(SystemKey,
203 0,
204 0,
205 0xFFFFFFFF,
206 "PCI BIOS",
207 PartialResourceList,
208 Size,
209 &BiosKey);
210
211 /* Increment bus number */
212 (*BusNumber)++;
213
215
216 /* Report PCI buses */
217 for (i = 0; i < (ULONG)BusData.NoBuses; i++)
218 {
219 /* Check if this is the first bus */
220 if (i == 0)
221 {
222 /* Set 'Configuration Data' value */
223 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[1]) +
224 sizeof(BusData);
225 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
226 if (!PartialResourceList)
227 {
228 ERR("Failed to allocate resource descriptor! Ignoring remaining PCI buses. (i = %lu, NoBuses = %lu)\n",
229 i, (ULONG)BusData.NoBuses);
230 return;
231 }
232
233 /* Initialize resource descriptor */
234 RtlZeroMemory(PartialResourceList, Size);
235 PartialResourceList->Version = 1;
236 PartialResourceList->Revision = 1;
237 PartialResourceList->Count = 1;
238
239 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
240 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
242 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(BusData);
243
244 RtlCopyMemory(&PartialResourceList->PartialDescriptors[1],
245 &BusData, sizeof(BusData));
246 }
247 else
248 {
249 /* Set 'Configuration Data' value */
250 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
251 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
252 if (!PartialResourceList)
253 {
254 ERR("Failed to allocate resource descriptor! Ignoring remaining PCI buses. (i = %lu, NoBuses = %lu)\n",
255 i, (ULONG)BusData.NoBuses);
256 return;
257 }
258
259 /* Initialize resource descriptor */
260 RtlZeroMemory(PartialResourceList, Size);
261 }
262
263 /* Create the bus key */
264 FldrCreateComponentKey(SystemKey,
267 0,
268 0,
269 0xFFFFFFFF,
270 "PCI",
271 PartialResourceList,
272 Size,
273 &BusKey);
274
275 /* Increment bus number */
276 (*BusNumber)++;
277 }
278 }
279}
static VOID DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hwpci.c:117
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
UCHAR NoBuses
Definition: pci.h:109

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

◆ HalpCalibrateStallExecution()

VOID HalpCalibrateStallExecution ( VOID  )

Definition at line 105 of file pchw.c.

106{
107 ULONG i;
108 ULONG calib_bit;
109 ULONG CurCount;
110
111 /* Initialise timer interrupt with MILLISECOND ms interval */
112 WRITE_PORT_UCHAR((PUCHAR)0x43, 0x34); /* binary, mode 2, LSB/MSB, ch 0 */
113 WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH & 0xff); /* LSB */
114 WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH >> 8); /* MSB */
115
116 /* Stage 1: Coarse calibration */
117
118 delay_count = 1;
119
120 do
121 {
122 /* Next delay count to try */
123 delay_count <<= 1;
124
126
127 /* Do the delay */
129
130 CurCount = Read8254Timer();
131 }
132 while (CurCount > LATCH / 2);
133
134 /* Get bottom value for delay */
135 delay_count >>= 1;
136
137 /* Stage 2: Fine calibration */
138
139 /* Which bit are we going to test */
140 calib_bit = delay_count;
141
142 for (i = 0; i < PRECISION; i++)
143 {
144 /* Next bit to calibrate */
145 calib_bit >>= 1;
146
147 /* If we have done all bits, stop */
148 if (!calib_bit) break;
149
150 /* Set the bit in delay_count */
151 delay_count |= calib_bit;
152
154
155 /* Do the delay */
157
158 CurCount = Read8254Timer();
159 /* If a tick has passed, turn the calibrated bit back off */
160 if (CurCount <= LATCH / 2)
161 delay_count &= ~calib_bit;
162 }
163
164 /* We're finished: Do the finishing touches */
165
166 /* Calculate delay_count for 1ms */
167 delay_count /= (MILLISEC / 2);
168}
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define MILLISEC
Definition: pchw.c:27
static VOID WaitFor8254Wraparound(VOID)
Definition: pchw.c:81
static VOID __StallExecutionProcessor(ULONG Loops)
Definition: pchw.c:54
#define PRECISION
Definition: pchw.c:28
#define LATCH
Definition: pchw.c:37
static unsigned int delay_count
Definition: pchw.c:39
static ULONG Read8254Timer(VOID)
Definition: pchw.c:68
unsigned char * PUCHAR
Definition: typedefs.h:53

◆ PnpBiosGetDeviceNode()

ULONG __cdecl PnpBiosGetDeviceNode ( UCHAR NodeId,
UCHAR NodeBuffer 
)

Referenced by DetectPnpBios().

◆ PnpBiosGetDeviceNodeCount()

ULONG __cdecl PnpBiosGetDeviceNodeCount ( ULONG NodeSize,
ULONG NodeCount 
)

Referenced by DetectPnpBios().

◆ PnpBiosGetDockStationInformation()

ULONG __cdecl PnpBiosGetDockStationInformation ( UCHAR DockingStationInfo)

Referenced by DetectDockingStation().

◆ PnpBiosSupported()

ULONG_PTR __cdecl PnpBiosSupported ( VOID  )

Referenced by DetectPnpBios().

◆ PxeCallApi()

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

◆ StallExecutionProcessor()

Variable Documentation

◆ FindPciBios

FIND_PCI_BIOS FindPciBios
extern

Definition at line 26 of file hwpci.c.

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

◆ GetHarddiskConfigurationData

GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
extern

Definition at line 45 of file pchw.c.

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