]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Bug fix for "EDK GenericBds WriteBootToOsPerformanceData() uses AcpiReclaimMemory";
authordtang2 <dtang2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 02:40:21 +0000 (02:40 +0000)
committerdtang2 <dtang2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 02:40:21 +0000 (02:40 +0000)
2. Bug fix for "[FT] in new BDS, add a long item in Boot Option will cause an empty line appear";
3. Bug fix for "In "SetBootNextValue" page,description does not display properly"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1889 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BBSsupport.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMngr/BootManagerStrings.uni
EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c

index cf3d0004d9be707b07d9cc05374e5acb60cc2e29..7b219c85bb6f17a79e4f537eb97c212dc57dd68b 100644 (file)
@@ -9,7 +9,7 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
 Module Name:\r
-        Presentation.c\r
+  Presentation.c\r
 \r
 Abstract:\r
 \r
@@ -732,7 +732,7 @@ Returns:
         PrintStringAt (SecCol, BottomRowOfHelp, gEnterString);\r
       }\r
     } else {\r
-      PrintStringAt (StartColumnOfHelp, BottomRowOfHelp, gEnterCommitString);\r
+      PrintStringAt (SecCol, BottomRowOfHelp, gEnterCommitString);\r
 \r
       //\r
       // If it is a selected numeric with manual input, display different message\r
@@ -740,7 +740,7 @@ Returns:
       if ((Selection->ThisTag->Operand == EFI_IFR_NUMERIC_OP) && (Selection->ThisTag->Step == 0)) {\r
         PrintStringAt (SecCol, TopRowOfHelp, gNumericInput);\r
       } else if (Selection->ThisTag->Operand != EFI_IFR_ORDERED_LIST_OP) {\r
-        PrintAt (SecCol, BottomRowOfHelp, (CHAR16 *) L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);\r
+        PrintAt (StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);\r
       }\r
 \r
       if (Selection->ThisTag->Operand == EFI_IFR_ORDERED_LIST_OP) {\r
index 0d512fd34e87156df70cddc0ba2506c7b8bd8c5a..7a2ec044034acabb65bd0bb8df424b8f129a6830 100644 (file)
@@ -806,7 +806,7 @@ UpdateStatusBar (
           gScreenDimensions.BottomRow - 1,\r
           NvUpdateMessage\r
           );\r
-        gResetRequired    = (BOOLEAN) (gResetRequired | (Flags & RESET_REQUIRED));\r
+        gResetRequired    = (BOOLEAN) (gResetRequired | ((Flags & EFI_IFR_FLAG_RESET_REQUIRED) == EFI_IFR_FLAG_RESET_REQUIRED));\r
 \r
         gNvUpdateRequired = TRUE;\r
       } else {\r
@@ -1222,6 +1222,15 @@ Returns:
   // Ensure we have got a valid buffer\r
   //\r
   if (*OutputString != NULL) {\r
+  \r
+    //\r
+    //NARROW_CHAR can not be printed in screen, so if a line only contain  the two CHARs: 'NARROW_CHAR + CHAR_CARRIAGE_RETURN' , it is a empty line  in Screen.\r
+    //To avoid displaying this  empty line in screen,  just skip  the two CHARs here.\r
+    //\r
+   if ((InputString[*Index] == NARROW_CHAR) && (InputString[*Index + 1] == CHAR_CARRIAGE_RETURN)) {\r
+     *Index = *Index + 2;\r
+   } \r
+\r
     //\r
     // Fast-forward the string and see if there is a carriage-return in the string\r
     //\r
@@ -1441,7 +1450,7 @@ Returns:
   UI_MENU_OPTION              *PreviousMenuOption;\r
   EFI_IFR_BINARY              *IfrBinary;\r
   UI_CONTROL_FLAG             ControlFlag;\r
-  EFI_SCREEN_DESCRIPTOR           LocalScreen;\r
+  EFI_SCREEN_DESCRIPTOR       LocalScreen;\r
   EFI_FILE_FORM_TAGS          *FileFormTags;\r
   MENU_REFRESH_ENTRY          *MenuRefreshEntry;\r
   MENU_REFRESH_ENTRY          *OldMenuRefreshEntry;\r
index a33be4b046f123cbc635aa178f8814fd7d2f3436..c9f2402eb140de7171062caf5b28cad425d20ba9 100644 (file)
@@ -36,6 +36,26 @@ AsciiToUnicodeSize (
   IN UINTN              Size,\r
   OUT UINT16            *u\r
   )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Translate the first n characters of an Ascii string to\r
+    Unicode characters. The count n is indicated by parameter\r
+    Size. If Size is greater than the length of string, then\r
+    the entire string is translated.\r
+\r
+  Arguments:\r
+\r
+    a         - Pointer to input Ascii string.\r
+    Size      - The number of characters to translate.\r
+    u         - Pointer to output Unicode string buffer.\r
+\r
+  Returns:\r
+\r
+    None\r
+\r
+--*/\r
 {\r
   UINTN i;\r
 \r
@@ -43,12 +63,12 @@ AsciiToUnicodeSize (
   while (a[i] != 0) {\r
     u[i] = (CHAR16) a[i];\r
     if (i == Size) {\r
-      u[i] = 0;\r
       break;\r
     }\r
 \r
     i++;\r
   }\r
+  u[i] = 0;\r
 }\r
 \r
 VOID\r
@@ -156,6 +176,32 @@ BdsCreateLegacyBootOption (
   IN OUT UINT16                       **BootOrderList,\r
   IN OUT UINTN                        *BootOrderListSize\r
   )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Create a legacy boot option for the specified entry of\r
+    BBS table, save it as variable, and append it to the boot\r
+    order list.\r
+\r
+  Arguments:\r
+\r
+    CurrentBbsEntry        - Pointer to current BBS table.\r
+    CurrentBbsDevPath      - Pointer to the Device Path Protocol instance of BBS\r
+    Index                  - Index of the specified entry in BBS table.\r
+    BootOrderList          - On input, the original boot order list.\r
+                             On output, the new boot order list attached with the\r
+                             created node.\r
+    BootOrderListSize      - On input, the original size of boot order list.\r
+                           - On output, the size of new boot order list.\r
+\r
+  Returns:\r
+\r
+    EFI_SUCCESS            - Boot Option successfully created.\r
+    EFI_OUT_OF_RESOURCES   - Fail to allocate necessary memory.\r
+    Other                  - Error occurs while setting variable.\r
+\r
+--*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT16      CurrentBootOptionNo;\r
@@ -267,6 +313,8 @@ BdsCreateLegacyBootOption (
     CopyMem (NewBootOrderList, *BootOrderList, *BootOrderListSize);\r
   }\r
 \r
+  SafeFreePool (*BootOrderList);\r
+\r
   BootOrderLastIndex                    = (UINTN) (*BootOrderListSize / sizeof (UINT16));\r
   NewBootOrderList[BootOrderLastIndex]  = CurrentBootOptionNo;\r
   *BootOrderListSize += sizeof (UINT16);\r
@@ -352,6 +400,25 @@ EFI_STATUS
 BdsDeleteAllInvalidLegacyBootOptions (\r
   VOID\r
   )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Delete all the invalid legacy boot options.\r
+\r
+  Arguments:\r
+\r
+    None.\r
+\r
+  Returns:\r
+\r
+    EFI_SUCCESS            - All invalide legacy boot options are deleted.\r
+    EFI_OUT_OF_RESOURCES   - Fail to allocate necessary memory.\r
+    EFI_NOT_FOUND          - Fail to retrive variable of boot order.\r
+    Other                  - Error occurs while setting variable or locating\r
+                             protocol.\r
+\r
+--*/\r
 {\r
   UINT16                    *BootOrder;\r
   UINT8                     *BootOptionVar;\r
@@ -367,6 +434,8 @@ BdsDeleteAllInvalidLegacyBootOptions (
   EFI_LEGACY_BIOS_PROTOCOL  *LegacyBios;\r
   UINTN                     Index;\r
   UINT16                    BootOption[10];\r
+  UINT16                    BootDesc[100];\r
+  BOOLEAN                   DescStringMatch;\r
 \r
   Status        = EFI_SUCCESS;\r
   BootOrder     = NULL;\r
@@ -417,11 +486,28 @@ BdsDeleteAllInvalidLegacyBootOptions (
       Index++;\r
       continue;\r
     }\r
\r
+    //\r
+    // Check if BBS Description String is changed\r
+    //\r
+    DescStringMatch = FALSE;\r
+    \r
+    BdsBuildLegacyDevNameString (\r
+      &LocalBbsTable[BbsIndex], \r
+      BbsIndex, \r
+      sizeof(BootDesc), \r
+      BootDesc\r
+      );\r
+    \r
+    if (StrCmp (BootDesc, (UINT16*)(BootOptionVar + sizeof (UINT32) + sizeof (UINT16))) == 0) {\r
+      DescStringMatch = TRUE;\r
+    }\r
 \r
     if (!((LocalBbsTable[BbsIndex].BootPriority == BBS_IGNORE_ENTRY) ||\r
-        (LocalBbsTable[BbsIndex].BootPriority == BBS_DO_NOT_BOOT_FROM) ||\r
-         (LocalBbsTable[BbsIndex].BootPriority == BBS_LOWEST_PRIORITY)) &&\r
-         LocalBbsTable[BbsIndex].DeviceType == BbsEntry->DeviceType) {\r
+          (LocalBbsTable[BbsIndex].BootPriority == BBS_DO_NOT_BOOT_FROM) ||\r
+          (LocalBbsTable[BbsIndex].BootPriority == BBS_LOWEST_PRIORITY)) &&\r
+        (LocalBbsTable[BbsIndex].DeviceType == BbsEntry->DeviceType) &&\r
+        DescStringMatch) {\r
       Index++;\r
       continue;\r
     }\r
index e875cfbee1c5c72580059ccf00ee85fe221cb10b..684ac2f3483dab723b323fed6cdf846e14656835 100644 (file)
Binary files a/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMngr/BootManagerStrings.uni and b/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMngr/BootManagerStrings.uni differ
index c7b6bc9d5d609ba96d176732cdd4c132cfdd7a11..80b98563f067bba215341e813da49b31d6c02ce0 100644 (file)
@@ -232,9 +232,10 @@ Returns:
   //\r
   // Allocate a block of memory that contain performance data to OS\r
   //\r
+  mAcpiLowMemoryBase = 0xFFFFFFFF;\r
   Status = gBS->AllocatePages (\r
-                  AllocateAnyPages,\r
-                  EfiACPIReclaimMemory,\r
+                  AllocateMaxAddress,\r
+                  EfiReservedMemoryType,\r
                   4,\r
                   &mAcpiLowMemoryBase\r
                   );\r
@@ -242,7 +243,7 @@ Returns:
     return ;\r
   }\r
 \r
-  mAcpiLowMemoryLength  = 0x1000;\r
+  mAcpiLowMemoryLength  = EFI_PAGES_TO_SIZE(4);\r
 \r
   Ptr                   = (UINT8 *) ((UINT32) mAcpiLowMemoryBase + sizeof (PERF_HEADER));\r
   LimitCount            = (mAcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA);\r
@@ -261,7 +262,7 @@ Returns:
                   &Cpu\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+    gBS->FreePages (mAcpiLowMemoryBase, 4);\r
     return ;\r
   }\r
   //\r
@@ -269,7 +270,7 @@ Returns:
   //\r
   Status = Cpu->GetTimerValue (Cpu, 0, &(CurrentTicker), &TimerPeriod);\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+    gBS->FreePages (mAcpiLowMemoryBase, 4);\r
     return ;\r
   }\r
 \r
@@ -294,7 +295,7 @@ Returns:
                   &Handles\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+    gBS->FreePages (mAcpiLowMemoryBase, 4);\r
     return ;\r
   }\r
   //\r