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