summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h11
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf9
-rw-r--r--MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c36
-rw-r--r--MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c51
-rw-r--r--MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf10
-rw-r--r--MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c32
-rw-r--r--MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf5
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf6
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c49
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c29
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c6
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c904
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr3
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.unibin61006 -> 61410 bytes
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c4
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c4
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c108
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h1
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c8
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c5
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c8
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c2
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c2
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c6
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c10
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c142
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c77
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h10
-rw-r--r--MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c8
-rw-r--r--MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c166
-rw-r--r--MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf49
31 files changed, 1259 insertions, 502 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
index d9e6428cb..6541a8450 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.h
@@ -1,7 +1,7 @@
/** @file
ACPI Table Protocol Driver
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -107,15 +107,6 @@ typedef struct {
#define EFI_ACPI_MAX_NUM_TABLES 20
//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID "INTEL "
-#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('E', 'D', 'K', '2', ' ', ' ', ' ', ' ')
-#define EFI_ACPI_OEM_REVISION 0x00000002
-#define EFI_ACPI_CREATOR_ID 0x20202020
-#define EFI_ACPI_CREATOR_REVISION 0x01000013
-
-//
// Protocol private structure definition
//
//
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
index 122a1ff76..8f24d0a9c 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
@@ -1,7 +1,7 @@
## @file
# ACPI Table Protocol Driver
#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials are
# licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -60,6 +60,13 @@
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+
[Protocols]
gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiAcpiSdtProtocolGuid # PROTOCOL ALWAYS_PRODUCED
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index 56a83125e..f8cf99ac2 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -1,7 +1,7 @@
/** @file
ACPI Table Protocol Implementation
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1795,13 +1795,13 @@ AcpiTableAcpiTableConstructor (
//
CurrentData = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
CopyMem (&AcpiTableInstance->Rsdp1->Signature, &CurrentData, sizeof (UINT64));
- CopyMem (AcpiTableInstance->Rsdp1->OemId, EFI_ACPI_OEM_ID, 6);
+ CopyMem (AcpiTableInstance->Rsdp1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp1->OemId));
AcpiTableInstance->Rsdp1->Reserved = EFI_ACPI_RESERVED_BYTE;
AcpiTableInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt1;
CurrentData = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
CopyMem (&AcpiTableInstance->Rsdp3->Signature, &CurrentData, sizeof (UINT64));
- CopyMem (AcpiTableInstance->Rsdp3->OemId, EFI_ACPI_OEM_ID, 6);
+ CopyMem (AcpiTableInstance->Rsdp3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdp3->OemId));
AcpiTableInstance->Rsdp3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION;
AcpiTableInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiTableInstance->Rsdt3;
AcpiTableInstance->Rsdp3->Length = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
@@ -1819,12 +1819,12 @@ AcpiTableAcpiTableConstructor (
AcpiTableInstance->Rsdt1->Signature = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiTableInstance->Rsdt1->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiTableInstance->Rsdt1->Revision = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiTableInstance->Rsdt1->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiTableInstance->Rsdt1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdt1->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiTableInstance->Rsdt1->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiTableInstance->Rsdt1->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiTableInstance->Rsdt1->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiTableInstance->Rsdt1->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiTableInstance->Rsdt1->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiTableInstance->Rsdt1->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiTableInstance->Rsdt1->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
@@ -1834,12 +1834,12 @@ AcpiTableAcpiTableConstructor (
AcpiTableInstance->Rsdt3->Signature = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiTableInstance->Rsdt3->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiTableInstance->Rsdt3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiTableInstance->Rsdt3->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiTableInstance->Rsdt3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Rsdt3->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiTableInstance->Rsdt3->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiTableInstance->Rsdt3->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiTableInstance->Rsdt3->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiTableInstance->Rsdt3->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiTableInstance->Rsdt3->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiTableInstance->Rsdt3->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiTableInstance->Rsdt3->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
@@ -1852,12 +1852,12 @@ AcpiTableAcpiTableConstructor (
AcpiTableInstance->Xsdt->Signature = EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiTableInstance->Xsdt->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiTableInstance->Xsdt->Revision = EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiTableInstance->Xsdt->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiTableInstance->Xsdt->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiTableInstance->Xsdt->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiTableInstance->Xsdt->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiTableInstance->Xsdt->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiTableInstance->Xsdt->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiTableInstance->Xsdt->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiTableInstance->Xsdt->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiTableInstance->Xsdt->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiTableInstance->Xsdt->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
index 207abf780..804ffa5a6 100644
--- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
+++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
@@ -1,7 +1,7 @@
/** @file
This module install ACPI Boot Graphics Resource Table (BGRT).
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -27,15 +27,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
-
-//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID "INTEL"
-#define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "
-#define EFI_ACPI_OEM_REVISION 0x00000001
-#define EFI_ACPI_CREATOR_ID 0x5446534D // TBD "MSFT"
-#define EFI_ACPI_CREATOR_REVISION 0x01000013 // TBD
+#include <Library/PcdLib.h>
//
// Module globals.
@@ -81,13 +73,13 @@ EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE mBootGraphicsResourceTableTemplate = {
EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION, // Revision
0x00, // Checksum will be updated at runtime
//
- // It is expected that these values will be updated at runtime.
+ // It is expected that these values will be updated at EntryPoint.
//
- EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
- EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
- EFI_ACPI_OEM_REVISION, // OEM revision number
- EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
- EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
+ {0x00}, // OEM ID is a 6 bytes long field
+ 0x00, // OEM Table ID(8 bytes long)
+ 0x00, // OEM Revision
+ 0x00, // Creator ID
+ 0x00, // Creator Revision
},
EFI_ACPI_5_0_BGRT_VERSION, // Version
EFI_ACPI_5_0_BGRT_STATUS_VALID, // Status
@@ -235,9 +227,9 @@ BgrtAcpiTableChecksum (
}
/**
- Allocate EfiReservedMemoryType below 4G memory address.
+ Allocate EfiBootServicesData below 4G memory address.
- This function allocates EfiReservedMemoryType below 4G memory address.
+ This function allocates EfiBootServicesData below 4G memory address.
@param[in] Size Size of memory to allocate.
@@ -245,7 +237,7 @@ BgrtAcpiTableChecksum (
**/
VOID *
-BgrtAllocateReservedMemoryBelow4G (
+BgrtAllocateBsDataMemoryBelow4G (
IN UINTN Size
)
{
@@ -259,7 +251,7 @@ BgrtAllocateReservedMemoryBelow4G (
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiReservedMemoryType,
+ EfiBootServicesData,
Pages,
&Address
);
@@ -361,9 +353,12 @@ InstallBootGraphicsResourceTable (
if (mLogoHeight > (((UINT32) ~0) - sizeof (BMP_IMAGE_HEADER)) / (mLogoWidth * 3 + PaddingSize)) {
return EFI_UNSUPPORTED;
}
-
+
+ //
+ // The image should be stored in EfiBootServicesData, allowing the system to reclaim the memory
+ //
BmpSize = (mLogoWidth * 3 + PaddingSize) * mLogoHeight + sizeof (BMP_IMAGE_HEADER);
- ImageBuffer = BgrtAllocateReservedMemoryBelow4G (BmpSize);
+ ImageBuffer = BgrtAllocateBsDataMemoryBelow4G (BmpSize);
if (ImageBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -464,6 +459,18 @@ BootGraphicsDxeEntryPoint (
)
{
EFI_STATUS Status;
+ UINT64 OemTableId;
+
+ CopyMem (
+ mBootGraphicsResourceTableTemplate.Header.OemId,
+ PcdGetPtr (PcdAcpiDefaultOemId),
+ sizeof (mBootGraphicsResourceTableTemplate.Header.OemId)
+ );
+ OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
+ CopyMem (&mBootGraphicsResourceTableTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64));
+ mBootGraphicsResourceTableTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ mBootGraphicsResourceTableTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ mBootGraphicsResourceTableTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// Install Boot Logo protocol.
diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
index c2d051862..f953d497d 100644
--- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
+++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
@@ -1,7 +1,7 @@
## @file
# This module install ACPI Boot Graphics Resource Table (BGRT).
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -41,10 +41,18 @@
UefiLib
UefiBootServicesTableLib
DebugLib
+ PcdLib
[Protocols]
gEfiAcpiTableProtocolGuid ## SOMETIMES_CONSUMES
gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+
[Guids]
gEfiEventReadyToBootGuid ## CONSUMES
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c
index f834778ac..9ea8f5c6b 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.c
@@ -41,14 +41,6 @@
#include <Library/LockBoxLib.h>
#include <Library/UefiLib.h>
-//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID "INTEL"
-#define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "
-#define EFI_ACPI_OEM_REVISION 0x00000001
-#define EFI_ACPI_CREATOR_ID 0x5446534D // TBD "MSFT"
-#define EFI_ACPI_CREATOR_REVISION 0x01000013 // TBD
#define EXTENSION_RECORD_SIZE 0x10000
#define SMM_BOOT_RECORD_COMM_SIZE OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + sizeof(SMM_BOOT_RECORD_COMMUNICATE)
@@ -73,13 +65,13 @@ FIRMWARE_PERFORMANCE_TABLE mFirmwarePerformanceTableTemplate = {
EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION, // Revision
0x00, // Checksum will be updated at runtime
//
- // It is expected that these values will be updated at runtime.
+ // It is expected that these values will be updated at EntryPoint.
//
- EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
- EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
- EFI_ACPI_OEM_REVISION, // OEM revision number
- EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
- EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
+ {0x00}, // OEM ID is a 6 bytes long field
+ 0x00, // OEM Table ID(8 bytes long)
+ 0x00, // OEM Revision
+ 0x00, // Creator ID
+ 0x00, // Creator Revision
},
//
// Firmware Basic Boot Performance Table Pointer Record.
@@ -788,6 +780,18 @@ FirmwarePerformanceDxeEntryPoint (
EFI_HOB_GUID_TYPE *GuidHob;
FIRMWARE_SEC_PERFORMANCE *Performance;
VOID *Registration;
+ UINT64 OemTableId;
+
+ CopyMem (
+ mFirmwarePerformanceTableTemplate.Header.OemId,
+ PcdGetPtr (PcdAcpiDefaultOemId),
+ sizeof (mFirmwarePerformanceTableTemplate.Header.OemId)
+ );
+ OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
+ CopyMem (&mFirmwarePerformanceTableTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64));
+ mFirmwarePerformanceTableTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ mFirmwarePerformanceTableTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ mFirmwarePerformanceTableTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// Get Report Status Code Handler Protocol.
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
index 5a9628f92..e1c69e0c1 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
@@ -75,6 +75,11 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart
gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
index 3354fb7fc..7767e6834 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
@@ -5,7 +5,7 @@
# It installs the Capsule Architectural Protocol defined in PI1.0a to signify
# the capsule runtime services are ready.
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -53,7 +53,8 @@
UefiRuntimeLib
BaseLib
PrintLib
-
+ BaseMemoryLib
+
[LibraryClasses.X64]
LockBoxLib
UefiLib
@@ -62,6 +63,7 @@
[Guids]
gEfiCapsuleVendorGuid ## SOMETIMES_PRODUCED (Process across reset capsule image) ## Variable:L"CapsuleUpdateData" for capsule updated data
+ gEfiFmpCapsuleGuid ## FMP capsule GUID
[Guids.X64]
gEfiAcpiVariableGuid # ALWAYS_CONSUMED
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index 17f167c97..0861a6477 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -4,7 +4,7 @@
It installs the Capsule Architectural Protocol defined in PI1.0a to signify
the capsule runtime services are ready.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/Capsule.h>
#include <Guid/CapsuleVendor.h>
+#include <Guid/FmpCapsule.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
@@ -29,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiRuntimeLib.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
-
+#include <Library/BaseMemoryLib.h>
//
// Handle for the installation of Capsule Architecture Protocol.
//
@@ -73,6 +74,11 @@ SaveLongModeContext (
@retval EFI_INVALID_PARAMETER CapsuleCount is Zero.
@retval EFI_INVALID_PARAMETER For across reset capsule image, ScatterGatherList is NULL.
@retval EFI_UNSUPPORTED CapsuleImage is not recognized by the firmware.
+ @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule
+ is compatible with this platform but is not capable of being submitted or processed
+ in runtime. The caller may resubmit the capsule prior to ExitBootServices().
+ @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates
+ the capsule is compatible with this platform but there are insufficient resources to process.
**/
EFI_STATUS
@@ -119,12 +125,23 @@ UpdateCapsule (
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET)) == CAPSULE_FLAGS_INITIATE_RESET) {
return EFI_INVALID_PARAMETER;
}
+
+ //
+ // Check FMP capsule flag
+ //
+ if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)
+ && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// Check Capsule image without populate flag by firmware support capsule function
//
- if (((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) &&
- (SupportCapsuleImage (CapsuleHeader) != EFI_SUCCESS)) {
- return EFI_UNSUPPORTED;
+ if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ Status = SupportCapsuleImage (CapsuleHeader);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
}
}
@@ -140,7 +157,7 @@ UpdateCapsule (
//
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) == 0) {
if (EfiAtRuntime ()) {
- Status = EFI_UNSUPPORTED;
+ Status = EFI_OUT_OF_RESOURCES;
} else {
Status = ProcessCapsuleImage(CapsuleHeader);
}
@@ -245,6 +262,7 @@ QueryCapsuleCapabilities (
OUT EFI_RESET_TYPE *ResetType
)
{
+ EFI_STATUS Status;
UINTN ArrayNumber;
EFI_CAPSULE_HEADER *CapsuleHeader;
BOOLEAN NeedReset;
@@ -282,12 +300,23 @@ QueryCapsuleCapabilities (
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET)) == CAPSULE_FLAGS_INITIATE_RESET) {
return EFI_INVALID_PARAMETER;
}
+
+ //
+ // Check FMP capsule flag
+ //
+ if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)
+ && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// Check Capsule image without populate flag is supported by firmware
//
- if (((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) &&
- (SupportCapsuleImage (CapsuleHeader) != EFI_SUCCESS)) {
- return EFI_UNSUPPORTED;
+ if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ Status = SupportCapsuleImage (CapsuleHeader);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
}
}
@@ -301,7 +330,7 @@ QueryCapsuleCapabilities (
break;
}
}
-
+
if (NeedReset) {
//
//Check if the platform supports update capsule across a system reset
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index ba6130091..f53c3d91d 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -403,8 +403,6 @@ DiskIo2OnReadWriteComplete (
EFI_STATUS TransactionStatus;
DISK_IO_PRIVATE_DATA *Instance;
- gBS->CloseEvent (Event);
-
Subtask = (DISK_IO_SUBTASK *) Context;
TransactionStatus = Subtask->BlockIo2Token.TransactionStatus;
Task = Subtask->Task;
@@ -414,26 +412,13 @@ DiskIo2OnReadWriteComplete (
ASSERT (Instance->Signature == DISK_IO_PRIVATE_DATA_SIGNATURE);
ASSERT (Task->Signature == DISK_IO2_TASK_SIGNATURE);
- if (Subtask->WorkingBuffer != NULL) {
- if (!EFI_ERROR (TransactionStatus) && (Task->Token != NULL) && !Subtask->Write) {
- CopyMem (Subtask->Buffer, Subtask->WorkingBuffer + Subtask->Offset, Subtask->Length);
- }
-
- //
- // The WorkingBuffer of blocking subtask either points to SharedWorkingBuffer
- // or will be used by non-blocking subtask which will be freed below.
- //
- if (!Subtask->Blocking) {
- FreeAlignedPages (
- Subtask->WorkingBuffer,
- Subtask->Length < Instance->BlockIo->Media->BlockSize
- ? EFI_SIZE_TO_PAGES (Instance->BlockIo->Media->BlockSize)
- : EFI_SIZE_TO_PAGES (Subtask->Length)
- );
- }
+ if ((Subtask->WorkingBuffer != NULL) && !EFI_ERROR (TransactionStatus) &&
+ (Task->Token != NULL) && !Subtask->Write
+ ) {
+ CopyMem (Subtask->Buffer, Subtask->WorkingBuffer + Subtask->Offset, Subtask->Length);
}
- RemoveEntryList (&Subtask->Link);
- FreePool (Subtask);
+
+ DiskIoDestroySubtask (Instance, Subtask);
if (EFI_ERROR (TransactionStatus) || IsListEmpty (&Task->Subtasks)) {
if (Task->Token != NULL) {
@@ -961,7 +946,7 @@ DiskIo2ReadWriteDisk (
RemoveEntryList (&Task->Link);
EfiReleaseLock (&Instance->TaskQueueLock);
- if (Task->Token != NULL) {
+ if (!EFI_ERROR (Status) && (Task->Token != NULL)) {
//
// Task->Token should be set to NULL by the DiskIo2OnReadWriteComplete
// It it's not, that means the non-blocking request was downgraded to blocking request.
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 5cc1397e7..7fb2c0dfe 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -352,11 +352,11 @@ PartitionDriverBindingStart (
ControllerHandle
);
//
- // Close Parent BlockIO2 if has.
+ // Close Parent DiskIo2 if has.
//
gBS->CloseProtocol (
ControllerHandle,
- &gEfiBlockIo2ProtocolGuid,
+ &gEfiDiskIo2ProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
@@ -822,7 +822,7 @@ PartitionCreateAccessTask (
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
+ TPL_NOTIFY,
PartitionOnAccessComplete,
Task,
&Task->DiskIo2Token.Event
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index a07cc75a4..9f6c96315 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -130,6 +130,7 @@ CHAR16 *gOptionMismatch;
CHAR16 *gFormSuppress;
CHAR16 *gProtocolNotFound;
+CHAR16 gModalSkipColumn;
CHAR16 gPromptBlockWidth;
CHAR16 gOptionBlockWidth;
CHAR16 gHelpBlockWidth;
@@ -258,20 +259,35 @@ GetPrompt (
/**
Get the supported width for a particular op-code
- @param Statement The curent statement.
+ @param MenuOption The menu option.
+ @param AdjustWidth The width which is saved for the space.
@return Returns the number of CHAR16 characters that is support.
**/
UINT16
GetWidth (
- IN FORM_DISPLAY_ENGINE_STATEMENT *Statement
+ IN UI_MENU_OPTION *MenuOption,
+ OUT UINT16 *AdjustWidth
)
{
- CHAR16 *String;
- UINTN Size;
- UINT16 Width;
- EFI_IFR_TEXT *TestOp;
+ CHAR16 *String;
+ UINTN Size;
+ EFI_IFR_TEXT *TestOp;
+ UINT16 ReturnWidth;
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+
+ Statement = MenuOption->ThisTag;
+
+ //
+ // For modal form, clean the entire row.
+ //
+ if ((gFormData->Attribute & HII_DISPLAY_MODAL) != 0) {
+ if (AdjustWidth != NULL) {
+ *AdjustWidth = LEFT_SKIPPED_COLUMNS;
+ }
+ return (UINT16)(gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * (gModalSkipColumn + LEFT_SKIPPED_COLUMNS));
+ }
Size = 0;
@@ -297,12 +313,33 @@ GetWidth (
//
((Statement->OpCode->OpCode == EFI_IFR_TEXT_OP) && (Size == 0))
) {
- Width = (UINT16) (gPromptBlockWidth + gOptionBlockWidth);
+
+ //
+ // Return the space width.
+ //
+ if (AdjustWidth != NULL) {
+ *AdjustWidth = 2;
+ }
+ //
+ // Keep consistent with current behavior.
+ //
+ ReturnWidth = (UINT16) (gPromptBlockWidth + gOptionBlockWidth - 2);
} else {
- Width = (UINT16) gPromptBlockWidth;
+ if (AdjustWidth != NULL) {
+ *AdjustWidth = 1;
+ }
+
+ ReturnWidth = (UINT16) (gPromptBlockWidth - 1);
}
- return (UINT16) (Width - LEFT_SKIPPED_COLUMNS);
+ //
+ // For nest in statement, should the subtitle indent.
+ //
+ if (MenuOption->NestInStatement) {
+ ReturnWidth -= SUBTITLE_INDENT;
+ }
+
+ return ReturnWidth;
}
/**
@@ -516,24 +553,7 @@ UiAddMenuOption (
String = GetToken (PromptId, gFormData->HiiHandle);
ASSERT (String != NULL);
- Width = GetWidth (Statement);
- for (; GetLineByWidth (String, Width, &GlyphWidth,&ArrayEntry, &OutputString) != 0x0000;) {
- //
- // If there is more string to process print on the next row and increment the Skip value
- //
- if (StrLen (&String[ArrayEntry]) != 0) {
- NumberOfLines++;
- }
- FreePool (OutputString);
- }
-
if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
- //
- // Add three MenuOptions for Date/Time
- // Data format : [01/02/2004] [11:22:33]
- // Line number : 0 0 1 0 0 1
- //
- NumberOfLines = 0;
Count = 3;
}
@@ -548,14 +568,6 @@ UiAddMenuOption (
MenuOption->NestInStatement = NestIn;
MenuOption->EntryNumber = *MenuItemCount;
- if (Index == 2) {
- //
- // Override LineNumber for the MenuOption in Date/Time sequence
- //
- MenuOption->Skip = 1;
- } else {
- MenuOption->Skip = NumberOfLines;
- }
MenuOption->Sequence = Index;
if ((Statement->Attribute & HII_DISPLAY_GRAYOUT) != 0) {
@@ -610,6 +622,37 @@ UiAddMenuOption (
}
}
+ if (Index == 0 &&
+ (Statement->OpCode->OpCode != EFI_IFR_DATE_OP) &&
+ (Statement->OpCode->OpCode != EFI_IFR_TIME_OP)) {
+ Width = GetWidth (MenuOption, NULL);
+ for (; GetLineByWidth (String, Width, &GlyphWidth,&ArrayEntry, &OutputString) != 0x0000;) {
+ //
+ // If there is more string to process print on the next row and increment the Skip value
+ //
+ if (StrLen (&String[ArrayEntry]) != 0) {
+ NumberOfLines++;
+ }
+ FreePool (OutputString);
+ }
+ } else {
+ //
+ // Add three MenuOptions for Date/Time
+ // Data format : [01/02/2004] [11:22:33]
+ // Line number : 0 0 1 0 0 1
+ //
+ NumberOfLines = 0;
+ }
+
+ if (Index == 2) {
+ //
+ // Override LineNumber for the MenuOption in Date/Time sequence
+ //
+ MenuOption->Skip = 1;
+ } else {
+ MenuOption->Skip = NumberOfLines;
+ }
+
InsertTailList (&gMenuOption, &MenuOption->Link);
}
@@ -1438,6 +1481,411 @@ FindTopMenu (
}
/**
+ Update highlight menu info.
+
+ @param MenuOption The menu opton which is highlight.
+
+**/
+VOID
+UpdateHighlightMenuInfo (
+ IN UI_MENU_OPTION *MenuOption
+ )
+{
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+
+ //
+ // This is the current selected statement
+ //
+ Statement = MenuOption->ThisTag;
+
+ //
+ // Get the highlight statement.
+ //
+ gUserInput->SelectedStatement = Statement;
+ gSequence = (UINT16) MenuOption->Sequence;
+
+ //
+ // Record highlight row info for date/time opcode.
+ //
+ if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
+ gHighligthMenuInfo.QuestionId = GetQuestionIdInfo(Statement->OpCode);
+ gHighligthMenuInfo.DisplayRow = (UINT16) MenuOption->Row;
+ } else {
+ gHighligthMenuInfo.QuestionId = 0;
+ gHighligthMenuInfo.DisplayRow = 0;
+ }
+
+ RefreshKeyHelp(gFormData, Statement, FALSE);
+}
+
+/**
+ Update attribut for this menu.
+
+ @param MenuOption The menu opton which this attribut used to.
+ @param Highlight Whether this menu will be highlight.
+
+**/
+VOID
+SetDisplayAttribute (
+ IN UI_MENU_OPTION *MenuOption,
+ IN BOOLEAN Highlight
+ )
+{
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+
+ Statement = MenuOption->ThisTag;
+
+ if (Highlight) {
+ gST->ConOut->SetAttribute (gST->ConOut, GetHighlightTextColor ());
+ return;
+ }
+
+ if (MenuOption->GrayOut) {
+ gST->ConOut->SetAttribute (gST->ConOut, GetGrayedTextColor ());
+ } else {
+ if (Statement->OpCode->OpCode == EFI_IFR_SUBTITLE_OP) {
+ gST->ConOut->SetAttribute (gST->ConOut, GetSubTitleTextColor ());
+ } else {
+ gST->ConOut->SetAttribute (gST->ConOut, GetFieldTextColor ());
+ }
+ }
+}
+
+/**
+ Print string for this menu option.
+
+ @param MenuOption The menu opton which this attribut used to.
+ @param Col The column that this string will be print at.
+ @param Row The row that this string will be print at.
+ @param String The string which need to print.
+ @param Width The width need to print, if string is less than the
+ width, the block space will be used.
+ @param Highlight Whether this menu will be highlight.
+
+**/
+VOID
+DisplayMenuString (
+ IN UI_MENU_OPTION *MenuOption,
+ IN UINTN Col,
+ IN UINTN Row,
+ IN CHAR16 *String,
+ IN UINTN Width,
+ IN BOOLEAN Highlight
+ )
+{
+ UINTN Length;
+
+ //
+ // Print string with normal color.
+ //
+ if (!Highlight) {
+ PrintStringAtWithWidth (Col, Row, String, Width);
+ return;
+ }
+
+ //
+ // Print the highlight menu string.
+ // First print the highlight string.
+ //
+ SetDisplayAttribute(MenuOption, TRUE);
+ Length = PrintStringAt (Col, Row, String);
+
+ //
+ // Second, clean the empty after the string.
+ //
+ SetDisplayAttribute(MenuOption, FALSE);
+ PrintStringAtWithWidth (Col + Length, Row, L"", Width - Length);
+}
+
+/**
+ Check whether this menu can has option string.
+
+ @param MenuOption The menu opton which this attribut used to.
+
+ @retval TRUE This menu option can have option string.
+ @retval FALSE This menu option can't have option string.
+
+**/
+BOOLEAN
+HasOptionString (
+ IN UI_MENU_OPTION *MenuOption
+ )
+{
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+ CHAR16 *String;
+ UINTN Size;
+ EFI_IFR_TEXT *TestOp;
+
+ Size = 0;
+ Statement = MenuOption->ThisTag;
+
+ //
+ // See if the second text parameter is really NULL
+ //
+ if (Statement->OpCode->OpCode == EFI_IFR_TEXT_OP) {
+ TestOp = (EFI_IFR_TEXT *) Statement->OpCode;
+ if (TestOp->TextTwo != 0) {
+ String = GetToken (TestOp->TextTwo, gFormData->HiiHandle);
+ Size = StrLen (String);
+ FreePool (String);
+ }
+ }
+
+ if ((Statement->OpCode->OpCode == EFI_IFR_SUBTITLE_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_REF_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_PASSWORD_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_ACTION_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_RESET_BUTTON_OP) ||
+ //
+ // Allow a wide display if text op-code and no secondary text op-code
+ //
+ ((Statement->OpCode->OpCode == EFI_IFR_TEXT_OP) && (Size == 0))
+ ) {
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/**
+ Print string for this menu option.
+
+ @param MenuOption The menu opton which this attribut used to.
+ @param SkipWidth The skip width between the left to the start of the prompt.
+ @param BeginCol The begin column for one menu.
+ @param SkipLine The skip line for this menu.
+ @param BottomRow The bottom row for this form.
+ @param Highlight Whether this menu will be highlight.
+
+ @retval EFI_SUCESSS Process the user selection success.
+
+**/
+EFI_STATUS
+DisplayOneMenu (
+ IN UI_MENU_OPTION *MenuOption,
+ IN UINTN SkipWidth,
+ IN UINTN BeginCol,
+ IN UINTN SkipLine,
+ IN UINTN BottomRow,
+ IN BOOLEAN Highlight
+ )
+{
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+ UINTN Index;
+ UINT16 Width;
+ UINT16 PromptWidth;
+ CHAR16 *StringPtr;
+ CHAR16 *OptionString;
+ CHAR16 *OutputString;
+ UINT16 GlyphWidth;
+ UINTN Temp;
+ UINTN Temp2;
+ UINTN Temp3;
+ EFI_STATUS Status;
+ UINTN Row;
+ UINTN Col;
+ UINTN PromptLineNum;
+ UINTN OptionLineNum;
+ CHAR16 AdjustValue;
+ UINTN MaxRow;
+
+ Statement = MenuOption->ThisTag;
+ Temp = SkipLine;
+ Temp2 = SkipLine;
+ Temp3 = SkipLine;
+ AdjustValue = 0;
+ PromptLineNum = 0;
+ OptionLineNum = 0;
+ MaxRow = 0;
+
+ //
+ // Set default color.
+ //
+ SetDisplayAttribute (MenuOption, FALSE);
+
+ //
+ // 1. Paint the option string.
+ //
+ Status = ProcessOptions (MenuOption, FALSE, &OptionString, FALSE);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ if (OptionString != NULL) {
+ if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
+ //
+ // Adjust option string for date/time opcode.
+ //
+ ProcessStringForDateTime(MenuOption, OptionString, TRUE);
+ }
+
+ Width = (UINT16) gOptionBlockWidth - 1;
+ Row = MenuOption->Row;
+ GlyphWidth = 1;
+ OptionLineNum = 0;
+
+ for (Index = 0; GetLineByWidth (OptionString, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
+ if (((Temp2 == 0)) && (Row <= BottomRow)) {
+ if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
+ //
+ // For date/time question, it has three menu options for this qustion.
+ // The first/second menu options with the skip value is 0. the last one
+ // with skip value is 1.
+ //
+ if (MenuOption->Skip != 0) {
+ //
+ // For date/ time, print the last past (year for date and second for time)
+ // - 7 means skip [##/##/ for date and [##:##: for time.
+ //
+ DisplayMenuString (MenuOption,MenuOption->OptCol, Row, OutputString, Width + 1 - 7, Highlight);
+ } else {
+ //
+ // For date/ time, print the first and second past (year for date and second for time)
+ //
+ DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString), Highlight);
+ }
+ } else {
+ DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight);
+ }
+ OptionLineNum++;
+ }
+
+ //
+ // If there is more string to process print on the next row and increment the Skip value
+ //
+ if (StrLen (&OptionString[Index]) != 0) {
+ if (Temp2 == 0) {
+ Row++;
+ //
+ // Since the Number of lines for this menu entry may or may not be reflected accurately
+ // since the prompt might be 1 lines and option might be many, and vice versa, we need to do
+ // some testing to ensure we are keeping this in-sync.
+ //
+ // If the difference in rows is greater than or equal to the skip value, increase the skip value
+ //
+ if ((Row - MenuOption->Row) >= MenuOption->Skip) {
+ MenuOption->Skip++;
+ }
+ }
+ }
+
+ FreePool (OutputString);
+ if (Temp2 != 0) {
+ Temp2--;
+ }
+ }
+
+ Highlight = FALSE;
+
+ FreePool (OptionString);
+ }
+
+ //
+ // 2. Paint the description.
+ //
+ PromptWidth = GetWidth (MenuOption, &AdjustValue);
+ Row = MenuOption->Row;
+ GlyphWidth = 1;
+ PromptLineNum = 0;
+
+ if (MenuOption->Description == NULL || MenuOption->Description[0] == '\0') {
+ PrintStringAtWithWidth (BeginCol, Row, L"", PromptWidth + AdjustValue + SkipWidth);
+ PromptLineNum++;
+ } else {
+ for (Index = 0; GetLineByWidth (MenuOption->Description, PromptWidth, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
+ if ((Temp == 0) && (Row <= BottomRow)) {
+ //
+ // 1.Clean the start LEFT_SKIPPED_COLUMNS
+ //
+ PrintStringAtWithWidth (BeginCol, Row, L"", SkipWidth);
+
+ if (Statement->OpCode->OpCode == EFI_IFR_REF_OP && MenuOption->Col >= 2) {
+ //
+ // Print Arrow for Goto button.
+ //
+ PrintCharAt (
+ MenuOption->Col - 2,
+ Row,
+ GEOMETRICSHAPE_RIGHT_TRIANGLE
+ );
+ }
+ DisplayMenuString (MenuOption, MenuOption->Col, Row, OutputString, PromptWidth + AdjustValue, Highlight);
+ PromptLineNum ++;
+ }
+ //
+ // If there is more string to process print on the next row and increment the Skip value
+ //
+ if (StrLen (&MenuOption->Description[Index]) != 0) {
+ if (Temp == 0) {
+ Row++;
+ }
+ }
+
+ FreePool (OutputString);
+ if (Temp != 0) {
+ Temp--;
+ }
+ }
+
+ Highlight = FALSE;
+ }
+
+
+ //
+ // 3. If this is a text op with secondary text information
+ //
+ if ((Statement->OpCode->OpCode == EFI_IFR_TEXT_OP) && (((EFI_IFR_TEXT*)Statement->OpCode)->TextTwo != 0)) {
+ StringPtr = GetToken (((EFI_IFR_TEXT*)Statement->OpCode)->TextTwo, gFormData->HiiHandle);
+
+ Width = (UINT16) gOptionBlockWidth - 1;
+ Row = MenuOption->Row;
+ GlyphWidth = 1;
+ OptionLineNum = 0;
+
+ for (Index = 0; GetLineByWidth (StringPtr, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
+ if ((Temp3 == 0) && (Row <= BottomRow)) {
+ DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight);
+ OptionLineNum++;
+ }
+ //
+ // If there is more string to process print on the next row and increment the Skip value
+ //
+ if (StrLen (&StringPtr[Index]) != 0) {
+ if (Temp3 == 0) {
+ Row++;
+ }
+ }
+
+ FreePool (OutputString);
+ if (Temp3 != 0) {
+ Temp3--;
+ }
+ }
+
+ FreePool (StringPtr);
+ }
+
+ //
+ // 4.Line number for Option string and prompt string are not equal.
+ // Clean the column whose line number is less.
+ //
+ if (HasOptionString(MenuOption) && (OptionLineNum != PromptLineNum)) {
+ Col = OptionLineNum < PromptLineNum ? MenuOption->OptCol : BeginCol;
+ Row = (OptionLineNum < PromptLineNum ? OptionLineNum : PromptLineNum) + MenuOption->Row;
+ Width = (UINT16) (OptionLineNum < PromptLineNum ? gOptionBlockWidth : PromptWidth + AdjustValue + SkipWidth);
+ MaxRow = (OptionLineNum < PromptLineNum ? PromptLineNum : OptionLineNum) + MenuOption->Row - 1;
+
+ while (Row <= MaxRow) {
+ DisplayMenuString (MenuOption, Col, Row++, L"", Width, FALSE);
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
Display menu and wait for user to select one menu option, then return it.
If AutoBoot is enabled, then if user doesn't select any option,
after period of time, it will automatically return the first menu option.
@@ -1458,10 +1906,8 @@ UiDisplayMenu (
UINTN DistanceValue;
UINTN Row;
UINTN Col;
- UINTN TempRightCol;
UINTN Temp;
UINTN Temp2;
- UINTN Temp3;
UINTN TopRow;
UINTN BottomRow;
UINTN OriginalRow;
@@ -1491,7 +1937,6 @@ UiDisplayMenu (
UI_SCREEN_OPERATION ScreenOperation;
UINT16 DefaultId;
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
- UINTN ModalSkipColumn;
BROWSER_HOT_KEY *HotKey;
UINTN HelpPageIndex;
UINTN HelpPageCount;
@@ -1507,6 +1952,7 @@ UiDisplayMenu (
EFI_STRING_ID HelpInfo;
UI_EVENT_TYPE EventType;
FORM_DISPLAY_ENGINE_STATEMENT *InitialHighlight;
+ BOOLEAN SkipHighLight;
EventType = UIEventNone;
Status = EFI_SUCCESS;
@@ -1531,6 +1977,7 @@ UiDisplayMenu (
UpArrow = FALSE;
DownArrow = FALSE;
SkipValue = 0;
+ SkipHighLight = FALSE;
NextMenuOption = NULL;
PreviousMenuOption = NULL;
@@ -1538,21 +1985,27 @@ UiDisplayMenu (
HotKey = NULL;
Repaint = TRUE;
MenuOption = NULL;
- ModalSkipColumn = (gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn) / 6;
+ gModalSkipColumn = (CHAR16) (gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn) / 6;
InitialHighlight = gFormData->HighLightedStatement;
ZeroMem (&Key, sizeof (EFI_INPUT_KEY));
- gOptionBlockWidth = (CHAR16) ((gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn) / 3);
- gPromptBlockWidth = (CHAR16) (gOptionBlockWidth + LEFT_SKIPPED_COLUMNS);
- gHelpBlockWidth = (CHAR16) (gOptionBlockWidth - LEFT_SKIPPED_COLUMNS);
+ //
+ // Left right
+ // |<-.->|<-.........->|<- .........->|<-...........->|
+ // Skip Prompt Option Help
+ //
+ Width = (CHAR16) ((gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn) / 3);
+ gOptionBlockWidth = Width + 1;
+ gHelpBlockWidth = (CHAR16) (Width - LEFT_SKIPPED_COLUMNS);
+ gPromptBlockWidth = (CHAR16) (gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * Width - 1);
TopRow = gStatementDimensions.TopRow + SCROLL_ARROW_HEIGHT;
BottomRow = gStatementDimensions.BottomRow - SCROLL_ARROW_HEIGHT - 1;
Row = TopRow;
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
- Col = gStatementDimensions.LeftColumn + LEFT_SKIPPED_COLUMNS + ModalSkipColumn;
+ Col = gStatementDimensions.LeftColumn + LEFT_SKIPPED_COLUMNS + gModalSkipColumn;
} else {
Col = gStatementDimensions.LeftColumn + LEFT_SKIPPED_COLUMNS;
}
@@ -1565,30 +2018,21 @@ UiDisplayMenu (
while (TRUE) {
switch (ControlFlag) {
case CfInitialization:
- if (IsListEmpty (&gMenuOption)) {
-
- if ((FormData->Attribute & HII_DISPLAY_MODAL) == 0) {
- //
- // Clear Statement range.
- //
- ClearLines (
- gStatementDimensions.LeftColumn,
- gStatementDimensions.RightColumn,
- TopRow - SCROLL_ARROW_HEIGHT,
- BottomRow + SCROLL_ARROW_HEIGHT,
- GetFieldTextColor ()
- );
-
- //
- // Clear Key Range
- //
- RefreshKeyHelp (gFormData, NULL, FALSE);
- }
+ if ((gOldFormEntry.HiiHandle != FormData->HiiHandle) ||
+ (!CompareGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid))) {
+ //
+ // Clear Statement range if different formset is painted.
+ //
+ ClearLines (
+ gStatementDimensions.LeftColumn,
+ gStatementDimensions.RightColumn,
+ TopRow - SCROLL_ARROW_HEIGHT,
+ BottomRow + SCROLL_ARROW_HEIGHT,
+ GetFieldTextColor ()
+ );
- ControlFlag = CfReadKey;
- } else {
- ControlFlag = CfRepaint;
}
+ ControlFlag = CfRepaint;
break;
case CfRepaint:
@@ -1602,47 +2046,28 @@ UiDisplayMenu (
UpArrow = FALSE;
Row = TopRow;
- Temp = (UINTN) SkipValue;
- Temp2 = (UINTN) SkipValue;
- Temp3 = (UINTN) SkipValue;
-
+ gST->ConOut->SetAttribute (gST->ConOut, GetFieldTextColor ());
+
//
- // 1. Clear the screen.
+ // 1. Check whether need to print the arrow up.
//
+ if (!ValueIsScroll (TRUE, TopOfScreen)) {
+ UpArrow = TRUE;
+ }
+
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
- ClearLines (
- gStatementDimensions.LeftColumn + ModalSkipColumn,
- gStatementDimensions.LeftColumn + ModalSkipColumn + gPromptBlockWidth + gOptionBlockWidth,
- TopRow - SCROLL_ARROW_HEIGHT,
- BottomRow + SCROLL_ARROW_HEIGHT,
- GetFieldTextColor ()
- );
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, TopRow - 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * gModalSkipColumn);
} else {
- TempRightCol = gStatementDimensions.RightColumn;
- if (!mStatementLayoutIsChanged) {
- TempRightCol = gStatementDimensions.RightColumn - gHelpBlockWidth;
- }
- ClearLines (
- gStatementDimensions.LeftColumn,
- gStatementDimensions.RightColumn,
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn, TopRow - 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
+ }
+ if (UpArrow) {
+ gST->ConOut->SetAttribute (gST->ConOut, GetArrowColor ());
+ PrintCharAt (
+ gStatementDimensions.LeftColumn + gPromptBlockWidth + gOptionBlockWidth + 1,
TopRow - SCROLL_ARROW_HEIGHT,
- TopRow - 1,
- GetFieldTextColor ()
- );
- ClearLines (
- gStatementDimensions.LeftColumn,
- TempRightCol,
- TopRow,
- BottomRow,
- GetFieldTextColor ()
- );
- ClearLines (
- gStatementDimensions.LeftColumn,
- gStatementDimensions.RightColumn,
- BottomRow + 1,
- BottomRow + SCROLL_ARROW_HEIGHT,
- GetFieldTextColor ()
+ ARROW_UP
);
+ gST->ConOut->SetAttribute (gST->ConOut, GetFieldTextColor ());
}
//
@@ -1653,169 +2078,44 @@ UiDisplayMenu (
MenuOption->Row = Row;
MenuOption->Col = Col;
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
- MenuOption->OptCol = gPromptBlockWidth + 1 + gStatementDimensions.LeftColumn + ModalSkipColumn;
+ MenuOption->OptCol = gStatementDimensions.LeftColumn + LEFT_SKIPPED_COLUMNS + gPromptBlockWidth + gModalSkipColumn;
} else {
- MenuOption->OptCol = gPromptBlockWidth + 1 + gStatementDimensions.LeftColumn;
+ MenuOption->OptCol = gStatementDimensions.LeftColumn + LEFT_SKIPPED_COLUMNS + gPromptBlockWidth;
}
- Statement = MenuOption->ThisTag;
if (MenuOption->NestInStatement) {
MenuOption->Col += SUBTITLE_INDENT;
}
- if (MenuOption->GrayOut) {
- gST->ConOut->SetAttribute (gST->ConOut, GetGrayedTextColor ());
- } else {
- if (Statement->OpCode->OpCode == EFI_IFR_SUBTITLE_OP) {
- gST->ConOut->SetAttribute (gST->ConOut, GetSubTitleTextColor ());
- }
- }
-
- Width = GetWidth (Statement);
- OriginalRow = Row;
- GlyphWidth = 1;
-
- if (Statement->OpCode->OpCode == EFI_IFR_REF_OP && MenuOption->Col >= 2) {
- //
- // Print Arrow for Goto button.
- //
- PrintCharAt (
- MenuOption->Col - 2,
- Row,
- GEOMETRICSHAPE_RIGHT_TRIANGLE
- );
- }
-
//
- // 2.1. Paint the description.
+ // Save the highlight menu, will be used in CfRefreshHighLight case.
//
- for (Index = 0; GetLineByWidth (MenuOption->Description, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
- //
- // Temp means need to skip how many lines from the start.
- //
- if ((Temp == 0) && (Row <= BottomRow)) {
- PrintStringAt (MenuOption->Col, Row, OutputString);
- }
- //
- // If there is more string to process print on the next row and increment the Skip value
- //
- if (StrLen (&MenuOption->Description[Index]) != 0) {
- if (Temp == 0) {
- Row++;
- }
- }
-
- FreePool (OutputString);
- if (Temp != 0) {
- Temp--;
- }
+ if (Link == NewPos) {
+ SavedMenuOption = MenuOption;
+ SkipHighLight = TRUE;
}
- Temp = 0;
- Row = OriginalRow;
+ if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
+ Status = DisplayOneMenu (MenuOption,
+ MenuOption->Col - gStatementDimensions.LeftColumn,
+ gStatementDimensions.LeftColumn + gModalSkipColumn,
+ Link == TopOfScreen ? SkipValue : 0,
+ BottomRow,
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
+ );
+ } else {
+ Status = DisplayOneMenu (MenuOption,
+ MenuOption->Col - gStatementDimensions.LeftColumn,
+ gStatementDimensions.LeftColumn,
+ Link == TopOfScreen ? SkipValue : 0,
+ BottomRow,
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
+ );
+ }
- //
- // 2.2. Paint the option string.
- //
- Status = ProcessOptions (MenuOption, FALSE, &OptionString, FALSE);
- //
- // If Error occur, question value update in ProcessOptions.
- // Exit current FormDisplay with new question value.
- //
if (EFI_ERROR (Status)) {
return Status;
}
-
- if (OptionString != NULL) {
- if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
- ProcessStringForDateTime(MenuOption, OptionString, TRUE);
- }
-
- Width = (UINT16) gOptionBlockWidth;
- OriginalRow = Row;
- GlyphWidth = 1;
-
- for (Index = 0; GetLineByWidth (OptionString, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
- if ((Temp2 == 0) && (Row <= BottomRow)) {
- PrintStringAt (MenuOption->OptCol, Row, OutputString);
- }
- //
- // If there is more string to process print on the next row and increment the Skip value
- //
- if (StrLen (&OptionString[Index]) != 0) {
- if (Temp2 == 0) {
- Row++;
- //
- // Since the Number of lines for this menu entry may or may not be reflected accurately
- // since the prompt might be 1 lines and option might be many, and vice versa, we need to do
- // some testing to ensure we are keeping this in-sync.
- //
- // If the difference in rows is greater than or equal to the skip value, increase the skip value
- //
- if ((Row - OriginalRow) >= MenuOption->Skip) {
- MenuOption->Skip++;
- }
- }
- }
-
- FreePool (OutputString);
- if (Temp2 != 0) {
- Temp2--;
- }
- }
-
- Row = OriginalRow;
-
- FreePool (OptionString);
- }
- Temp2 = 0;
-
- //
- // If this is a text op with secondary text information
- //
- if ((Statement->OpCode->OpCode == EFI_IFR_TEXT_OP) && (((EFI_IFR_TEXT*)Statement->OpCode)->TextTwo != 0)) {
- StringPtr = GetToken (((EFI_IFR_TEXT*)Statement->OpCode)->TextTwo, gFormData->HiiHandle);
-
- Width = (UINT16) gOptionBlockWidth;
- OriginalRow = Row;
- GlyphWidth = 1;
-
- for (Index = 0; GetLineByWidth (StringPtr, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
- if ((Temp3 == 0) && (Row <= BottomRow)) {
- PrintStringAt (MenuOption->OptCol, Row, OutputString);
- }
- //
- // If there is more string to process print on the next row and increment the Skip value
- //
- if (StrLen (&StringPtr[Index]) != 0) {
- if (Temp3 == 0) {
- Row++;
- //
- // Since the Number of lines for this menu entry may or may not be reflected accurately
- // since the prompt might be 1 lines and option might be many, and vice versa, we need to do
- // some testing to ensure we are keeping this in-sync.
- //
- // If the difference in rows is greater than or equal to the skip value, increase the skip value
- //
- if ((Row - OriginalRow) >= MenuOption->Skip) {
- MenuOption->Skip++;
- }
- }
- }
-
- FreePool (OutputString);
- if (Temp3 != 0) {
- Temp3--;
- }
- }
-
- Row = OriginalRow;
- FreePool (StringPtr);
- }
- Temp3 = 0;
-
- gST->ConOut->SetAttribute (gST->ConOut, GetFieldTextColor ());
-
//
// 3. Update the row info which will be used by next menu.
//
@@ -1835,20 +2135,25 @@ UiDisplayMenu (
}
}
- if (!ValueIsScroll (TRUE, TopOfScreen)) {
- UpArrow = TRUE;
+ //
+ // 3. Menus in this form may not cover all form, clean the remain field.
+ //
+ while (Row <= BottomRow) {
+ if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, Row++, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * gModalSkipColumn);
+ } else {
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn, Row++, L"", gStatementDimensions.RightColumn - gHelpBlockWidth - gStatementDimensions.LeftColumn);
+ }
}
- if (UpArrow) {
- gST->ConOut->SetAttribute (gST->ConOut, GetArrowColor ());
- PrintCharAt (
- gStatementDimensions.LeftColumn + gPromptBlockWidth + gOptionBlockWidth + 1,
- TopRow - SCROLL_ARROW_HEIGHT,
- ARROW_UP
- );
- gST->ConOut->SetAttribute (gST->ConOut, GetFieldTextColor ());
+ //
+ // 4. Print the down arrow row.
+ //
+ if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn + gModalSkipColumn, BottomRow + 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn - 2 * + gModalSkipColumn);
+ } else {
+ PrintStringAtWithWidth(gStatementDimensions.LeftColumn, BottomRow + 1, L"", gStatementDimensions.RightColumn - gStatementDimensions.LeftColumn);
}
-
if (DownArrow) {
gST->ConOut->SetAttribute (gST->ConOut, GetArrowColor ());
PrintCharAt (
@@ -1860,6 +2165,10 @@ UiDisplayMenu (
}
MenuOption = NULL;
+
+ if (IsListEmpty (&gMenuOption)) {
+ ControlFlag = CfReadKey;
+ }
}
break;
@@ -1872,6 +2181,13 @@ UiDisplayMenu (
//
ControlFlag = CfUpdateHelpString;
+ if (SkipHighLight) {
+ MenuOption = SavedMenuOption;
+ SkipHighLight = FALSE;
+ UpdateHighlightMenuInfo (MenuOption);
+ break;
+ }
+
if (MenuOption != NULL && TopOfScreen == &MenuOption->Link) {
Temp = SkipValue;
} else {
@@ -1898,7 +2214,7 @@ UiDisplayMenu (
ProcessStringForDateTime(MenuOption, OptionString, FALSE);
}
- Width = (UINT16) gOptionBlockWidth;
+ Width = (UINT16) gOptionBlockWidth - 1;
OriginalRow = MenuOption->Row;
GlyphWidth = 1;
@@ -1933,7 +2249,7 @@ UiDisplayMenu (
}
OriginalRow = MenuOption->Row;
- Width = GetWidth (MenuOption->ThisTag);
+ Width = GetWidth (MenuOption, NULL);
GlyphWidth = 1;
for (Index = 0; GetLineByWidth (MenuOption->Description, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
@@ -1967,25 +2283,9 @@ UiDisplayMenu (
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
Statement = MenuOption->ThisTag;
- //
- // Get the highlight statement.
- //
- gUserInput->SelectedStatement = Statement;
- gSequence = (UINT16) MenuOption->Sequence;
-
- //
- // Record highlight row info for date/time opcode.
- //
- if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
- gHighligthMenuInfo.QuestionId = GetQuestionIdInfo(Statement->OpCode);
- gHighligthMenuInfo.DisplayRow = (UINT16) MenuOption->Row;
- } else {
- gHighligthMenuInfo.QuestionId = 0;
- gHighligthMenuInfo.DisplayRow = 0;
- }
+ UpdateHighlightMenuInfo (MenuOption);
if (!IsSelectable (MenuOption)) {
- RefreshKeyHelp(gFormData, Statement, FALSE);
break;
}
@@ -2000,7 +2300,7 @@ UiDisplayMenu (
if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP || Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
ProcessStringForDateTime(MenuOption, OptionString, FALSE);
}
- Width = (UINT16) gOptionBlockWidth;
+ Width = (UINT16) gOptionBlockWidth - 1;
OriginalRow = MenuOption->Row;
GlyphWidth = 1;
@@ -2031,7 +2331,7 @@ UiDisplayMenu (
if (NewLine) {
OriginalRow = MenuOption->Row;
- Width = GetWidth (Statement);
+ Width = GetWidth (MenuOption, NULL);
GlyphWidth = 1;
for (Index = 0; GetLineByWidth (MenuOption->Description, Width, &GlyphWidth, &Index, &OutputString) != 0x0000;) {
@@ -2058,8 +2358,6 @@ UiDisplayMenu (
}
}
- RefreshKeyHelp(gFormData, MenuOption->ThisTag, FALSE);
-
//
// Clear reverse attribute
//
@@ -2596,6 +2894,11 @@ UiDisplayMenu (
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
UpdateStatusBar (INPUT_ERROR, FALSE);
} else {
+ if (NewPos->ForwardLink == &gMenuOption) {
+ NewLine = FALSE;
+ Repaint = FALSE;
+ break;
+ }
//
// Scroll up to the last page.
//
@@ -2604,6 +2907,7 @@ UiDisplayMenu (
MenuOption = MENU_OPTION_FROM_LINK (SavedListEntry);
ScreenOperation = UiPageUp;
ControlFlag = CfScreenOperation;
+ SkipValue = 0;
}
break;
@@ -2660,23 +2964,32 @@ UiDisplayMenu (
}
if ((Link->BackLink == &gMenuOption) && (Index >= TopRow)) {
- SkipValue = 0;
if (TopOfScreen == &gMenuOption) {
TopOfScreen = gMenuOption.ForwardLink;
NewPos = gMenuOption.BackLink;
MoveToNextStatement (TRUE, &NewPos, BottomRow - TopRow);
- Repaint = FALSE;
+ if (Index < PreviousMenuOption->Skip) {
+ Repaint = TRUE;
+ SkipValue = PreviousMenuOption->Skip - (Index - TopRow);
+ } else {
+ Repaint = FALSE;
+ SkipValue = 0;
+ }
} else if (TopOfScreen != Link) {
TopOfScreen = Link;
NewPos = Link;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
+ SkipValue = 0;
} else {
//
// Finally we know that NewPos is the last MenuOption can be focused.
//
- Repaint = FALSE;
+ if (SkipValue == 0) {
+ Repaint = FALSE;
+ }
NewPos = Link;
MoveToNextStatement (FALSE, &NewPos, BottomRow - TopRow);
+ SkipValue = 0;
}
} else {
if (Index > TopRow) {
@@ -2724,6 +3037,13 @@ UiDisplayMenu (
ASSERT (NewPos != NULL);
if (NewPos->ForwardLink == &gMenuOption) {
+ MenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ if (SkipValue + BottomRow - TopRow + 1 < MenuOption->Skip) {
+ SkipValue += BottomRow - TopRow + 1;
+ NewLine = TRUE;
+ Repaint = TRUE;
+ break;
+ }
NewLine = FALSE;
Repaint = FALSE;
break;
@@ -2802,6 +3122,12 @@ UiDisplayMenu (
AdjustDateAndTimePosition (FALSE, &NewPos);
if (NewPos->ForwardLink != &gMenuOption) {
+ if (NewPos == TopOfScreen) {
+ Temp2 = SkipValue;
+ } else {
+ Temp2 = 0;
+ }
+
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
NewLine = TRUE;
NewPos = NewPos->ForwardLink;
@@ -2810,11 +3136,11 @@ UiDisplayMenu (
//
// Current menu not at the bottom of the form.
//
- if (BottomRow >= MenuOption->Row + MenuOption->Skip) {
+ if (BottomRow >= MenuOption->Row + MenuOption->Skip - Temp2) {
//
// Find the next selectable menu.
//
- Difference = MoveToNextStatement (FALSE, &NewPos, BottomRow - MenuOption->Row - MenuOption->Skip);
+ Difference = MoveToNextStatement (FALSE, &NewPos, BottomRow - MenuOption->Row - MenuOption->Skip + Temp2);
//
// We hit the end of MenuOption that can be focused
// so we simply scroll to the first page.
@@ -2846,10 +3172,10 @@ UiDisplayMenu (
if (NextMenuOption->Row == 0) {
UpdateOptionSkipLines (NextMenuOption);
}
- DistanceValue = Difference + NextMenuOption->Skip;
+ DistanceValue = Difference + NextMenuOption->Skip - Temp2;
Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;
- if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&
+ if ((MenuOption->Row + MenuOption->Skip - Temp2 == BottomRow + 1) &&
(NextMenuOption->ThisTag->OpCode->OpCode == EFI_IFR_DATE_OP ||
NextMenuOption->ThisTag->OpCode->OpCode == EFI_IFR_TIME_OP)
) {
@@ -2947,7 +3273,7 @@ UiDisplayMenu (
//
// Scroll to the first page.
//
- if (TopOfScreen != gMenuOption.ForwardLink) {
+ if (TopOfScreen != gMenuOption.ForwardLink || SkipValue != 0) {
TopOfScreen = gMenuOption.ForwardLink;
Repaint = TRUE;
MenuOption = NULL;
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index affd45ad1..032bf8883 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -259,6 +259,9 @@ formset
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
+ warningif prompt = STRING_TOKEN(STR_WARNING_POPUP), timeout = 5,
+ ideqval MyIfrNVData.TestLateCheck == 0
+ endif
endoneof;
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
index 6693a9ec7..442de3840 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
+++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
Binary files differ
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c
index 3d1d29dfd..714b5d8d7 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c
@@ -159,7 +159,7 @@ FtwAllocate (
}
DEBUG (
- (EFI_D_ERROR,
+ (EFI_D_INFO,
"Ftw: Allocate() success, Caller:%g, # %d\n",
CallerId,
NumberOfWrites)
@@ -573,7 +573,7 @@ FtwWrite (
FreePool (SpareBuffer);
DEBUG (
- (EFI_D_ERROR,
+ (EFI_D_INFO,
"Ftw: Write() success, (Lba:Offset)=(%lx:0x%x), Length: 0x%x\n",
Lba,
Offset,
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c
index 4c658b297..a5fa12b0a 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c
@@ -258,7 +258,7 @@ FtwReclaimWorkSpace (
UINT8 *Ptr;
EFI_LBA WorkSpaceLbaOffset;
- DEBUG ((EFI_D_ERROR, "Ftw: start to reclaim work space\n"));
+ DEBUG ((EFI_D_INFO, "Ftw: start to reclaim work space\n"));
WorkSpaceLbaOffset = FtwDevice->FtwWorkSpaceLba - FtwDevice->FtwWorkBlockLba;
@@ -473,7 +473,7 @@ FtwReclaimWorkSpace (
FreePool (SpareBuffer);
- DEBUG ((EFI_D_ERROR, "Ftw: reclaim work space successfully\n"));
+ DEBUG ((EFI_D_INFO, "Ftw: reclaim work space successfully\n"));
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 4959d8302..2ed02cdaa 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -1109,6 +1109,7 @@ GetVarStoreType (
{
EFI_STATUS Status;
UINTN IfrOffset;
+ UINTN PackageOffset;
EFI_IFR_OP_HEADER *IfrOpHdr;
CHAR16 *VarStoreName;
EFI_STRING GuidStr;
@@ -1118,6 +1119,7 @@ GetVarStoreType (
UINT8 *HiiFormPackage;
UINTN PackageSize;
EFI_IFR_VARSTORE_EFI *IfrEfiVarStore;
+ EFI_HII_PACKAGE_HEADER *PackageHeader;
HiiFormPackage = NULL;
LengthString = 0;
@@ -1132,10 +1134,26 @@ GetVarStoreType (
return Status;
}
- IfrOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ IfrOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ PackageOffset = IfrOffset;
+ PackageHeader = (EFI_HII_PACKAGE_HEADER *) HiiFormPackage;
+
while (IfrOffset < PackageSize) {
- IfrOpHdr = (EFI_IFR_OP_HEADER *) (HiiFormPackage + IfrOffset);
+ //
+ // More than one form packages exist.
+ //
+ if (PackageOffset >= PackageHeader->Length) {
+ //
+ // Process the new form package.
+ //
+ PackageOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ IfrOffset += PackageOffset;
+ PackageHeader = (EFI_HII_PACKAGE_HEADER *) (HiiFormPackage + IfrOffset);
+ }
+
+ IfrOpHdr = (EFI_IFR_OP_HEADER *) (HiiFormPackage + IfrOffset);
IfrOffset += IfrOpHdr->Length;
+ PackageOffset += IfrOpHdr->Length;
if (IfrOpHdr->OpCode == EFI_IFR_VARSTORE_EFI_OP ) {
IfrEfiVarStore = (EFI_IFR_VARSTORE_EFI *) IfrOpHdr;
@@ -1190,6 +1208,13 @@ GetVarStoreType (
FreePool (GuidStr);
FreePool (NameStr);
FreePool (TempStr);
+
+ //
+ // Already found the varstore, break;
+ //
+ if (*IsEfiVarstore) {
+ break;
+ }
}
}
Done:
@@ -1415,6 +1440,7 @@ ParseIfrData (
{
EFI_STATUS Status;
UINTN IfrOffset;
+ UINTN PackageOffset;
EFI_IFR_VARSTORE *IfrVarStore;
EFI_IFR_VARSTORE_EFI *IfrEfiVarStore;
EFI_IFR_OP_HEADER *IfrOpHdr;
@@ -1438,25 +1464,50 @@ ParseIfrData (
LIST_ENTRY *LinkData;
LIST_ENTRY *LinkDefault;
EFI_IFR_VARSTORE_NAME_VALUE *IfrNameValueVarStore;
+ EFI_HII_PACKAGE_HEADER *PackageHeader;
+ EFI_VARSTORE_ID VarStoreId;
Status = EFI_SUCCESS;
BlockData = NULL;
DefaultDataPtr = NULL;
FirstOneOfOption = FALSE;
+ VarStoreId = 0;
ZeroMem (&DefaultData, sizeof (IFR_DEFAULT_DATA));
//
// Go through the form package to parse OpCode one by one.
//
- IfrOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ PackageOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ PackageHeader = (EFI_HII_PACKAGE_HEADER *) Package;
+ IfrOffset = PackageOffset;
while (IfrOffset < PackageLength) {
+
+ //
+ // More than one form package found.
+ //
+ if (PackageOffset >= PackageHeader->Length) {
+ //
+ // Already found varstore for this request, break;
+ //
+ if (VarStoreId != 0) {
+ VarStoreId = 0;
+ }
+
+ //
+ // Get next package header info.
+ //
+ IfrOffset += sizeof (EFI_HII_PACKAGE_HEADER);
+ PackageOffset = sizeof (EFI_HII_PACKAGE_HEADER);
+ PackageHeader = (EFI_HII_PACKAGE_HEADER *) (Package + IfrOffset);
+ }
+
IfrOpHdr = (EFI_IFR_OP_HEADER *) (Package + IfrOffset);
switch (IfrOpHdr->OpCode) {
case EFI_IFR_VARSTORE_OP:
//
// VarStore is found. Don't need to search any more.
//
- if (VarStorageData->VarStoreId != 0) {
+ if (VarStoreId != 0) {
break;
}
@@ -1474,10 +1525,10 @@ ParseIfrData (
// Find the matched VarStore
//
CopyGuid (&VarStorageData->Guid, (EFI_GUID *) (VOID *) &IfrVarStore->Guid);
- VarStorageData->VarStoreId = IfrVarStore->VarStoreId;
VarStorageData->Size = IfrVarStore->Size;
VarStorageData->Name = VarStoreName;
VarStorageData->Type = EFI_HII_VARSTORE_BUFFER;
+ VarStoreId = IfrVarStore->VarStoreId;
}
break;
@@ -1485,7 +1536,7 @@ ParseIfrData (
//
// VarStore is found. Don't need to search any more.
//
- if (VarStorageData->VarStoreId != 0) {
+ if (VarStoreId != 0) {
break;
}
@@ -1512,10 +1563,10 @@ ParseIfrData (
// Find the matched VarStore
//
CopyGuid (&VarStorageData->Guid, (EFI_GUID *) (VOID *) &IfrEfiVarStore->Guid);
- VarStorageData->VarStoreId = IfrEfiVarStore->VarStoreId;
VarStorageData->Size = IfrEfiVarStore->Size;
VarStorageData->Name = VarStoreName;
VarStorageData->Type = EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER;
+ VarStoreId = IfrEfiVarStore->VarStoreId;
}
break;
@@ -1523,7 +1574,7 @@ ParseIfrData (
//
// VarStore is found. Don't need to search any more.
//
- if (VarStorageData->VarStoreId != 0) {
+ if (VarStoreId != 0) {
break;
}
@@ -1534,8 +1585,8 @@ ParseIfrData (
// Find the matched VarStore
//
CopyGuid (&VarStorageData->Guid, (EFI_GUID *) (VOID *) &IfrNameValueVarStore->Guid);
- VarStorageData->VarStoreId = IfrNameValueVarStore->VarStoreId;
VarStorageData->Type = EFI_HII_VARSTORE_NAME_VALUE;
+ VarStoreId = IfrNameValueVarStore->VarStoreId;
}
break;
@@ -1558,7 +1609,7 @@ ParseIfrData (
//
// No matched varstore is found and directly return.
//
- if (VarStorageData->VarStoreId == 0) {
+ if ( VarStoreId == 0) {
Status = EFI_SUCCESS;
goto Done;
}
@@ -1568,7 +1619,7 @@ ParseIfrData (
//
// Ref question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if ( VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1576,7 +1627,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrRef = (EFI_IFR_REF4 *) IfrOpHdr;
- if (IfrRef->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrRef->Question.VarStoreId != VarStoreId) {
break;
}
VarWidth = (UINT16) (sizeof (EFI_HII_REF));
@@ -1596,7 +1647,7 @@ ParseIfrData (
//
// Numeric and OneOf question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1604,7 +1655,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrOneOf = (EFI_IFR_ONE_OF *) IfrOpHdr;
- if (IfrOneOf->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrOneOf->Question.VarStoreId != VarStoreId) {
break;
}
VarWidth = (UINT16) (1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
@@ -1673,7 +1724,7 @@ ParseIfrData (
//
// OrderedList question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1681,7 +1732,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;
- if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrOrderedList->Question.VarStoreId != VarStoreId) {
BlockData = NULL;
break;
}
@@ -1705,7 +1756,7 @@ ParseIfrData (
//
// CheckBox question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1713,7 +1764,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;
- if (IfrCheckBox->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrCheckBox->Question.VarStoreId != VarStoreId) {
break;
}
VarWidth = (UINT16) sizeof (BOOLEAN);
@@ -1792,7 +1843,7 @@ ParseIfrData (
//
// Date question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1800,7 +1851,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrDate = (EFI_IFR_DATE *) IfrOpHdr;
- if (IfrDate->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrDate->Question.VarStoreId != VarStoreId) {
break;
}
@@ -1821,7 +1872,7 @@ ParseIfrData (
//
// Time question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1829,7 +1880,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrTime = (EFI_IFR_TIME *) IfrOpHdr;
- if (IfrTime->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrTime->Question.VarStoreId != VarStoreId) {
break;
}
@@ -1850,7 +1901,7 @@ ParseIfrData (
//
// String question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1858,7 +1909,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrString = (EFI_IFR_STRING *) IfrOpHdr;
- if (IfrString->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrString->Question.VarStoreId != VarStoreId) {
break;
}
@@ -1884,7 +1935,7 @@ ParseIfrData (
//
// Password question is not in IFR Form. This IFR form is not valid.
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStoreId == 0) {
Status = EFI_INVALID_PARAMETER;
goto Done;
}
@@ -1892,7 +1943,7 @@ ParseIfrData (
// Check whether this question is for the requested varstore.
//
IfrPassword = (EFI_IFR_PASSWORD *) IfrOpHdr;
- if (IfrPassword->Question.VarStoreId != VarStorageData->VarStoreId) {
+ if (IfrPassword->Question.VarStoreId != VarStoreId) {
break;
}
@@ -2089,7 +2140,8 @@ ParseIfrData (
break;
}
- IfrOffset += IfrOpHdr->Length;
+ IfrOffset += IfrOpHdr->Length;
+ PackageOffset += IfrOpHdr->Length;
}
Done:
@@ -2990,7 +3042,7 @@ GetFullStringFromHiiFormPackages (
//
// No requested varstore in IFR data and directly return
//
- if (VarStorageData->VarStoreId == 0) {
+ if (VarStorageData->Type == 0 && VarStorageData->Name == NULL) {
Status = EFI_SUCCESS;
goto Done;
}
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
index 9046d9057..32e48275b 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
@@ -65,7 +65,6 @@ typedef struct {
LIST_ENTRY Entry; // Link to VarStorage
EFI_GUID Guid;
CHAR16 *Name;
- EFI_VARSTORE_ID VarStoreId;
UINT16 Size;
UINT8 Type;
LIST_ENTRY BlockEntry; // Link to its Block array
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index dd4189c02..04f5df34a 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -1,7 +1,7 @@
/** @file
Implementation for iSCSI Boot Firmware Table publication.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -37,12 +37,6 @@ IScsiInitIbfTableHeader (
Header->Length = IBFT_HEAP_OFFSET;
Header->Revision = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_REVISION;
Header->Checksum = 0;
-
- Header->OemId[0] = 'I';
- Header->OemId[1] = 'N';
- Header->OemId[2] = 'T';
- Header->OemId[3] = 'E';
- Header->OemId[4] = 'L';
CopyMem (Header->OemId, OemId, sizeof (Header->OemId));
CopyMem (&Header->OemTableId, OemTableId, sizeof (UINT64));
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
index 5a6002e83..ffe0c6e1a 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
@@ -2535,7 +2535,8 @@ IScsiExecuteScsiCommand (
Timeout = 0;
if (Session->State != SESSION_STATE_LOGGED_IN) {
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto ON_EXIT;
}
Conn = NET_LIST_USER_STRUCT_S (
@@ -2707,7 +2708,7 @@ IScsiSessionReinstatement (
EFI_STATUS Status;
Session = &Private->Session;
- ASSERT (Session->State == SESSION_STATE_LOGGED_IN);
+ ASSERT (Session->State != SESSION_STATE_FREE);
//
// Abort the session and re-init it.
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
index 5493d07d1..3eff1882e 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
@@ -176,7 +176,7 @@ Ip4ConfigOnDhcp4Complete (
EFI_DHCP4_MODE_DATA Dhcp4Mode;
EFI_IP4_IPCONFIG_DATA *Ip4Config;
EFI_STATUS Status;
- BOOLEAN Perment;
+ BOOLEAN Permanent;
IP4_ADDR Subnet;
IP4_ADDR Ip1;
IP4_ADDR Ip2;
@@ -202,11 +202,11 @@ Ip4ConfigOnDhcp4Complete (
// the instance and to NVRam. So, both the IP4 driver and
// other user can get that address.
//
- Perment = FALSE;
+ Permanent = FALSE;
if (Instance->NicConfig != NULL) {
ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);
- Perment = Instance->NicConfig->Perment;
+ Permanent = Instance->NicConfig->Permanent;
FreePool (Instance->NicConfig);
}
@@ -221,7 +221,7 @@ Ip4ConfigOnDhcp4Complete (
CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));
Instance->NicConfig->Source = IP4_CONFIG_SOURCE_DHCP;
- Instance->NicConfig->Perment = Perment;
+ Instance->NicConfig->Permanent = Permanent;
Ip4Config = &Instance->NicConfig->Ip4Info;
Ip4Config->StationAddress = Dhcp4Mode.ClientAddress;
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
index 790e44be4..56cce6e6f 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
@@ -319,7 +319,7 @@ Ip4ConfigDriverBindingStart (
//
NicConfig = Ip4ConfigReadVariable (Instance);
if (NicConfig != NULL) {
- if (!NicConfig->Perment) {
+ if (!NicConfig->Permanent) {
//
// Delete the non-permanent configuration.
//
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
index f09bd5174..89e1ddaf3 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
@@ -271,7 +271,7 @@ Ip4ConfigConvertIfrNvDataToDeviceConfigData (
ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway, sizeof (EFI_IPv4_ADDRESS));
}
- NicInfo->Perment = TRUE;
+ NicInfo->Permanent = TRUE;
CopyMem (&NicInfo->NicAddr, &Ip4ConfigInstance->NicAddr, sizeof (NIC_ADDR));
return EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NicInfo, TRUE);
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index 29f07ce4a..cd01685a3 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -2002,7 +2002,8 @@ EfiIp4Transmit (
RawHdrLen = (UINT8) (RawHdrLen & 0x0f);
if (RawHdrLen < 5) {
- return EFI_INVALID_PARAMETER;
+ Status = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
}
RawHdrLen = (UINT8) (RawHdrLen << 2);
@@ -2014,7 +2015,8 @@ EfiIp4Transmit (
DontFragment = IP4_DO_NOT_FRAGMENT (Head.Fragment);
if (!DontFragment) {
- return EFI_INVALID_PARAMETER;
+ Status = EFI_INVALID_PARAMETER;
+ goto ON_EXIT;
}
GateWay = IP4_ALLZERO_ADDRESS;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index ac7dce694..4006fcd6f 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -510,10 +510,6 @@ CreateStorage (
InitializeConfigHdr (FormSet, BrowserStorage);
}
- //
- // Add count because one formset storage use this global storage.
- //
- BrowserStorage->ReferenceCount++;
Storage->BrowserStorage = BrowserStorage;
Storage->ConfigRequest = AllocateCopyPool (StrSize (BrowserStorage->ConfigHdr), BrowserStorage->ConfigHdr);
@@ -742,12 +738,6 @@ DestroyStorage (
FreePool (Storage->ConfigRequest);
}
- //
- // Minus the reference to the global storage.
- //
- ASSERT (Storage->BrowserStorage->ReferenceCount > 0);
- Storage->BrowserStorage->ReferenceCount--;
-
FreePool (Storage);
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index a5caf4426..8e6dff0dd 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -160,7 +160,7 @@ UpdateStatement (
//
// Question value may be changed, need invoke its Callback()
//
- ProcessCallBackFunction (gCurrentSelection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
+ ProcessCallBackFunction (gCurrentSelection, gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
if (mHiiPackageListUpdated) {
//
@@ -571,6 +571,47 @@ UpdateHotkeyList (
/**
+ Get the extra question attribute from override question list.
+
+ @param QuestionId The question id for this request question.
+
+ @retval The attribute for this question or NULL if not found this
+ question in the list.
+
+**/
+UINT32
+ProcessQuestionExtraAttr (
+ IN EFI_QUESTION_ID QuestionId
+ )
+{
+ LIST_ENTRY *Link;
+ QUESTION_ATTRIBUTE_OVERRIDE *QuestionDesc;
+
+ //
+ // Return HII_DISPLAY_NONE if input a invalid question id.
+ //
+ if (QuestionId == 0) {
+ return HII_DISPLAY_NONE;
+ }
+
+ Link = GetFirstNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead);
+ while (!IsNull (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link)) {
+ QuestionDesc = FORM_QUESTION_ATTRIBUTE_OVERRIDE_FROM_LINK (Link);
+ Link = GetNextNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link);
+
+ if ((QuestionDesc->QuestionId == QuestionId) &&
+ (QuestionDesc->FormId == gCurrentSelection->FormId) &&
+ (QuestionDesc->HiiHandle == gCurrentSelection->Handle) &&
+ CompareGuid (&QuestionDesc->FormSetGuid, &gCurrentSelection->FormSetGuid)) {
+ return QuestionDesc->Attribute;
+ }
+ }
+
+ return HII_DISPLAY_NONE;
+}
+
+/**
+
Enum all statement in current form, find all the statement can be display and
add to the display form.
@@ -589,6 +630,7 @@ AddStatementToDisplayForm (
EFI_EVENT RefreshIntervalEvent;
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
BOOLEAN FormEditable;
+ UINT32 ExtraAttribute;
HostDisplayStatement = NULL;
MinRefreshInterval = 0;
@@ -630,6 +672,14 @@ AddStatementToDisplayForm (
continue;
}
+ //
+ // Check the extra attribute.
+ //
+ ExtraAttribute = ProcessQuestionExtraAttr (Statement->QuestionId);
+ if ((ExtraAttribute & HII_DISPLAY_SUPPRESS) != 0) {
+ continue;
+ }
+
DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
ASSERT (DisplayStatement != NULL);
@@ -639,6 +689,11 @@ AddStatementToDisplayForm (
InitializeDisplayStatement(DisplayStatement, Statement, HostDisplayStatement);
//
+ // Set the extra attribute.
+ //
+ DisplayStatement->Attribute |= ExtraAttribute;
+
+ //
// Save the Host statement info.
// Host statement may has nest statement follow it.
//
@@ -1309,7 +1364,7 @@ ProcessGotoOpCode (
//
// Check whether the device path string is a valid string.
//
- if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL) {
+ if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL && StringPtr[0] != L'\0') {
if (Selection->Form->ModalForm) {
return Status;
}
@@ -1618,9 +1673,6 @@ ProcessUserInput (
CopyMem (&Statement->HiiValue, &UserInput->InputValue, sizeof (EFI_HII_VALUE));
break;
}
- if (Statement->Operand != EFI_IFR_PASSWORD_OP) {
- SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
- }
break;
}
}
@@ -1986,6 +2038,8 @@ FindNextMenu (
about the Selection, form and formset to be displayed.
On output, Selection return the screen item that is selected
by user.
+ @param FormSet The formset this question belong to.
+ @param Form The form this question belong to.
@param Question The Question which need to call.
@param Action The action request.
@param SkipSaveOrDiscard Whether skip save or discard action.
@@ -1996,6 +2050,8 @@ FindNextMenu (
EFI_STATUS
ProcessCallBackFunction (
IN OUT UI_MENU_SELECTION *Selection,
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Question,
IN EFI_BROWSER_ACTION Action,
IN BOOLEAN SkipSaveOrDiscard
@@ -2012,23 +2068,26 @@ ProcessCallBackFunction (
BOOLEAN NeedExit;
LIST_ENTRY *Link;
BROWSER_SETTING_SCOPE SettingLevel;
+ EFI_IFR_TYPE_VALUE BackUpValue;
+ UINT8 *BackUpBuffer;
- ConfigAccess = Selection->FormSet->ConfigAccess;
+ ConfigAccess = FormSet->ConfigAccess;
SubmitFormIsRequired = FALSE;
SettingLevel = FormSetLevel;
DiscardFormIsRequired = FALSE;
NeedExit = FALSE;
Status = EFI_SUCCESS;
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
+ BackUpBuffer = NULL;
if (ConfigAccess == NULL) {
return EFI_SUCCESS;
}
- Link = GetFirstNode (&Selection->Form->StatementListHead);
- while (!IsNull (&Selection->Form->StatementListHead, Link)) {
+ Link = GetFirstNode (&Form->StatementListHead);
+ while (!IsNull (&Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
- Link = GetNextNode (&Selection->Form->StatementListHead, Link);
+ Link = GetNextNode (&Form->StatementListHead, Link);
//
// if Question != NULL, only process the question. Else, process all question in this form.
@@ -2045,7 +2104,7 @@ ProcessCallBackFunction (
// Check whether Statement is disabled.
//
if (Statement->Expression != NULL) {
- if (EvaluateExpressionList(Statement->Expression, TRUE, Selection->FormSet, Selection->Form) == ExpressDisable) {
+ if (EvaluateExpressionList(Statement->Expression, TRUE, FormSet, Form) == ExpressDisable) {
continue;
}
}
@@ -2058,7 +2117,18 @@ ProcessCallBackFunction (
//
TypeValue = (EFI_IFR_TYPE_VALUE *) Statement->BufferValue;
}
-
+
+ //
+ // If EFI_BROWSER_ACTION_CHANGING type, back up the new question value.
+ //
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
+ BackUpBuffer = AllocateCopyPool(Statement->StorageWidth + sizeof(CHAR16), Statement->BufferValue);
+ } else {
+ CopyMem (&BackUpValue, &HiiValue->Value, sizeof (EFI_IFR_TYPE_VALUE));
+ }
+ }
+
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
Status = ConfigAccess->Callback (
ConfigAccess,
@@ -2122,15 +2192,31 @@ ProcessCallBackFunction (
// "retrieve" should update to the question's temp buffer.
//
if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) {
- SetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
}
} else {
//
+ // If the callback returns EFI_UNSUPPORTED for EFI_BROWSER_ACTION_CHANGING,
+ // then the browser will use the value passed to Callback() and ignore the
+ // value returned by Callback().
+ //
+ if (Action == EFI_BROWSER_ACTION_CHANGING && Status == EFI_UNSUPPORTED) {
+ if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {
+ CopyMem (Statement->BufferValue, BackUpBuffer, Statement->StorageWidth + sizeof(CHAR16));
+ } else {
+ CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));
+ }
+
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
+ }
+
+ //
// According the spec, return fail from call back of "changing" and
// "retrieve", should restore the question's value.
//
- if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) {
- GetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);
+ if ((Action == EFI_BROWSER_ACTION_CHANGING && Status != EFI_UNSUPPORTED) ||
+ Action == EFI_BROWSER_ACTION_RETRIEVE) {
+ GetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
}
if (Status == EFI_UNSUPPORTED) {
@@ -2140,14 +2226,18 @@ ProcessCallBackFunction (
Status = EFI_SUCCESS;
}
}
+
+ if (BackUpBuffer != NULL) {
+ FreePool (BackUpBuffer);
+ }
}
if (SubmitFormIsRequired && !SkipSaveOrDiscard) {
- SubmitForm (Selection->FormSet, Selection->Form, SettingLevel);
+ SubmitForm (FormSet, Form, SettingLevel);
}
if (DiscardFormIsRequired && !SkipSaveOrDiscard) {
- DiscardForm (Selection->FormSet, Selection->Form, SettingLevel);
+ DiscardForm (FormSet, Form, SettingLevel);
}
if (NeedExit) {
@@ -2249,6 +2339,11 @@ SetupBrowser (
return Status;
}
+ if ((Selection->Handle != mCurrentHiiHandle) ||
+ (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid))) {
+ gFinishRetrieveCall = FALSE;
+ }
+
//
// Initialize current settings of Questions in this FormSet
//
@@ -2327,7 +2422,7 @@ SetupBrowser (
CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);
mCurrentFormId = Selection->FormId;
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
+ Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
if (EFI_ERROR (Status)) {
goto Done;
}
@@ -2351,6 +2446,11 @@ SetupBrowser (
}
//
+ // Finish call RETRIEVE callback for this formset.
+ //
+ gFinishRetrieveCall = TRUE;
+
+ //
// IFR is updated during callback of read value, force to reparse the IFR binary
//
if (mHiiPackageListUpdated) {
@@ -2375,7 +2475,7 @@ SetupBrowser (
if ((ConfigAccess != NULL) &&
((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&
(Statement->Operand != EFI_IFR_PASSWORD_OP)) {
- Status = ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
+ Status = ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
if (Statement->Operand == EFI_IFR_REF_OP) {
//
// Process dynamic update ref opcode.
@@ -2397,8 +2497,10 @@ SetupBrowser (
}
if (!EFI_ERROR (Status) && Statement->Operand != EFI_IFR_REF_OP) {
- ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);
+ ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);
}
+ } else if (Statement->Operand != EFI_IFR_PASSWORD_OP) {
+ SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
}
}
@@ -2433,7 +2535,7 @@ SetupBrowser (
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
(Selection->FormId != mCurrentFormId))) {
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);
+ Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);
if (EFI_ERROR (Status)) {
goto Done;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 6dcb4aa77..7975a1df1 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -48,11 +48,13 @@ LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFor
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);
+BOOLEAN gFinishRetrieveCall;
BOOLEAN gResetRequired;
BOOLEAN gExitRequired;
BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;
BOOLEAN mBrowserScopeFirstSet = TRUE;
EXIT_HANDLER ExitHandlerFunction = NULL;
+FORM_BROWSER_FORMSET *mSystemLevelFormSet;
//
// Browser Global Strings
@@ -255,6 +257,12 @@ LoadAllHiiFormset (
UINTN Index;
EFI_GUID ZeroGuid;
EFI_STATUS Status;
+ FORM_BROWSER_FORMSET *OldFormset;
+ BOOLEAN OldRetrieveValue;
+
+ OldFormset = mSystemLevelFormSet;
+ OldRetrieveValue = gFinishRetrieveCall;
+ gFinishRetrieveCall = FALSE;
//
// Get all the Hii handles
@@ -278,6 +286,8 @@ LoadAllHiiFormset (
//
LocalFormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET));
ASSERT (LocalFormSet != NULL);
+ mSystemLevelFormSet = LocalFormSet;
+
ZeroMem (&ZeroGuid, sizeof (ZeroGuid));
Status = InitializeFormSet (HiiHandles[Index], &ZeroGuid, LocalFormSet);
if (EFI_ERROR (Status) || IsListEmpty (&LocalFormSet->FormListHead)) {
@@ -300,6 +310,9 @@ LoadAllHiiFormset (
// Free resources, and restore gOldFormSet and gClassOfVfr
//
FreePool (HiiHandles);
+
+ gFinishRetrieveCall = OldRetrieveValue;
+ mSystemLevelFormSet = OldFormset;
}
/**
@@ -357,6 +370,7 @@ SendForm (
//
SaveBrowserContext ();
+ gFinishRetrieveCall = FALSE;
gResetRequired = FALSE;
gExitRequired = FALSE;
Status = EFI_SUCCESS;
@@ -388,6 +402,7 @@ SendForm (
break;
}
Selection->FormSet = FormSet;
+ mSystemLevelFormSet = FormSet;
//
// Display this formset
@@ -397,6 +412,7 @@ SendForm (
Status = SetupBrowser (Selection);
gCurrentSelection = NULL;
+ mSystemLevelFormSet = NULL;
//
// If no data is changed, don't need to save current FormSet into the maintain list.
@@ -580,7 +596,6 @@ BrowserCallback (
LIST_ENTRY *Link;
BROWSER_STORAGE *Storage;
FORMSET_STORAGE *FormsetStorage;
- FORM_BROWSER_FORMSET *FormSet;
UINTN TotalSize;
BOOLEAN Found;
@@ -650,16 +665,15 @@ BrowserCallback (
//
// GUID/Name is not specified, take the first storage in FormSet
//
- if (gCurrentSelection == NULL) {
+ if (mSystemLevelFormSet == NULL) {
return EFI_NOT_READY;
}
//
// Generate <ConfigResp>
//
- FormSet = gCurrentSelection->FormSet;
- Link = GetFirstNode (&FormSet->StorageListHead);
- if (IsNull (&FormSet->StorageListHead, Link)) {
+ Link = GetFirstNode (&mSystemLevelFormSet->StorageListHead);
+ if (IsNull (&mSystemLevelFormSet->StorageListHead, Link)) {
return EFI_UNSUPPORTED;
}
@@ -766,7 +780,8 @@ InitializeSetup (
//
// Install FormBrowserEx2 protocol
//
- InitializeListHead (&mPrivateData.FormBrowserEx2.FormViewHistoryHead);
+ InitializeListHead (&mPrivateData.FormBrowserEx2.FormViewHistoryHead);
+ InitializeListHead (&mPrivateData.FormBrowserEx2.OverrideQestListHead);
mPrivateData.Handle = NULL;
Status = gBS->InstallProtocolInterface (
&mPrivateData.Handle,
@@ -2360,7 +2375,8 @@ DiscardForm (
LIST_ENTRY *Link;
FORMSET_STORAGE *Storage;
FORM_BROWSER_CONFIG_REQUEST *ConfigInfo;
- FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *OldFormSet;
//
// Check the supported setting level.
@@ -2439,7 +2455,8 @@ DiscardForm (
//
// System Level Discard.
//
-
+ OldFormSet = mSystemLevelFormSet;
+
//
// Discard changed value for each FormSet in the maintain list.
//
@@ -2450,6 +2467,9 @@ DiscardForm (
if (!ValidateFormSet(LocalFormSet)) {
continue;
}
+
+ mSystemLevelFormSet = LocalFormSet;
+
DiscardForm (LocalFormSet, NULL, FormSetLevel);
if (!IsHiiHandleInBrowserContext (LocalFormSet->HiiHandle)) {
//
@@ -2460,6 +2480,8 @@ DiscardForm (
DestroyFormSet (LocalFormSet);
}
}
+
+ mSystemLevelFormSet = OldFormSet;
}
return EFI_SUCCESS;
@@ -3401,6 +3423,7 @@ ExtractDefault (
LIST_ENTRY *Link;
FORM_BROWSER_STATEMENT *Question;
FORM_BROWSER_FORMSET *LocalFormSet;
+ FORM_BROWSER_FORMSET *OldFormSet;
Status = EFI_SUCCESS;
@@ -3484,7 +3507,9 @@ ExtractDefault (
// Preload all Hii formset.
//
LoadAllHiiFormset();
-
+
+ OldFormSet = mSystemLevelFormSet;
+
//
// Set Default Value for each FormSet in the maintain list.
//
@@ -3495,8 +3520,13 @@ ExtractDefault (
if (!ValidateFormSet(LocalFormSet)) {
continue;
}
+
+ mSystemLevelFormSet = LocalFormSet;
+
ExtractDefault (LocalFormSet, NULL, DefaultId, FormSetLevel, GetDefaultValueScope, Storage, RetrieveValueFirst);
}
+
+ mSystemLevelFormSet = OldFormSet;
}
return EFI_SUCCESS;
@@ -3627,7 +3657,8 @@ LoadFormConfig (
// Call the Retrieve call back function for all questions.
//
if ((FormSet->ConfigAccess != NULL) && (Selection != NULL) &&
- ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK)) {
+ ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&
+ !gFinishRetrieveCall) {
//
// Check QuestionValue does exist.
//
@@ -3651,7 +3682,7 @@ LoadFormConfig (
);
}
- Status = ProcessCallBackFunction(Selection, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);
+ Status = ProcessCallBackFunction(Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);
}
//
@@ -4209,7 +4240,7 @@ LoadStorage (
return;
case EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER:
- if (Storage->BrowserStorage->ReferenceCount > 1) {
+ if (Storage->BrowserStorage->ConfigRequest != NULL) {
ConfigRequestAdjust(Storage);
return;
}
@@ -4311,6 +4342,17 @@ InitializeCurrentSetting (
FORM_BROWSER_FORMSET *OldFormSet;
//
+ // Try to find pre FormSet in the maintain backup list.
+ // If old formset != NULL, destroy this formset. Add new formset to gBrowserFormSetList.
+ //
+ OldFormSet = GetFormSetFromHiiHandle (FormSet->HiiHandle);
+ if (OldFormSet != NULL) {
+ RemoveEntryList (&OldFormSet->Link);
+ DestroyFormSet (OldFormSet);
+ }
+ InsertTailList (&gBrowserFormSetList, &FormSet->Link);
+
+ //
// Extract default from IFR binary for no storage questions.
//
ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSetLevel, GetDefaultForNoStorage, NULL, TRUE);
@@ -4326,17 +4368,6 @@ InitializeCurrentSetting (
Link = GetNextNode (&FormSet->StorageListHead, Link);
}
-
- //
- // Try to find pre FormSet in the maintain backup list.
- // If old formset != NULL, destroy this formset. Add new formset to gBrowserFormSetList.
- //
- OldFormSet = GetFormSetFromHiiHandle (FormSet->HiiHandle);
- if (OldFormSet != NULL) {
- RemoveEntryList (&OldFormSet->Link);
- DestroyFormSet (OldFormSet);
- }
- InsertTailList (&gBrowserFormSetList, &FormSet->Link);
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 99418543d..77a0ad1ba 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -151,7 +151,6 @@ typedef struct {
CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
// <RequestElement> includes all fields which is used by current form sets.
UINTN SpareStrLen; // Spare length of ConfigRequest string buffer
- UINT8 ReferenceCount; // How many form set storage refrence this storage.
} BROWSER_STORAGE;
#define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
@@ -542,12 +541,13 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
extern BOOLEAN gResetRequired;
extern BOOLEAN gExitRequired;
-
+extern BOOLEAN gFinishRetrieveCall;
extern LIST_ENTRY gBrowserFormSetList;
extern LIST_ENTRY gBrowserHotKeyList;
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
extern EXIT_HANDLER ExitHandlerFunction;
extern EFI_HII_HANDLE mCurrentHiiHandle;
+extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;
//
// Browser Global Strings
//
@@ -1157,7 +1157,9 @@ IsStorageDataChangedForFormSet (
about the Selection, form and formset to be displayed.
On output, Selection return the screen item that is selected
by user.
- @param Statement The Question which need to call.
+ @param FormSet The formset this question belong to.
+ @param Form The form this question belong to.
+ @param Question The Question which need to call.
@param Action The action request.
@param SkipSaveOrDiscard Whether skip save or discard action.
@@ -1167,6 +1169,8 @@ IsStorageDataChangedForFormSet (
EFI_STATUS
ProcessCallBackFunction (
IN OUT UI_MENU_SELECTION *Selection,
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Question,
IN EFI_BROWSER_ACTION Action,
IN BOOLEAN SkipSaveOrDiscard
diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
index 8bf5d443a..157ea8554 100644
--- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
+++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
@@ -981,7 +981,7 @@ SmbiosCreateTable (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiReservedMemoryType,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength),
&PhysicalAddress
);
@@ -1093,7 +1093,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiReservedMemoryType,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
@@ -1101,7 +1101,7 @@ SmbiosDriverEntryPoint (
DEBUG ((EFI_D_ERROR, "SmbiosDriverEntryPoint() could not allocate EntryPointStructure < 4GB\n"));
Status = gBS->AllocatePages (
AllocateAnyPages,
- EfiReservedMemoryType,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
@@ -1127,7 +1127,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiReservedMemoryType,
+ EfiRuntimeServicesData,
1,
&PhysicalAddress
);
diff --git a/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c
new file mode 100644
index 000000000..30349b5ec
--- /dev/null
+++ b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.c
@@ -0,0 +1,166 @@
+/** @file
+ Implementation of Timestamp Protocol using UEFI APIs.
+
+Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/TimerLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Protocol/Timestamp.h>
+
+//
+// The StartValue in TimerLib
+//
+UINT64 mTimerLibStartValue = 0;
+
+//
+// The EndValue in TimerLib
+//
+UINT64 mTimerLibEndValue = 0;
+
+//
+// The properties of timestamp
+//
+EFI_TIMESTAMP_PROPERTIES mTimestampProperties = {
+ 0,
+ 0
+};
+
+/**
+ Retrieves the current value of a 64-bit free running timestamp counter.
+
+ The counter shall count up in proportion to the amount of time that has passed. The counter value
+ will always roll over to zero. The properties of the counter can be retrieved from GetProperties().
+ The caller should be prepared for the function to return the same value twice across successive calls.
+ The counter value will not go backwards other than when wrapping, as defined by EndValue in GetProperties().
+ The frequency of the returned timestamp counter value must remain constant. Power management operations that
+ affect clocking must not change the returned counter frequency. The quantization of counter value updates may
+ vary as long as the value reflecting time passed remains consistent.
+
+ @retval The current value of the free running timestamp counter.
+
+**/
+UINT64
+EFIAPI
+TimestampDriverGetTimestamp (
+ VOID
+ )
+{
+ //
+ // The timestamp of Timestamp Protocol
+ //
+ UINT64 TimestampValue;
+ TimestampValue = 0;
+
+ //
+ // Get the timestamp
+ //
+ if (mTimerLibStartValue > mTimerLibEndValue) {
+ TimestampValue = mTimerLibStartValue - GetPerformanceCounter();
+ } else {
+ TimestampValue = GetPerformanceCounter() - mTimerLibStartValue;
+ }
+
+ return TimestampValue;
+}
+
+/**
+ Obtains timestamp counter properties including frequency and value limits.
+
+ @param[out] Properties The properties of the timestamp counter.
+
+ @retval EFI_SUCCESS The properties were successfully retrieved.
+ @retval EFI_DEVICE_ERROR An error occurred trying to retrieve the properties of the timestamp
+ counter subsystem. Properties is not pedated.
+ @retval EFI_INVALID_PARAMETER Properties is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+TimestampDriverGetProperties(
+ OUT EFI_TIMESTAMP_PROPERTIES *Properties
+ )
+{
+ if (Properties == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Get timestamp properties
+ //
+ CopyMem((VOID *) Properties, (VOID *) &mTimestampProperties, sizeof (mTimestampProperties));
+
+ return EFI_SUCCESS;
+}
+
+//
+// The Timestamp Protocol instance produced by this driver
+//
+EFI_TIMESTAMP_PROTOCOL mTimestamp = {
+ TimestampDriverGetTimestamp,
+ TimestampDriverGetProperties
+};
+
+/**
+ Entry point of the Timestamp Protocol driver.
+
+ @param ImageHandle The image handle of this driver.
+ @param SystemTable The pointer of EFI_SYSTEM_TABLE.
+
+ @retval EFI_SUCCESS Watchdog Timer Architectural Protocol successfully installed.
+
+**/
+EFI_STATUS
+EFIAPI
+TimestampDriverInitialize (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ EFI_HANDLE TimestampHandle;
+ TimestampHandle = NULL;
+
+ //
+ // Get the start value, end value and frequency in Timerlib
+ //
+ mTimestampProperties.Frequency = GetPerformanceCounterProperties(&mTimerLibStartValue, &mTimerLibEndValue);
+
+ //
+ // Set the EndValue
+ //
+ if (mTimerLibEndValue > mTimerLibStartValue) {
+ mTimestampProperties.EndValue = mTimerLibEndValue - mTimerLibStartValue;
+ } else {
+ mTimestampProperties.EndValue = mTimerLibStartValue - mTimerLibEndValue;
+ }
+
+ DEBUG ((EFI_D_INFO, "TimerFrequency:0x%lx, TimerLibStartTime:0x%lx, TimerLibEndtime:0x%lx\n", mTimestampProperties.Frequency, mTimerLibStartValue, mTimerLibEndValue));
+
+ //
+ // Install the Timestamp Protocol onto a new handle
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &TimestampHandle,
+ &gEfiTimestampProtocolGuid,
+ &mTimestamp,
+ NULL
+ );
+
+ ASSERT_EFI_ERROR (Status);
+
+ return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf
new file mode 100644
index 000000000..95b0a0838
--- /dev/null
+++ b/MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf
@@ -0,0 +1,49 @@
+## @file
+# Generic Timestamp driver produceing Timestamp Protocol using UEFI APIs.
+#
+# Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = TimestampDxe
+ FILE_GUID = C10194E7-DEB2-4AF4-9EEE-BFFDE4D7D4C7
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = TimestampDriverInitialize
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[Sources]
+ TimestampDxe.c
+
+[LibraryClasses]
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+ TimerLib
+ BaseMemoryLib
+ DebugLib
+
+[Protocols]
+ gEfiTimestampProtocolGuid ## PRODUCES
+
+[depex]
+ TRUE
+
+