]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Modified to meet EBC compile.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Jul 2007 05:32:47 +0000 (05:32 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Jul 2007 05:32:47 +0000 (05:32 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3285 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyCtrl.c
IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPort.c

index 2fd13c3a4b8ebdff492b1afc8d4c92ca2c8554e3..97d8003133f03b55210a8a34abe402b9e046f23d 100644 (file)
@@ -16,13 +16,13 @@ Module Name:
 Abstract:\r
 \r
   ISA Floppy Driver\r
 Abstract:\r
 \r
   ISA Floppy Driver\r
-  1. Support two types diskette drive  \r
+  1. Support two types diskette drive\r
      1.44M drive and 2.88M drive (and now only support 1.44M)\r
   2. Support two diskette drives\r
   3. Use DMA channel 2 to transfer data\r
   4. Do not use interrupt\r
   5. Support diskette change line signal and write protect\r
      1.44M drive and 2.88M drive (and now only support 1.44M)\r
   2. Support two diskette drives\r
   3. Use DMA channel 2 to transfer data\r
   4. Do not use interrupt\r
   5. Support diskette change line signal and write protect\r
-  \r
+\r
   The internal function for the floppy driver\r
 \r
 Revision History:\r
   The internal function for the floppy driver\r
 \r
 Revision History:\r
@@ -37,11 +37,11 @@ DiscoverFddDevice (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Detect the floppy drive is presented or not   \r
+  Routine Description:  Detect the floppy drive is presented or not\r
   Parameters:\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV       \r
+    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS    Drive is presented \r
+    EFI_SUCCESS    Drive is presented\r
     EFI_NOT_FOUND  Drive is not presented\r
 \r
 --*/\r
     EFI_NOT_FOUND  Drive is not presented\r
 \r
 --*/\r
@@ -79,10 +79,10 @@ FddIdentify (
   Routine Description:   Do recalibrate  and see the drive is presented or not\r
          Set the media parameters\r
   Parameters:\r
   Routine Description:   Do recalibrate  and see the drive is presented or not\r
          Set the media parameters\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV       \r
+    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS:    \r
-    EFI_DEVICE_ERROR: \r
+    EFI_SUCCESS:\r
+    EFI_DEVICE_ERROR:\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -119,35 +119,25 @@ FddIdentify (
   // Check Media\r
   //\r
   Status = DisketChanged (FdcDev);\r
   // Check Media\r
   //\r
   Status = DisketChanged (FdcDev);\r
-  switch (Status) {\r
-  case EFI_NO_MEDIA:\r
-    FdcDev->BlkIo.Media->MediaPresent = FALSE;\r
-    break;\r
-\r
-  case EFI_MEDIA_CHANGED:\r
-  case EFI_SUCCESS:\r
-    break;\r
 \r
 \r
-  default:\r
+  if (Status == EFI_NO_MEDIA) {\r
+    FdcDev->BlkIo.Media->MediaPresent = FALSE;\r
+  } else if (Status != EFI_MEDIA_CHANGED) {\r
     MotorOff (FdcDev);\r
     return Status;\r
   }\r
     MotorOff (FdcDev);\r
     return Status;\r
   }\r
+\r
   //\r
   // Check Disk Write Protected\r
   //\r
   Status = SenseDrvStatus (FdcDev, 0);\r
   //\r
   // Check Disk Write Protected\r
   //\r
   Status = SenseDrvStatus (FdcDev, 0);\r
-  switch (Status) {\r
-  case EFI_WRITE_PROTECTED:\r
-    FdcDev->BlkIo.Media->ReadOnly = TRUE;\r
-    break;\r
 \r
 \r
-  case EFI_SUCCESS:\r
+  if (Status == EFI_WRITE_PROTECTED) {\r
+    FdcDev->BlkIo.Media->ReadOnly = TRUE;\r
+  } else if (Status == EFI_SUCCESS) {\r
     FdcDev->BlkIo.Media->ReadOnly = FALSE;\r
     FdcDev->BlkIo.Media->ReadOnly = FALSE;\r
-    break;\r
-\r
-  default:\r
+  } else {\r
     return EFI_DEVICE_ERROR;\r
     return EFI_DEVICE_ERROR;\r
-    break;\r
   }\r
 \r
   MotorOff (FdcDev);\r
   }\r
 \r
   MotorOff (FdcDev);\r
@@ -167,12 +157,12 @@ FddReset (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Reset the Floppy Logic Drive   \r
+  Routine Description:  Reset the Floppy Logic Drive\r
   Parameters:\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV       \r
+    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
     EFI_SUCCESS:    The Floppy Logic Drive is reset\r
   Returns:\r
     EFI_SUCCESS:    The Floppy Logic Drive is reset\r
-    EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly and \r
+    EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly and\r
                       can not be reset\r
 \r
 --*/\r
                       can not be reset\r
 \r
 --*/\r
@@ -269,13 +259,13 @@ MotorOn (
 /*++\r
 \r
   Routine Description:  Turn the drive's motor on\r
 /*++\r
 \r
   Routine Description:  Turn the drive's motor on\r
-        The drive's motor must be on before any command can be executed   \r
+        The drive's motor must be on before any command can be executed\r
   Parameters:\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV       \r
+    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
     EFI_SUCCESS:       Turn the drive's motor on successfully\r
   Returns:\r
     EFI_SUCCESS:       Turn the drive's motor on successfully\r
-    EFI_DEVICE_ERROR:    The drive is busy, so can not turn motor on \r
-    EFI_INVALID_PARAMETER: Fail to Set timer(Cancel timer)  \r
+    EFI_DEVICE_ERROR:    The drive is busy, so can not turn motor on\r
+    EFI_INVALID_PARAMETER: Fail to Set timer(Cancel timer)\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -354,10 +344,10 @@ MotorOff (
 \r
   Routine Description:  Set a Timer and when Timer goes off, turn the motor off\r
   Parameters:\r
 \r
   Routine Description:  Set a Timer and when Timer goes off, turn the motor off\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV       \r
+    FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
     EFI_SUCCESS:       Set the Timer successfully\r
   Returns:\r
     EFI_SUCCESS:       Set the Timer successfully\r
-    EFI_INVALID_PARAMETER: Fail to Set the timer  \r
+    EFI_INVALID_PARAMETER: Fail to Set the timer\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -377,7 +367,7 @@ DisketChanged (
 \r
   Routine Description:  Detect the disk in the drive is changed or not\r
   Parameters:\r
 \r
   Routine Description:  Detect the disk in the drive is changed or not\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV   \r
+    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
     EFI_SUCCESS:    No disk media change\r
     EFI_DEVICE_ERROR: Fail to do the recalibrate or seek operation\r
   Returns:\r
     EFI_SUCCESS:    No disk media change\r
     EFI_DEVICE_ERROR: Fail to do the recalibrate or seek operation\r
@@ -443,7 +433,7 @@ Specify (
 /*++\r
 \r
   Routine Description:  Do the Specify command, this command sets DMA operation\r
 /*++\r
 \r
   Routine Description:  Do the Specify command, this command sets DMA operation\r
-                        and the initial values for each of the three internal \r
+                        and the initial values for each of the three internal\r
                         times: HUT, SRT and HLT\r
   Parameters:\r
     None\r
                         times: HUT, SRT and HLT\r
   Parameters:\r
     None\r
@@ -675,11 +665,11 @@ SenseIntStatus (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Do the Sense Interrupt Status command, this command \r
+  Routine Description:  Do the Sense Interrupt Status command, this command\r
                         resets the interrupt signal\r
   Parameters:\r
                         resets the interrupt signal\r
   Parameters:\r
-    StatusRegister0 UINT8 *: Be used to save Status Register 0 read from FDC   \r
-    PresentCylinderNumber  UINT8 *: Be used to save present cylinder number \r
+    StatusRegister0 UINT8 *: Be used to save Status Register 0 read from FDC\r
+    PresentCylinderNumber  UINT8 *: Be used to save present cylinder number\r
                                     read from FDC\r
   Returns:\r
     EFI_SUCCESS:    Execute the Sense Interrupt Status command successfully\r
                                     read from FDC\r
   Returns:\r
     EFI_SUCCESS:    Execute the Sense Interrupt Status command successfully\r
@@ -718,12 +708,12 @@ SenseDrvStatus (
 \r
   Routine Description:  Do the Sense Drive Status command\r
   Parameters:\r
 \r
   Routine Description:  Do the Sense Drive Status command\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV   \r
+    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r
     Lba EFI_LBA     : Logic block address\r
   Returns:\r
     EFI_SUCCESS:    Execute the Sense Drive Status command successfully\r
     EFI_DEVICE_ERROR: Fail to execute the command\r
     Lba EFI_LBA     : Logic block address\r
   Returns:\r
     EFI_SUCCESS:    Execute the Sense Drive Status command successfully\r
     EFI_DEVICE_ERROR: Fail to execute the command\r
-    EFI_WRITE_PROTECTED:The disk is write protected \r
+    EFI_WRITE_PROTECTED:The disk is write protected\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -782,10 +772,10 @@ DetectMedia (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Update the disk media properties and if necessary \r
+  Routine Description:  Update the disk media properties and if necessary\r
                         reinstall Block I/O interface\r
   Parameters:\r
                         reinstall Block I/O interface\r
   Parameters:\r
-    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV   \r
+    FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r
   Returns:\r
     EFI_SUCCESS:    Do the operation successfully\r
     EFI_DEVICE_ERROR: Fail to the operation\r
   Returns:\r
     EFI_SUCCESS:    Do the operation successfully\r
     EFI_DEVICE_ERROR: Fail to the operation\r
@@ -807,21 +797,14 @@ DetectMedia (
   // Check disk change\r
   //\r
   Status = DisketChanged (FdcDev);\r
   // Check disk change\r
   //\r
   Status = DisketChanged (FdcDev);\r
-  switch (Status) {\r
-  case EFI_MEDIA_CHANGED:\r
+\r
+  if (Status == EFI_MEDIA_CHANGED) {\r
     FdcDev->BlkIo.Media->MediaId++;\r
     FdcDev->BlkIo.Media->MediaPresent = TRUE;\r
     bReset = TRUE;\r
     FdcDev->BlkIo.Media->MediaId++;\r
     FdcDev->BlkIo.Media->MediaPresent = TRUE;\r
     bReset = TRUE;\r
-    break;\r
-\r
-  case EFI_NO_MEDIA:\r
+  } else if (Status == EFI_NO_MEDIA) {\r
     FdcDev->BlkIo.Media->MediaPresent = FALSE;\r
     FdcDev->BlkIo.Media->MediaPresent = FALSE;\r
-    break;\r
-\r
-  case EFI_SUCCESS:\r
-    break;\r
-\r
-  default:\r
+  } else if (Status != EFI_SUCCESS) {\r
     MotorOff (FdcDev);\r
     return Status;\r
     //\r
     MotorOff (FdcDev);\r
     return Status;\r
     //\r
@@ -873,9 +856,9 @@ Setup (
 \r
   Routine Description: Set the data rate and so on\r
   Parameters:\r
 \r
   Routine Description: Set the data rate and so on\r
   Parameters:\r
-    None  \r
+    None\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS:  \r
+    EFI_SUCCESS:\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -919,9 +902,9 @@ ReadWriteDataSector (
     Buffer VOID *:\r
     Lba EFI_LBA:\r
     NumberOfBlocks UINTN:\r
     Buffer VOID *:\r
     Lba EFI_LBA:\r
     NumberOfBlocks UINTN:\r
-    Read BOOLEAN:     \r
+    Read BOOLEAN:\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS:  \r
+    EFI_SUCCESS:\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 \r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
@@ -1076,7 +1059,7 @@ FillPara (
   Routine Description: Fill in Parameter\r
   Parameters:\r
   Returns:\r
   Routine Description: Fill in Parameter\r
   Parameters:\r
   Returns:\r
-    \r
+\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
@@ -1118,7 +1101,7 @@ DataInByte (
 \r
   Routine Description:  Read result byte from Data Register of FDC\r
   Parameters:\r
 \r
   Routine Description:  Read result byte from Data Register of FDC\r
   Parameters:\r
-    Pointer UINT8 *: Be used to save result byte read from FDC   \r
+    Pointer UINT8 *: Be used to save result byte read from FDC\r
   Returns:\r
     EFI_SUCCESS:    Read result byte from FDC successfully\r
     EFI_DEVICE_ERROR: The FDC is not ready to be read\r
   Returns:\r
     EFI_SUCCESS:    Read result byte from FDC successfully\r
     EFI_DEVICE_ERROR: The FDC is not ready to be read\r
@@ -1160,7 +1143,7 @@ DataOutByte (
 \r
   Routine Description:  Write command byte to Data Register of FDC\r
   Parameters:\r
 \r
   Routine Description:  Write command byte to Data Register of FDC\r
   Parameters:\r
-    Pointer UINT8 *: Be used to save command byte written to FDC   \r
+    Pointer UINT8 *: Be used to save command byte written to FDC\r
   Returns:\r
     EFI_SUCCESS:    Write command byte to FDC successfully\r
     EFI_DEVICE_ERROR: The FDC is not ready to be written\r
   Returns:\r
     EFI_SUCCESS:    Write command byte to FDC successfully\r
     EFI_DEVICE_ERROR: The FDC is not ready to be written\r
@@ -1201,14 +1184,14 @@ FddWaitForBSYClear (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Detect the specified floppy logic drive is busy or \r
+  Routine Description:  Detect the specified floppy logic drive is busy or\r
                         not within a period of time\r
   Parameters:\r
     Disk EFI_FDC_DISK:    Indicate it is drive A or drive B\r
                         not within a period of time\r
   Parameters:\r
     Disk EFI_FDC_DISK:    Indicate it is drive A or drive B\r
-    TimeoutInSeconds UINTN: the time period for waiting   \r
+    TimeoutInSeconds UINTN: the time period for waiting\r
   Returns:\r
     EFI_SUCCESS:  The drive and command are not busy\r
   Returns:\r
     EFI_SUCCESS:  The drive and command are not busy\r
-    EFI_TIMEOUT:  The drive or command is still busy after a period time that \r
+    EFI_TIMEOUT:  The drive or command is still busy after a period time that\r
                   set by TimeoutInSeconds\r
 \r
 --*/\r
                   set by TimeoutInSeconds\r
 \r
 --*/\r
@@ -1264,7 +1247,7 @@ FddDRQReady (
   Routine Description:  Determine whether FDC is ready to write or read\r
   Parameters:\r
     Dio BOOLEAN:      Indicate the FDC is waiting to write or read\r
   Routine Description:  Determine whether FDC is ready to write or read\r
   Parameters:\r
     Dio BOOLEAN:      Indicate the FDC is waiting to write or read\r
-    TimeoutInSeconds UINTN: The time period for waiting   \r
+    TimeoutInSeconds UINTN: The time period for waiting\r
   Returns:\r
     EFI_SUCCESS:  FDC is ready to write or read\r
     EFI_NOT_READY:  FDC is not ready within the specified time period\r
   Returns:\r
     EFI_SUCCESS:  FDC is ready to write or read\r
     EFI_NOT_READY:  FDC is not ready within the specified time period\r
@@ -1384,9 +1367,9 @@ CheckStatus3 (
 \r
   Routine Description:  Check the drive status information\r
   Parameters:\r
 \r
   Routine Description:  Check the drive status information\r
   Parameters:\r
-    StatusRegister3 UINT8: the value of Status Register 3    \r
+    StatusRegister3 UINT8: the value of Status Register 3\r
   Returns:\r
   Returns:\r
-    EFI_SUCCESS:     \r
+    EFI_SUCCESS:\r
     EFI_WRITE_PROTECTED:  The disk is write protected\r
 \r
 --*/\r
     EFI_WRITE_PROTECTED:  The disk is write protected\r
 \r
 --*/\r
@@ -1408,14 +1391,14 @@ GetTransferBlockCount (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description:  Calculate the number of block in the same cylinder \r
+  Routine Description:  Calculate the number of block in the same cylinder\r
                         according to LBA\r
   Parameters:\r
     FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r
                         according to LBA\r
   Parameters:\r
     FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r
-    LBA EFI_LBA:      The starting logic block address            \r
+    LBA EFI_LBA:      The starting logic block address\r
     NumberOfBlocks UINTN: The number of blocks\r
   Returns:\r
     NumberOfBlocks UINTN: The number of blocks\r
   Returns:\r
-    UINTN : The number of blocks in the same cylinder which the starting \r
+    UINTN : The number of blocks in the same cylinder which the starting\r
         logic block address is LBA\r
 \r
 --*/\r
         logic block address is LBA\r
 \r
 --*/\r
@@ -1452,9 +1435,9 @@ FddTimerProc (
 \r
   Routine Description:  When the Timer(2s) off, turn the drive's motor off\r
   Parameters:\r
 \r
   Routine Description:  When the Timer(2s) off, turn the drive's motor off\r
   Parameters:\r
-    Event EFI_EVENT: Event(the timer) whose notification function is being \r
+    Event EFI_EVENT: Event(the timer) whose notification function is being\r
                      invoked\r
                      invoked\r
-    Context VOID *:  Pointer to the notification function's context \r
+    Context VOID *:  Pointer to the notification function's context\r
   Returns:\r
     VOID\r
 \r
   Returns:\r
     VOID\r
 \r
@@ -1494,10 +1477,10 @@ FdcReadPort (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description: Read I/O port for FDC  \r
+  Routine Description: Read I/O port for FDC\r
   Parameters:\r
   Returns:\r
   Parameters:\r
   Returns:\r
-    \r
+\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
@@ -1527,10 +1510,10 @@ FdcWritePort (
   )\r
 /*++\r
 \r
   )\r
 /*++\r
 \r
-  Routine Description: Write I/O port for FDC  \r
+  Routine Description: Write I/O port for FDC\r
   Parameters:\r
   Returns:\r
   Parameters:\r
   Returns:\r
-    \r
+\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
 --*/\r
 // GC_TODO: function comment is missing 'Arguments:'\r
 // GC_TODO:    FdcDev - add argument and description to function comment\r
index 95d94dc59289131adba21a7bcfe0b61fa4570729..5b8dac4ae47e3de1f32069b87281b6e9ae991651 100644 (file)
@@ -190,7 +190,7 @@ PciVgaMiniPortDriverBindingStart (
   Status = gBS->AllocatePool (
                   EfiBootServicesData,
                   sizeof (PCI_VGA_MINI_PORT_DEV),
   Status = gBS->AllocatePool (
                   EfiBootServicesData,
                   sizeof (PCI_VGA_MINI_PORT_DEV),
-                  &PciVgaMiniPortPrivate
+                  (VOID **) &PciVgaMiniPortPrivate
                   );
   if (EFI_ERROR (Status)) {
     goto Done;
                   );
   if (EFI_ERROR (Status)) {
     goto Done;