Fixed a typo.
[reactos.git] / reactos / boot / freeldr / freeldr / arch / i386 / hardware.c
index c70b6de..c120cdc 100644 (file)
@@ -197,44 +197,44 @@ HalpCalibrateStallExecution(VOID)
   WRITE_PORT_UCHAR((PUCHAR)0x43, 0x34);  /* binary, mode 2, LSB/MSB, ch 0 */
   WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH & 0xff); /* LSB */
   WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH >> 8); /* MSB */
-  
+
   /* Stage 1:  Coarse calibration                                   */
-  
+
   WaitFor8254Wraparound();
-  
+
   delay_count = 1;
-  
+
   do {
     delay_count <<= 1;                  /* Next delay count to try */
 
     WaitFor8254Wraparound();
-  
+
     __StallExecutionProcessor(delay_count);      /* Do the delay */
-  
+
     CurCount = Read8254Timer();
   } while (CurCount > LATCH / 2);
-  
+
   delay_count >>= 1;              /* Get bottom value for delay     */
-  
+
   /* Stage 2:  Fine calibration                                     */
-  
+
   calib_bit = delay_count;        /* Which bit are we going to test */
-  
+
   for(i=0;i<PRECISION;i++) {
     calib_bit >>= 1;             /* Next bit to calibrate          */
     if(!calib_bit) break;        /* If we have done all bits, stop */
-  
+
     delay_count |= calib_bit;        /* Set the bit in delay_count */
-  
+
     WaitFor8254Wraparound();
-  
+
     __StallExecutionProcessor(delay_count);      /* Do the delay */
-  
+
     CurCount = Read8254Timer();
     if (CurCount <= LATCH / 2)   /* If a tick has passed, turn the */
       delay_count &= ~calib_bit; /* calibrated bit back off        */
   }
-  
+
   /* We're finished:  Do the finishing touches                      */
   delay_count /= (MILLISEC / 2);   /* Calculate delay_count for 1ms */
 }
@@ -363,7 +363,7 @@ DetectPnpBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
   FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].ShareDisposition =
     CmResourceShareUndetermined;
 
-  Ptr = (char *)(((PVOID)&FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]) +
+  Ptr = (char *)(((ULONG_PTR)&FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]) +
                 sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
 
   /* Set instalation check data */
@@ -460,7 +460,7 @@ SetHarddiskConfigurationData(FRLDRHKEY DiskKey,
     sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
 
   /* Get pointer to geometry data */
-  DiskGeometry = ((PVOID)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR);
+  DiskGeometry = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
 
   /* Get the disk geometry */
   ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
@@ -562,7 +562,7 @@ SetHarddiskIdentifier(FRLDRHKEY DiskKey,
   Identifier[17] = '-';
   Identifier[18] = 'A';
   Identifier[19] = 0;
-  DbgPrint((DPRINT_HWDETECT, "Identifier: %xsn", Identifier));
+  DbgPrint((DPRINT_HWDETECT, "Identifier: %x\n", Identifier));
 
   /* Set identifier */
   Error = RegSetValue(DiskKey,
@@ -648,7 +648,7 @@ DetectBiosDisks(FRLDRHKEY SystemKey,
     sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
 
   /* Get harddisk Int13 geometry data */
-  Int13Drives = ((PVOID)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR);
+  Int13Drives = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
   for (i = 0; i < DiskCount; i++)
     {
       if (MachDiskGetDriveGeometry(0x80 + i, &Geometry))
@@ -744,7 +744,7 @@ GetInt1eTable(VOID)
   PUSHORT SegPtr = (PUSHORT)0x7A;
   PUSHORT OfsPtr = (PUSHORT)0x78;
 
-  return (PVOID)(((ULONG)(*SegPtr)) << 4) + (ULONG)(*OfsPtr);
+  return (PVOID)((ULONG_PTR)(((ULONG)(*SegPtr)) << 4) + (ULONG)(*OfsPtr));
 }
 
 
@@ -814,7 +814,7 @@ DetectBiosFloppyPeripheral(FRLDRHKEY ControllerKey)
     PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
     PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_FLOPPY_DEVICE_DATA);
 
-    FloppyData = ((PVOID)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR);
+    FloppyData = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
     FloppyData->Version = 2;
     FloppyData->Revision = 0;
     FloppyData->MaxDensity = MaxDensity[FloppyType];
@@ -1691,7 +1691,7 @@ DetectKeyboardPeripheral(FRLDRHKEY ControllerKey)
     PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
     PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_KEYBOARD_DEVICE_DATA);
 
-    KeyboardData = ((PVOID)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR);
+    KeyboardData = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
     KeyboardData->Version = 0;
     KeyboardData->Revision = 0;
     KeyboardData->Type = 4;
@@ -1715,7 +1715,7 @@ DetectKeyboardPeripheral(FRLDRHKEY ControllerKey)
     /* Set 'Identifier' value */
     strcpy(Buffer,
           "PCAT_ENHANCED");
-    Error = RegSetValue(ControllerKey,
+    Error = RegSetValue(PeripheralKey,
                        "Identifier",
                        REG_SZ,
                        Buffer,