]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clean up code
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 21 Jul 2009 07:57:29 +0000 (07:57 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 21 Jul 2009 07:57:29 +0000 (07:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8975 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.h
IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c
IntelFrameworkModulePkg/Universal/LegacyRegionDxe/LegacyRegion.c

index 3429b8f8b80a6a1e21b7547e9b1408f500efac38..81f02ecd10d2e2f2d65d2861e9078edff0eccd0c 100644 (file)
@@ -39,7 +39,6 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
 \r
@@ -51,7 +50,6 @@
   BaseMemoryLib\r
   DevicePathLib\r
   UefiLib\r
-  BaseLib\r
   UefiDriverEntryPoint\r
   DebugLib\r
 \r
index 4a86257e73266d55186fe3f68b87d5e052c6d7a7..cf895c8802b6d0535c279724381678cd79a28319 100644 (file)
@@ -882,7 +882,7 @@ IsaSerialReceiveTransmit (
           //\r
           TimeOut   = 0;\r
           Msr.Data  = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
-          while (Msr.Bits.Dcd == 1 && (!Msr.Bits.Cts ^ FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {\r
+          while ((Msr.Bits.Dcd == 1) && ((Msr.Bits.Cts == 0) || FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {\r
             gBS->Stall (TIMEOUT_STALL_INTERVAL);\r
             TimeOut++;\r
             if (TimeOut > 5) {\r
@@ -892,7 +892,7 @@ IsaSerialReceiveTransmit (
             Msr.Data = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);\r
           }\r
 \r
-          if (Msr.Bits.Dcd== 0 || (Msr.Bits.Cts ^ FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {\r
+          if ((Msr.Bits.Dcd == 0) && ((Msr.Bits.Cts == 1) || FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {\r
             IsaSerialFifoRemove (&SerialDevice->Transmit, &Data);\r
             WRITE_THR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Data);\r
           }\r
@@ -1188,12 +1188,7 @@ IsaSerialSetAttributes (
   if ((StopBits < OneStopBit) || (StopBits > TwoStopBits)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  //\r
-  // for DataBits = 5, StopBits can not set TwoStopBits\r
-  //\r
-  // if ((DataBits == 5) && (StopBits == TwoStopBits)) {\r
-  //  return EFI_INVALID_PARAMETER;\r
-  // }\r
+\r
   //\r
   // for DataBits = 6,7,8, StopBits can not set OneFiveStopBits\r
   //\r
index 68569991bce8846dabbd8eb7ba5e430a6c6d96c0..deb79265264c4ff5c186a32f335c3bef0775c1b4 100644 (file)
@@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
index 31d6df57058c7f164e9008046d0f4479203f271a..d4539d47ba4f819182c68be68ac9ed938ae39ac6 100644 (file)
@@ -138,4 +138,45 @@ BdsEntry (
   IN  EFI_BDS_ARCH_PROTOCOL *This\r
   );\r
 \r
+\r
+/**\r
+  Perform the memory test base on the memory test intensive level,\r
+  and update the memory resource.\r
+\r
+  @param  Level         The memory test intensive level.\r
+\r
+  @retval EFI_STATUS    Success test all the system memory and update\r
+                        the memory resource\r
+\r
+**/\r
+EFI_STATUS\r
+BdsMemoryTest (\r
+  IN EXTENDMEM_COVERAGE_LEVEL Level\r
+  );\r
+\r
+/**\r
+\r
+  This routine is called to see if there are any capsules we need to process.\r
+  If the boot mode is not UPDATE, then we do nothing. Otherwise find the\r
+  capsule HOBS and produce firmware volumes for them via the DXE service.\r
+  Then call the dispatcher to dispatch drivers from them. Finally, check\r
+  the status of the updates.\r
+\r
+  This function should be called by BDS in case we need to do some\r
+  sort of processing even if there is no capsule to process. We\r
+  need to do this if an earlier update went away and we need to\r
+  clear the capsule variable so on the next reset PEI does not see it and\r
+  think there is a capsule available.\r
+\r
+  @param BootMode                 the current boot mode\r
+\r
+  @retval EFI_INVALID_PARAMETER   boot mode is not correct for an update\r
+  @retval EFI_SUCCESS             There is no error when processing capsule\r
+\r
+**/\r
+EFI_STATUS\r
+BdsProcessCapsules (\r
+  EFI_BOOT_MODE BootMode\r
+  );\r
+\r
 #endif\r
index dcaa488894af9b94f8b0ca3aef6c0ea2949ee285..d671c1ea38184a24d9c2231ef1ce76904406ab4b 100644 (file)
@@ -40,9 +40,6 @@ UINT16                          *mBootNext = NULL;
 \r
 EFI_HANDLE                      mBdsImageHandle;\r
 \r
-extern EFI_STATUS BdsMemoryTest (EXTENDMEM_COVERAGE_LEVEL Level);\r
-extern EFI_STATUS ProcessCapsules (EFI_BOOT_MODE BootMode);\r
-\r
 /**\r
 \r
   Install Boot Device Selection Protocol\r
@@ -350,7 +347,7 @@ BdsEntry (
   //\r
   // Setup some platform policy here\r
   //\r
-  PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, ProcessCapsules, BdsMemoryTest);\r
+  PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, BdsProcessCapsules, BdsMemoryTest);\r
   PERF_END (NULL, "PlatformBds", "BDS", 0);\r
 \r
   //\r
index b6ea7ae8b20646de15868e00c16526b0d40f78c4..790fe51d444967126e403d273be0ee5496d89c6e 100644 (file)
@@ -756,7 +756,7 @@ UpdateConModePage (
   UINTN                         Row;\r
   CHAR16                        RowString[50];\r
   CHAR16                        ModeString[50];\r
-  CHAR16                        *pStr;\r
+  CHAR16                        *PStr;\r
   UINTN                         MaxMode;\r
   UINTN                         ValidMode;\r
   EFI_STRING_ID                 *ModeToken;\r
@@ -812,11 +812,11 @@ UpdateConModePage (
     // Build mode string Column x Row\r
     //\r
     UnicodeValueToString (ModeString, 0, Col, 0);\r
-    pStr = &ModeString[0];\r
-    StrnCat (pStr, L" x ", StrLen(L" x "));\r
+    PStr = &ModeString[0];\r
+    StrnCat (PStr, L" x ", StrLen(L" x "));\r
     UnicodeValueToString (RowString, 0, Row, 0);\r
-    pStr = &ModeString[0];\r
-    StrnCat (pStr, RowString, StrLen(RowString));\r
+    PStr = &ModeString[0];\r
+    StrnCat (PStr, RowString, StrLen(RowString));\r
 \r
     ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);\r
 \r
index 3a998c6df6b947f9911305cc8bab267ec21d3e1c..47082f57d300c290bada398f9c397121ee691721 100644 (file)
@@ -34,7 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 EFI_STATUS\r
-ProcessCapsules (\r
+BdsProcessCapsules (\r
   EFI_BOOT_MODE BootMode\r
   )\r
 {\r
index c5467b222f021c59fcb79c294f0ca9df044a2bba..2a17fe7847dea0354e0d8bfe5a89db9cbfc32d48 100644 (file)
@@ -1,4 +1,4 @@
-/**\r
+/** @file\r
   Produces the Legacy Region Protocol.\r
 \r
   This generic implementation of the Legacy Region Protocol does not actually \r
@@ -23,61 +23,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/DebugLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 \r
-//\r
-// Function prototypes of the Legacy Region Protocol services this module produces\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyRegionDecode (\r
-  IN EFI_LEGACY_REGION_PROTOCOL  *This,\r
-  IN UINT32                      Start,\r
-  IN UINT32                      Length,\r
-  IN BOOLEAN                     *On\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyRegionLock (\r
-  IN  EFI_LEGACY_REGION_PROTOCOL  *This,\r
-  IN  UINT32                      Start,\r
-  IN  UINT32                      Length,\r
-  OUT UINT32                      *Granularity OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyRegionBootLock (\r
-  IN  EFI_LEGACY_REGION_PROTOCOL  *This,\r
-  IN  UINT32                      Start,\r
-  IN  UINT32                      Length,\r
-  OUT UINT32                      *Granularity OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-LegacyRegionUnlock (\r
-  IN  EFI_LEGACY_REGION_PROTOCOL  *This,\r
-  IN  UINT32                      Start,\r
-  IN  UINT32                      Length,\r
-  OUT UINT32                      *Granularity OPTIONAL\r
-  );\r
-\r
-//\r
-// Module global for the handle the Legacy Region Protocol is installed\r
-//\r
-EFI_HANDLE                  mLegacyRegionHandle = NULL;\r
-\r
-//\r
-// Module global for the Legacy Region Protocol instance that is installed onto\r
-// mLegacyRegionHandle\r
-//\r
-EFI_LEGACY_REGION_PROTOCOL  mLegacyRegion = {\r
-  LegacyRegionDecode,\r
-  LegacyRegionLock,\r
-  LegacyRegionBootLock,\r
-  LegacyRegionUnlock\r
-};\r
-\r
 /**\r
   Sets hardware to decode or not decode a region.\r
 \r
@@ -171,6 +116,22 @@ LegacyRegionUnlock (
   return EFI_SUCCESS;\r
 }\r
 \r
+//\r
+// Module global for the handle the Legacy Region Protocol is installed\r
+//\r
+EFI_HANDLE                  mLegacyRegionHandle = NULL;\r
+\r
+//\r
+// Module global for the Legacy Region Protocol instance that is installed onto\r
+// mLegacyRegionHandle\r
+//\r
+EFI_LEGACY_REGION_PROTOCOL  mLegacyRegion = {\r
+  LegacyRegionDecode,\r
+  LegacyRegionLock,\r
+  LegacyRegionBootLock,\r
+  LegacyRegionUnlock\r
+};\r
+\r
 /**\r
   The user Entry Point for module LegacyRegionDxe.  The user code starts with this function.\r
 \r