ReactOS 0.4.15-dev-7788-g1ad9096
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 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 33 of file hardware.h.

◆ PCI_TYPE1_DATA_PORT

#define PCI_TYPE1_DATA_PORT   0xCFC

Definition at line 34 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.

Typedef Documentation

◆ FIND_PCI_BIOS

typedef BOOLEAN(* FIND_PCI_BIOS) (PPCI_REGISTRY_INFO BusData)

Definition at line 62 of file hardware.h.

◆ GET_HARDDISK_CONFIG_DATA

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

Definition at line 56 of file hardware.h.

◆ GET_SERIAL_PORT

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

Definition at line 68 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 54 of file hwacpi.c.

55{
57 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
58 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
60 PACPI_BIOS_DATA AcpiBiosData;
62
63 Rsdp = FindAcpiBios();
64
65 if (Rsdp)
66 {
67 /* Set up the flag in the loader block */
69
70 /* Calculate the table size */
72 sizeof(ACPI_BIOS_DATA) - sizeof(BIOS_MEMORY_MAP);
73
74 /* Set 'Configuration Data' value */
75 PartialResourceList =
78 if (PartialResourceList == NULL)
79 {
80 ERR("Failed to allocate resource descriptor\n");
81 return;
82 }
83
84 RtlZeroMemory(PartialResourceList, sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize);
85 PartialResourceList->Version = 0;
86 PartialResourceList->Revision = 0;
87 PartialResourceList->Count = 1;
88
89 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
90 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
92 PartialDescriptor->u.DeviceSpecificData.DataSize = TableSize;
93
94 /* Fill the table */
95 AcpiBiosData = (PACPI_BIOS_DATA)&PartialResourceList->PartialDescriptors[1];
96
97 if (Rsdp->revision > 0)
98 {
99 TRACE("ACPI >1.0, using XSDT address\n");
100 AcpiBiosData->RSDTAddress.QuadPart = Rsdp->xsdt_physical_address;
101 }
102 else
103 {
104 TRACE("ACPI 1.0, using RSDT address\n");
105 AcpiBiosData->RSDTAddress.LowPart = Rsdp->rsdt_physical_address;
106 }
107
108 AcpiBiosData->Count = PcBiosMapCount;
109 memcpy(AcpiBiosData->MemoryMap, PcBiosMemoryMap,
111
112 TRACE("RSDT %p, data size %x\n", Rsdp->rsdt_physical_address,
113 TableSize);
114
115 /* Create new bus key */
116 FldrCreateComponentKey(SystemKey,
119 0,
120 0,
121 0xFFFFFFFF,
122 "ACPI BIOS",
123 PartialResourceList,
125 &BiosKey);
126
127 /* Increment bus number */
128 (*BusNumber)++;
129 }
130}
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
BOOLEAN AcpiPresent
Definition: hwacpi.c:26
static PRSDP_DESCRIPTOR FindAcpiBios(VOID)
Definition: hwacpi.c:29
#define ERR(fmt,...)
Definition: debug.h:110
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:174
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct _ACPI_BIOS_DATA * PACPI_BIOS_DATA
ULONG PcBiosMapCount
Definition: pcmem.c:38
BIOS_MEMORY_MAP PcBiosMemoryMap[MAX_BIOS_DESCRIPTORS]
Definition: pcmem.c:37
@ AdapterClass
Definition: arc.h:93
@ MultiFunctionAdapter
Definition: arc.h:116
#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
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@393 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@393::@402 DeviceSpecificData
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
#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
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:4327

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
57
58 /* Set 'Configuration Data' value */
59 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
60 if (PartialResourceList == NULL)
61 {
62 ERR("Failed to allocate resource descriptor\n");
63 return;
64 }
65 RtlZeroMemory(PartialResourceList, Size);
66 PartialResourceList->Version = 0;
67 PartialResourceList->Revision = 0;
68 PartialResourceList->Count = 0;
69
70 /* FIXME: Add configuration data */
71
72 /* Create new bus key */
73 FldrCreateComponentKey(SystemKey,
76 0,
77 0,
78 0xFFFFFFFF,
79 "APM",
80 PartialResourceList,
81 Size,
82 &BiosKey);
83
84 /* Increment bus number */
85 (*BusNumber)++;
86}
static BOOLEAN FindApmBios(VOID)
Definition: hwapm.c:14
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by Pc98HwDetect(), and PcHwDetect().

◆ DetectBiosDisks()

VOID DetectBiosDisks ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
PCONFIGURATION_COMPONENT_DATA  BusKey 
)

Definition at line 344 of file pchw.c.

346{
347 PCONFIGURATION_COMPONENT_DATA ControllerKey, DiskKey;
348 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
349 PCM_INT13_DRIVE_PARAMETER Int13Drives;
350 GEOMETRY Geometry;
351 UCHAR DiskCount, DriveNumber;
352 USHORT i;
353 ULONG Size;
354
355 /* The pre-enumeration of the BIOS disks was already done in InitializeBootDevices() */
356 DiskCount = PcBiosDiskCount;
357
358 /* Use the floppy disk controller as our controller */
359 ControllerKey = DetectBiosFloppyController(BusKey);
360 if (!ControllerKey)
361 {
362 ERR("Failed to detect BIOS disk controller\n");
363 return;
364 }
365
366 /* Allocate resource descriptor */
368 sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
369 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
370 if (PartialResourceList == NULL)
371 {
372 ERR("Failed to allocate resource descriptor\n");
373 return;
374 }
375
376 /* Initialize resource descriptor */
377 RtlZeroMemory(PartialResourceList, Size);
378 PartialResourceList->Version = 1;
379 PartialResourceList->Revision = 1;
380 PartialResourceList->Count = 1;
381 PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific;
382 PartialResourceList->PartialDescriptors[0].ShareDisposition = 0;
383 PartialResourceList->PartialDescriptors[0].Flags = 0;
384 PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
385 sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
386
387 /* Get harddisk Int13 geometry data */
388 Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
389 for (i = 0; i < DiskCount; i++)
390 {
391 DriveNumber = 0x80 + i;
392
393 if (MachDiskGetDriveGeometry(DriveNumber, &Geometry))
394 {
395 Int13Drives[i].DriveSelect = DriveNumber;
396 Int13Drives[i].MaxCylinders = Geometry.Cylinders - 1;
397 Int13Drives[i].SectorsPerTrack = (USHORT)Geometry.Sectors;
398 Int13Drives[i].MaxHeads = (USHORT)Geometry.Heads - 1;
399 Int13Drives[i].NumberDrives = DiskCount;
400
401 TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
402 DriveNumber,
403 Geometry.Cylinders - 1,
404 Geometry.Heads - 1,
405 Geometry.Sectors,
406 Geometry.BytesPerSector);
407 }
408 }
409
410 /* Update the 'System' key's configuration data with BIOS INT13h information */
411 FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
412
413 /* Create and fill subkey for each harddisk */
414 for (i = 0; i < DiskCount; i++)
415 {
417
418 DriveNumber = 0x80 + i;
419
420 /* Get disk values */
421 PartialResourceList = GetHarddiskConfigurationData(DriveNumber, &Size);
422 Identifier = GetHarddiskIdentifier(DriveNumber);
423
424 /* Create disk key */
425 FldrCreateComponentKey(ControllerKey,
428 Output | Input,
429 i,
430 0xFFFFFFFF,
432 PartialResourceList,
433 Size,
434 &DiskKey);
435 }
436}
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:128
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
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pchw.c:45
static PCONFIGURATION_COMPONENT_DATA DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: pchw.c:272
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
Definition: hwdisk.c:252
UCHAR PcBiosDiskCount
Definition: hwdisk.c:46
unsigned short USHORT
Definition: pedump.c:61
@ PeripheralClass
Definition: arc.h:95
@ DiskPeripheral
Definition: arc.h:129
@ Input
Definition: arc.h:84
@ Output
Definition: arc.h:85
Definition: disk.h:25
ULONG BytesPerSector
Definition: disk.h:29
ULONG Sectors
Definition: disk.h:28
ULONG Cylinders
Definition: disk.h:26
ULONG Heads
Definition: disk.h:27
void * PVOID
Definition: typedefs.h:50
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
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 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 RtlZeroMemory(PartialResourceList, Size);
200
201 /* Create new bus key */
202 FldrCreateComponentKey(SystemKey,
205 0,
206 0,
207 0xFFFFFFFF,
208 "PCI BIOS",
209 PartialResourceList,
210 Size,
211 &BiosKey);
212
213 /* Increment bus number */
214 (*BusNumber)++;
215
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! Ignoring remaining PCI buses. (i = %lu, NoBuses = %lu)\n",
233 i, (ULONG)BusData.NoBuses);
234 return;
235 }
236
237 /* Initialize resource descriptor */
238 RtlZeroMemory(PartialResourceList, Size);
239 PartialResourceList->Version = 1;
240 PartialResourceList->Revision = 1;
241 PartialResourceList->Count = 1;
242 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
243 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
245 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(PCI_REGISTRY_INFO);
246 memcpy(&PartialResourceList->PartialDescriptors[1],
247 &BusData,
248 sizeof(PCI_REGISTRY_INFO));
249 }
250 else
251 {
252 /* Set 'Configuration Data' value */
254 PartialDescriptors);
255 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
256 if (!PartialResourceList)
257 {
258 ERR("Failed to allocate resource descriptor! Ignoring remaining PCI buses. (i = %lu, NoBuses = %lu)\n",
259 i, (ULONG)BusData.NoBuses);
260 return;
261 }
262
263 /* Initialize resource descriptor */
264 RtlZeroMemory(PartialResourceList, Size);
265 }
266
267 /* Create the bus key */
268 FldrCreateComponentKey(SystemKey,
271 0,
272 0,
273 0xFFFFFFFF,
274 "PCI",
275 PartialResourceList,
276 Size,
277 &BusKey);
278
279 /* Increment bus number */
280 (*BusNumber)++;
281 }
282 }
283}
static VOID DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hwpci.c:117
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR
struct _PCI_REGISTRY_INFO PCI_REGISTRY_INFO
UCHAR NoBuses
Definition: pci.h:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

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().