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
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
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
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
// 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
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
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
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
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
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
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
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
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
//\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
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
&Cpu\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+ gBS->FreePages (mAcpiLowMemoryBase, 4);\r
return ;\r
}\r
//\r
//\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
&Handles\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+ gBS->FreePages (mAcpiLowMemoryBase, 4);\r
return ;\r
}\r
//\r