summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c95
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c75
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c97
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c14
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c125
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c6
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf1
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c17
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c27
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c12
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h15
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c81
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c32
-rw-r--r--MdeModulePkg/Core/Pei/Memory/MemoryServices.c4
-rw-r--r--MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h2
-rw-r--r--MdeModulePkg/Include/Protocol/FormBrowserEx.h2
-rw-r--r--MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c2
-rw-r--r--MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c11
-rw-r--r--MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c6
-rw-r--r--MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdeModulePkg/MdeModulePkg.dec20
-rw-r--r--MdeModulePkg/MdeModulePkg.dsc4
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c12
-rw-r--r--MdeModulePkg/Universal/DebugPortDxe/DebugPort.c177
-rw-r--r--MdeModulePkg/Universal/DebugPortDxe/DebugPort.h3
-rw-r--r--MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c8
-rw-r--r--MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h3
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c1
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf3
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c45
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf10
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf10
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c4
-rw-r--r--MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf3
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c95
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c13
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c69
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h31
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c40
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c9
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h4
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c4
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c68
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Pcd.c4
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c45
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c140
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c23
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c77
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h10
-rw-r--r--MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c8
51 files changed, 1029 insertions, 550 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index cc575b98c..c397a04cf 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -870,54 +870,18 @@ AtaAtapiPassThruStop (
Instance = ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS (AtaPassThru);
- //
- // Close Non-Blocking timer and free Task list.
- //
- if (Instance->TimerEvent != NULL) {
- gBS->CloseEvent (Instance->TimerEvent);
- Instance->TimerEvent = NULL;
- }
- DestroyAsynTaskList (Instance, FALSE);
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ Controller,
+ &gEfiAtaPassThruProtocolGuid, &(Instance->AtaPassThru),
+ &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru),
+ NULL
+ );
- //
- // Disable this ATA host controller.
- //
- PciIo = Instance->PciIo;
- Status = PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationSupported,
- 0,
- &Supports
- );
- if (!EFI_ERROR (Status)) {
- Supports &= EFI_PCI_DEVICE_ENABLE;
- PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationDisable,
- Supports,
- NULL
- );
+ if (EFI_ERROR (Status)) {
+ return EFI_DEVICE_ERROR;
}
//
- // Restore original PCI attributes
- //
- Status = PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationSet,
- Instance->OriginalPciAttributes,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- gBS->UninstallMultipleProtocolInterfaces (
- Controller,
- &gEfiAtaPassThruProtocolGuid, &(Instance->AtaPassThru),
- &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru),
- NULL
- );
-
- //
// Close protocols opened by AtaAtapiPassThru controller driver
//
gBS->CloseProtocol (
@@ -928,14 +892,24 @@ AtaAtapiPassThruStop (
);
//
+ // Close Non-Blocking timer and free Task list.
+ //
+ if (Instance->TimerEvent != NULL) {
+ gBS->CloseEvent (Instance->TimerEvent);
+ Instance->TimerEvent = NULL;
+ }
+ DestroyAsynTaskList (Instance, FALSE);
+ //
// Free allocated resource
//
- DestroyDeviceInfoList(Instance);
+ DestroyDeviceInfoList (Instance);
//
// If the current working mode is AHCI mode, then pre-allocated resource
// for AHCI initialization should be released.
//
+ PciIo = Instance->PciIo;
+
if (Instance->Mode == EfiAtaAhciMode) {
AhciRegisters = &Instance->AhciRegisters;
PciIo->Unmap (
@@ -966,6 +940,37 @@ AtaAtapiPassThruStop (
AhciRegisters->AhciRFis
);
}
+
+ //
+ // Disable this ATA host controller.
+ //
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSupported,
+ 0,
+ &Supports
+ );
+ if (!EFI_ERROR (Status)) {
+ Supports &= EFI_PCI_DEVICE_ENABLE;
+ PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationDisable,
+ Supports,
+ NULL
+ );
+ }
+
+ //
+ // Restore original PCI attributes
+ //
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSet,
+ Instance->OriginalPciAttributes,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+
FreePool (Instance);
return Status;
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
index 3da1474ed..c9913c07c 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
@@ -2,7 +2,7 @@
This file implements I2C IO Protocol which enables the user to manipulate a single
I2C device independent of the host controller and I2C design.
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2014, 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
@@ -1408,6 +1408,8 @@ I2cBusUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Get the list of all I2C Controller handles in the handle database.
@@ -1422,22 +1424,20 @@ I2cBusUnload (
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Disconnect the driver specified by Driver BindingHandle from all
- // the devices in the handle database.
- //
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- gI2cBusDriverBinding.DriverBindingHandle,
- NULL
- );
- if (EFI_ERROR (Status)) {
- goto Done;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by Driver BindingHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gI2cBusDriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto Done;
+ }
}
}
@@ -1448,14 +1448,47 @@ I2cBusUnload (
gI2cBusDriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
&gI2cBusDriverBinding,
- &gEfiComponentNameProtocolGuid,
- &gI2cBusComponentName,
- &gEfiComponentName2ProtocolGuid,
- &gI2cBusComponentName2,
NULL
);
ASSERT_EFI_ERROR (Status);
+ //
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
+ //
+ Status = gBS->HandleProtocol (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
+ );
+ }
+
+ Status = gBS->HandleProtocol (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
+ }
+
+ Status = EFI_SUCCESS;
+
Done:
//
// Free the buffer containing the list of handles from the handle database
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
index e153a4dc2..0cc8e3384 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
@@ -2,7 +2,7 @@
This file implements I2C Host Protocol which provides callers with the ability to
do I/O transactions to all of the devices on the I2C bus.
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2014, 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
@@ -930,6 +930,7 @@ I2cHostQueueRequest (
I2C_HOST_CONTEXT *I2cHostContext;
BOOLEAN FirstRequest;
UINTN RequestPacketSize;
+ UINTN StartBit;
SyncEvent = NULL;
FirstRequest = FALSE;
@@ -938,6 +939,27 @@ I2cHostQueueRequest (
if (RequestPacket == NULL) {
return EFI_INVALID_PARAMETER;
}
+
+ if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
+ //
+ // 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
+ // bits 10-30 are reserved bits and must be zero
+ //
+ StartBit = 10;
+ } else {
+ //
+ // 7-bit address, Bits 0-6 are used for 7-bit I2C slave addresses,
+ // bits 7-30 are reserved bits and must be zero
+ //
+ StartBit = 7;
+ }
+
+ if (BitFieldRead32 ((UINT32)SlaveAddress, StartBit, 30) != 0) {
+ //
+ // Reserved bit set in the SlaveAddress parameter
+ //
+ return EFI_NOT_FOUND;
+ }
I2cHostContext = I2C_HOST_CONTEXT_FROM_PROTOCOL (This);
@@ -1109,6 +1131,8 @@ I2cHostUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Get the list of all I2C Controller handles in the handle database.
@@ -1123,22 +1147,20 @@ I2cHostUnload (
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Disconnect the driver specified by ImageHandle from all
- // the devices in the handle database.
- //
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
- if (EFI_ERROR (Status)) {
- goto Done;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by ImageHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ ImageHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto Done;
+ }
}
}
@@ -1149,14 +1171,47 @@ I2cHostUnload (
gI2cHostDriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
&gI2cHostDriverBinding,
- &gEfiComponentNameProtocolGuid,
- &gI2cHostComponentName,
- &gEfiComponentName2ProtocolGuid,
- &gI2cHostComponentName2,
NULL
);
ASSERT_EFI_ERROR (Status);
+ //
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
+ //
+ Status = gBS->HandleProtocol (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
+ );
+ }
+
+ Status = gBS->HandleProtocol (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
+ }
+
+ Status = EFI_SUCCESS;
+
Done:
//
// Free the buffer containing the list of handles from the handle database
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 59891b814..700e69e49 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -2049,13 +2049,6 @@ EhcDriverBindingStop (
Ehc = EHC_FROM_THIS (Usb2Hc);
PciIo = Ehc->PciIo;
- //
- // Stop AsyncRequest Polling timer then stop the EHCI driver
- // and uninstall the EHCI protocl.
- //
- gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
- EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
-
Status = gBS->UninstallProtocolInterface (
Controller,
&gEfiUsb2HcProtocolGuid,
@@ -2066,6 +2059,13 @@ EhcDriverBindingStop (
return Status;
}
+ //
+ // Stop AsyncRequest Polling timer then stop the EHCI driver
+ // and uninstall the EHCI protocl.
+ //
+ gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
+ EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
+
if (Ehc->PollTimer != NULL) {
gBS->CloseEvent (Ehc->PollTimer);
}
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
index 4f187e3ab..ee40ba05c 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
@@ -928,97 +928,102 @@ NvmExpressUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
- // Get the list of all the handles in the handle database.
- // If there is an error getting the list, then the unload
- // operation fails.
+ // Get the list of the device handles managed by this driver.
+ // If there is an error getting the list, then means the driver
+ // doesn't manage any device. At this way, we would only close
+ // those protocols installed at image handle.
//
+ DeviceHandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
+ ByProtocol,
+ &gEfiCallerIdGuid,
NULL,
&DeviceHandleCount,
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by ImageHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ ImageHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto EXIT;
+ }
+ }
}
//
- // Disconnect the driver specified by ImageHandle from all
- // the devices in the handle database.
+ // Uninstall all the protocols installed in the driver entry point
//
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid,
+ &gNvmExpressDriverBinding,
+ &gEfiDriverSupportedEfiVersionProtocolGuid,
+ &gNvmExpressDriverSupportedEfiVersion,
+ NULL
+ );
+
+ if (EFI_ERROR (Status)) {
+ goto EXIT;
}
//
- // Uninstall all the protocols installed in the driver entry point
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
//
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiDriverBindingProtocolGuid,
- (VOID **) &DriverBinding
- );
-
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (DriverBinding->ImageHandle != ImageHandle) {
- continue;
- }
-
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
gBS->UninstallProtocolInterface (
ImageHandle,
- &gEfiDriverBindingProtocolGuid,
- DriverBinding
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
);
+ }
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiComponentNameProtocolGuid,
- (VOID **) &ComponentName
- );
- if (!EFI_ERROR (Status)) {
- gBS->UninstallProtocolInterface (
- ImageHandle,
- &gEfiComponentNameProtocolGuid,
- ComponentName
- );
- }
-
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiComponentName2ProtocolGuid,
- (VOID **) &ComponentName2
- );
- if (!EFI_ERROR (Status)) {
- gBS->UninstallProtocolInterface (
- ImageHandle,
- &gEfiComponentName2ProtocolGuid,
- ComponentName2
- );
- }
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ ImageHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
}
+ Status = EFI_SUCCESS;
+
+EXIT:
//
// Free the buffer containing the list of handles from the handle database
//
if (DeviceHandleBuffer != NULL) {
gBS->FreePool (DeviceHandleBuffer);
}
- return EFI_SUCCESS;
+ return Status;
}
/**
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 5afbb8229..2252235bc 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -284,7 +284,11 @@ PciBusDriverBindingStart (
);
}
- gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+ if (PcdGetBool (PcdPciDisableBusEnumeration)) {
+ gFullEnumeration = FALSE;
+ } else {
+ gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+ }
//
// Open Device Path Protocol for PCI root bridge
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
index 34eb672df..917889ca0 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
@@ -108,6 +108,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport
gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport
gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
# [Event]
# ##
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index 00a109437..a3a28f3ed 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
)
{
USB_HC_DEV *Uhc;
+ EFI_STATUS Status;
//
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller
//
Uhc = UHC_FROM_USB2_HC_PROTO (This);
- UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
- gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- &Uhc->Usb2Hc
- );
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ &Uhc->Usb2Hc
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+ }
+
+ UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
UhciFreeAllAsyncReq (Uhc);
UhciDestoryFrameList (Uhc);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index 5ca58fbb9..a831abe77 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -451,7 +451,7 @@ XhcGetRootHubPortStatus (
for (Index = 0; Index < MapSize; Index++) {
if (XHC_BIT_IS_SET (State, mUsbClearPortChangeMap[Index].HwState)) {
- XhcClearRootHubPortFeature (This, PortNumber, mUsbClearPortChangeMap[Index].Selector);
+ XhcClearRootHubPortFeature (This, PortNumber, (EFI_USB_PORT_FEATURE)mUsbClearPortChangeMap[Index].Selector);
}
}
@@ -2129,6 +2129,16 @@ XhcDriverBindingStop (
return Status;
}
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ Usb2Hc
+ );
+
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
Xhc = XHC_FROM_THIS (Usb2Hc);
PciIo = Xhc->PciIo;
@@ -2154,19 +2164,6 @@ XhcDriverBindingStop (
}
}
- XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
- XhcClearBiosOwnership (Xhc);
-
- Status = gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- Usb2Hc
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
if (Xhc->PollTimer != NULL) {
gBS->CloseEvent (Xhc->PollTimer);
}
@@ -2175,6 +2172,8 @@ XhcDriverBindingStop (
gBS->CloseEvent (Xhc->ExitBootServiceEvent);
}
+ XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
+ XhcClearBiosOwnership (Xhc);
XhciDelAllAsyncIntTransfers (Xhc);
XhcFreeSched (Xhc);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index a66d7cd95..a513dd958 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -2,7 +2,7 @@
The XHCI register operation routines.
-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
@@ -499,7 +499,7 @@ XhcClearOpRegBit (
@param Offset The offset of the operation register.
@param Bit The bit of the register to wait for.
@param WaitToSet Wait the bit to set or clear.
- @param Timeout The time to wait before abort (in millisecond, ms).
+ @param Timeout The time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The bit successfully changed by host controller.
@retval EFI_TIMEOUT The time out occurred.
@@ -517,7 +517,7 @@ XhcWaitOpRegBit (
UINT32 Index;
UINTN Loop;
- Loop = (Timeout * XHC_1_MILLISECOND / XHC_POLL_DELAY) + 1;
+ Loop = (Timeout / XHC_POLL_DELAY) + 1;
for (Index = 0; Index < Loop; Index++) {
if (XHC_REG_BIT_IS_SET (Xhc, Offset, Bit) == WaitToSet) {
@@ -656,7 +656,7 @@ XhcIsSysError (
Reset the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The XHCI host controller is reset.
@return Others Failed to reset the XHCI before Timeout.
@@ -698,7 +698,7 @@ XhcResetHC (
Halt the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is halt.
@return EFI_TIMEOUT Failed to halt the XHCI before Timeout.
@@ -722,7 +722,7 @@ XhcHaltHC (
Set the XHCI host controller to run.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is running.
@return EFI_TIMEOUT Failed to set the XHCI to run before Timeout.
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
index dc8281198..b748c8d39 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
@@ -198,8 +198,13 @@ typedef union {
//
// Hub Class Feature Selector for Clear Port Feature Request
+// It's the extension of hub class feature selector of USB 2.0 in USB 3.0 Spec.
+// For more details, Please refer to USB 3.0 Spec Table 10-7.
//
-#define Usb3PortBHPortResetChange 29
+typedef enum {
+ Usb3PortBHPortReset = 28,
+ Usb3PortBHPortResetChange = 29
+} XHC_PORT_FEATURE;
//
// Structure to map the hardware port states to the
@@ -394,7 +399,7 @@ XhcClearOpRegBit (
@param Offset The offset of the operational register.
@param Bit The bit of the register to wait for.
@param WaitToSet Wait the bit to set or clear.
- @param Timeout The time to wait before abort (in millisecond, ms).
+ @param Timeout The time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The bit successfully changed by host controller.
@retval EFI_TIMEOUT The time out occurred.
@@ -516,7 +521,7 @@ XhcIsSysError (
Reset the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The XHCI host controller is reset.
@return Others Failed to reset the XHCI before Timeout.
@@ -532,7 +537,7 @@ XhcResetHC (
Halt the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is halt.
@return EFI_TIMEOUT Failed to halt the XHCI before Timeout.
@@ -548,7 +553,7 @@ XhcHaltHC (
Set the XHCI host controller to run.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is running.
@return EFI_TIMEOUT Failed to set the XHCI to run before Timeout.
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
index ff6b99c87..ef002f53b 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
@@ -1402,6 +1402,7 @@ UsbBusControllerDriverStop (
EFI_TPL OldTpl;
UINTN Index;
EFI_STATUS Status;
+ EFI_STATUS ReturnStatus;
Status = EFI_SUCCESS;
@@ -1411,6 +1412,7 @@ UsbBusControllerDriverStop (
//
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ ReturnStatus = EFI_SUCCESS;
for (Index = 0; Index < NumberOfChildren; Index++) {
Status = gBS->OpenProtocol (
ChildHandleBuffer[Index],
@@ -1434,11 +1436,11 @@ UsbBusControllerDriverStop (
UsbIf = USB_INTERFACE_FROM_USBIO (UsbIo);
UsbDev = UsbIf->Device;
- UsbRemoveDevice (UsbDev);
+ ReturnStatus = UsbRemoveDevice (UsbDev);
}
gBS->RestoreTPL (OldTpl);
- return EFI_SUCCESS;
+ return ReturnStatus;
}
DEBUG (( EFI_D_INFO, "UsbBusStop: usb bus stopped on %p\n", Controller));
@@ -1471,53 +1473,60 @@ UsbBusControllerDriverStop (
RootHub = Bus->Devices[0];
RootIf = RootHub->Interfaces[0];
- mUsbRootHubApi.Release (RootIf);
-
ASSERT (Bus->MaxDevices <= 256);
+ ReturnStatus = EFI_SUCCESS;
for (Index = 1; Index < Bus->MaxDevices; Index++) {
if (Bus->Devices[Index] != NULL) {
- UsbRemoveDevice (Bus->Devices[Index]);
+ Status = UsbRemoveDevice (Bus->Devices[Index]);
+ if (EFI_ERROR (Status)) {
+ ReturnStatus = Status;
+ }
}
}
gBS->RestoreTPL (OldTpl);
- gBS->FreePool (RootIf);
- gBS->FreePool (RootHub);
- Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList);
- ASSERT (!EFI_ERROR (Status));
+ if (!EFI_ERROR (ReturnStatus)) {
+ mUsbRootHubApi.Release (RootIf);
+ gBS->FreePool (RootIf);
+ gBS->FreePool (RootHub);
- //
- // Uninstall the bus identifier and close USB_HC/USB2_HC protocols
- //
- gBS->UninstallProtocolInterface (Controller, &gEfiCallerIdGuid, &Bus->BusId);
+ Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList);
+ ASSERT (!EFI_ERROR (Status));
- if (Bus->Usb2Hc != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
+ //
+ // Uninstall the bus identifier and close USB_HC/USB2_HC protocols
+ //
+ gBS->UninstallProtocolInterface (Controller, &gEfiCallerIdGuid, &Bus->BusId);
- if (Bus->UsbHc != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUsbHcProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
+ if (Bus->Usb2Hc != NULL) {
+ Status = gBS->CloseProtocol (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ }
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ if (Bus->UsbHc != NULL) {
+ Status = gBS->CloseProtocol (
+ Controller,
+ &gEfiUsbHcProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ }
- gBS->FreePool (Bus);
+ if (!EFI_ERROR (Status)) {
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ gBS->FreePool (Bus);
+ }
+ }
return Status;
}
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 96381cd8c..3c867bfb1 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1,7 +1,7 @@
/** @file
EFI PEI Core dispatch services
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, 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
@@ -49,7 +49,7 @@ DiscoverPeimsAndOrderWithApriori (
UINTN PeimIndex;
UINTN PeimCount;
EFI_GUID *Guid;
- EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
+ EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1];
EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_FV_FILE_INFO FileInfo;
@@ -75,20 +75,21 @@ DiscoverPeimsAndOrderWithApriori (
//
// Go ahead to scan this Fv, and cache FileHandles within it.
//
- for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
+ Status = EFI_NOT_FOUND;
+ for (PeimCount = 0; PeimCount <= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);
- if (Status != EFI_SUCCESS) {
+ if (Status != EFI_SUCCESS || PeimCount == FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
break;
}
Private->CurrentFvFileHandles[PeimCount] = FileHandle;
}
-
+
//
- // Check whether the count of Peims exceeds the max support PEIMs in a FV image
- // If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
+ // Check whether the count of files exceeds the max support files in a FV image
+ // If more files are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
//
- ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));
+ ASSERT ((Status != EFI_SUCCESS) || (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)));
//
// Get Apriori File handle
@@ -660,6 +661,7 @@ PeiDispatcher (
PEIM_FILE_HANDLE_EXTENDED_DATA ExtendedData;
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI *TemporaryRamSupportPpi;
UINT64 NewStackSize;
+ UINTN HeapTemporaryRamSize;
EFI_PHYSICAL_ADDRESS BaseOfNewHeap;
EFI_PHYSICAL_ADDRESS TopOfNewStack;
EFI_PHYSICAL_ADDRESS TopOfOldStack;
@@ -995,13 +997,21 @@ PeiDispatcher (
PeiCore (SecCoreData, NULL, Private);
} else {
//
+ // Migrate the PEI Services Table pointer from temporary RAM to permanent RAM.
+ //
+ MigratePeiServicesTablePointer ();
+
+ //
// Heap Offset
//
BaseOfNewHeap = TopOfNewStack;
HoleMemBase = TopOfNewStack;
HoleMemSize = TemporaryRamSize - PeiTemporaryRamSize - TemporaryStackSize;
if (HoleMemSize != 0) {
- BaseOfNewHeap = BaseOfNewHeap + HoleMemSize;
+ //
+ // Make sure HOB List start address is 8 byte alignment.
+ //
+ BaseOfNewHeap = ALIGN_VALUE (BaseOfNewHeap + HoleMemSize, 8);
}
if (BaseOfNewHeap >= (UINTN)SecCoreData->PeiTemporaryRamBase) {
Private->HeapOffsetPositive = TRUE;
@@ -1014,7 +1024,9 @@ PeiDispatcher (
//
// Migrate Heap
//
- CopyMem ((UINT8 *) (UINTN) BaseOfNewHeap, (UINT8 *) PeiTemporaryRamBase, PeiTemporaryRamSize);
+ HeapTemporaryRamSize = (UINTN) (Private->HobList.HandoffInformationTable->EfiFreeMemoryBottom - Private->HobList.HandoffInformationTable->EfiMemoryBottom);
+ ASSERT (BaseOfNewHeap + HeapTemporaryRamSize <= Private->FreePhysicalMemoryTop);
+ CopyMem ((UINT8 *) (UINTN) BaseOfNewHeap, (UINT8 *) PeiTemporaryRamBase, HeapTemporaryRamSize);
//
// Migrate Stack
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index c7a06a3c5..10f21d562 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -1,7 +1,7 @@
/** @file
EFI PEI Core memory services
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, 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
@@ -182,7 +182,7 @@ PeiAllocatePages (
//
// Verify that there is sufficient memory to satisfy the allocation
//
- RemainingPages = EFI_SIZE_TO_PAGES ((UINTN) (*FreeMemoryTop - *FreeMemoryBottom));
+ RemainingPages = (UINTN)(*FreeMemoryTop - *FreeMemoryBottom) >> EFI_PAGE_SHIFT;
//
// For page allocation, the overhead sizeof (EFI_HOB_MEMORY_ALLOCATION) needs one extra page.
// So the number of remaining pages needs to be greater than that of the request pages.
diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
index 16384f831..b3016eee5 100644
--- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
+++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
@@ -85,7 +85,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/MdeModulePkg/Include/Protocol/FormBrowserEx.h b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
index afeb7c0c0..3bb64c6ff 100644
--- a/MdeModulePkg/Include/Protocol/FormBrowserEx.h
+++ b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
@@ -27,6 +27,7 @@ typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION
#define BROWSER_NO_CHANGES 0
#define BROWSER_SAVE_CHANGES 1
#define BROWSER_DISCARD_CHANGES 2
+#define BROWSER_KEEP_CURRENT 3
//
// Browser actions. They can be cominbed together.
@@ -126,6 +127,7 @@ VOID
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
typedef
diff --git a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
index ded14a335..2fea24ac3 100644
--- a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
+++ b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
@@ -86,7 +86,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index 82ab82bb3..ad4bc9ac9 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -322,7 +322,9 @@ ProcessExternedOpcode (
)
{
LIST_ENTRY *Link;
+ LIST_ENTRY *NestLink;
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+ FORM_DISPLAY_ENGINE_STATEMENT *NestStatement;
Link = GetFirstNode (&FormData->StatementListOSF);
while (!IsNull (&FormData->StatementListOSF, Link)) {
@@ -338,6 +340,15 @@ ProcessExternedOpcode (
Link = GetNextNode (&FormData->StatementListHead, Link);
ProcessUserOpcode(Statement->OpCode);
+
+ NestLink = GetFirstNode (&Statement->NestStatementList);
+ while (!IsNull (&Statement->NestStatementList, NestLink)) {
+ NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
+ NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
+
+ ProcessUserOpcode(NestStatement->OpCode);
+ }
+
}
}
diff --git a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
index 97e065aee..bbb755fa2 100644
--- a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
@@ -2,7 +2,7 @@
Support routines for memory allocation routines based
on boot services for Dxe phase drivers.
- Copyright (c) 2006 - 2008, 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
@@ -160,6 +160,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -246,6 +247,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -273,6 +275,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -300,6 +303,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index c087dd940..eab1b4180 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -1,7 +1,7 @@
/** @file
Save the S3 data to S3 boot script.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -62,7 +62,7 @@ EFI_GUID mBootScriptHeaderDataGuid = {
This is an internal function to add a terminate node the entry, recalculate the table
length and fill into the table.
- @return the base address of the boot script tble.
+ @return the base address of the boot script table.
**/
UINT8*
S3BootScriptInternalCloseTable (
@@ -651,7 +651,7 @@ SyncBootScript (
how to get the script to run on an S3 resume because the boot script maintained by the lib will be
destroyed.
- @return the base address of the new copy of the boot script tble.
+ @return the base address of the new copy of the boot script table.
@note this function could only called in boot time phase
**/
diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
index 7435844fb..a6372ed75 100644
--- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
@@ -1,7 +1,7 @@
/** @file
Support routines for memory allocation routines based on SMM Core internal functions.
- 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
@@ -251,6 +251,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -337,6 +338,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -364,6 +366,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -391,6 +394,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index b627eb101..a557466cd 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -4,7 +4,7 @@
# It also provides the defintions(including PPIs/PROTOCOLs/GUIDs and library classes)
# and libraries instances, which are used for those modules.
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, 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 that accompanies this distribution.
# The full text of the license may be found at
@@ -20,7 +20,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = MdeModulePkg
PACKAGE_GUID = BA0D78D6-2CAF-414b-BD4D-B6762A894288
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include
@@ -522,15 +522,11 @@
# for a dynamic PCD used in PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f
- ## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
- # to store PCD value.
- #
- gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010
-
## Maximum number of FV is supported by PeiCore's dispatching.
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030
- ## Maximum PEIM count in every FV is supported by PeiCore's dispatching.
+ ## Maximum File count in every FV is supported by PeiCore's dispatching.
+ # PeiCore supported File type includes PEIM, Combined PEIM and FV.
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031
## Maximum stack size for PeiCore.
@@ -608,6 +604,11 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd|0x03078001|UINT32|0x30001033
[PcdsFixedAtBuild,PcdsPatchableInModule]
+ ## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
+ # to store PCD value.
+ #
+ gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010
+
## Maximun number of performance log entries during PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
@@ -878,6 +879,9 @@
## This PCD specified whether the S.M.A.R.T feature of attached ATA hard disks are enabled.
gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable|TRUE|BOOLEAN|0x00010065
+ ## This PCD specifies whether full PCI enumeration is disabled.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048
+
[PcdsPatchableInModule]
## Specify memory size with page number for PEI code when
# the feature of Loading Module at Fixed Address is enabled
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index f31a4d156..f47332534 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -1,7 +1,7 @@
## @file
# EFI/PI Reference Module Package for All Architectures
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, 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
@@ -16,7 +16,7 @@
[Defines]
PLATFORM_NAME = MdeModule
PLATFORM_GUID = 587CE499-6CBE-43cd-94E2-186218569478
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/MdeModule
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index 0861a6477..61ee91951 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -41,6 +41,9 @@ EFI_HANDLE mNewHandle = NULL;
//
UINTN mTimes = 0;
+UINT32 mMaxSizePopulateCapsule = 0;
+UINT32 mMaxSizeNonPopulateCapsule = 0;
+
/**
Create the variable to save the base address of page table and stack
for transferring into long mode in IA32 PEI.
@@ -339,13 +342,13 @@ QueryCapsuleCapabilities (
return EFI_UNSUPPORTED;
}
*ResetType = EfiResetWarm;
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizePopulateCapsule);
+ *MaxiumCapsuleSize = (UINT64) mMaxSizePopulateCapsule;
} else {
//
// For non-reset capsule image.
//
*ResetType = EfiResetCold;
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizeNonPopulateCapsule);
+ *MaxiumCapsuleSize = (UINT64) mMaxSizeNonPopulateCapsule;
}
return EFI_SUCCESS;
@@ -370,7 +373,10 @@ CapsuleServiceInitialize (
)
{
EFI_STATUS Status;
-
+
+ mMaxSizePopulateCapsule = PcdGet32(PcdMaxSizePopulateCapsule);
+ mMaxSizeNonPopulateCapsule = PcdGet32(PcdMaxSizeNonPopulateCapsule);
+
//
// When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are
// put above 4GB, so capsule PEI will transfer to long mode to get capsule data.
diff --git a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
index 2616299df..00889a246 100644
--- a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
+++ b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
@@ -4,7 +4,7 @@
ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM
INTERRUPT CONTEXT
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, 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
@@ -33,7 +33,6 @@ DEBUGPORT_DEVICE mDebugPortDevice = {
DEBUGPORT_DEVICE_SIGNATURE,
(EFI_HANDLE) 0,
(EFI_HANDLE) 0,
- (VOID *) NULL,
(EFI_DEVICE_PATH_PROTOCOL *) NULL,
{
DebugPortReset,
@@ -57,72 +56,52 @@ DEBUGPORT_DEVICE mDebugPortDevice = {
Records requested settings in DebugPort device structure.
**/
-VOID
+EFI_DEVICE_PATH_PROTOCOL *
GetDebugPortVariable (
VOID
)
{
UINTN DataSize;
+ EFI_DEVICE_PATH_PROTOCOL *DebugPortVariable;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- DataSize = 0;
- Status = gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- mDebugPortDevice.DebugPortVariable
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- FreePool (mDebugPortDevice.DebugPortVariable);
- }
+ GetVariable2 (EFI_DEBUGPORT_VARIABLE_NAME, &gEfiDebugPortVariableGuid, (VOID **) &DebugPortVariable, &DataSize);
+ if (DebugPortVariable == NULL) {
+ return NULL;
+ }
- mDebugPortDevice.DebugPortVariable = AllocatePool (DataSize);
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- mDebugPortDevice.DebugPortVariable
- );
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) mDebugPortDevice.DebugPortVariable;
- while (!IsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {
- DevicePath = NextDevicePathNode (DevicePath);
- }
+ DevicePath = DebugPortVariable;
+ while (!IsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {
+ DevicePath = NextDevicePathNode (DevicePath);
+ }
- if (IsDevicePathEnd (DevicePath)) {
- FreePool (mDebugPortDevice.DebugPortVariable);
- mDebugPortDevice.DebugPortVariable = NULL;
- } else {
- CopyMem (
- &mDebugPortDevice.BaudRate,
- &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
- );
- mDebugPortDevice.ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
- mDebugPortDevice.Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
- CopyMem (
- &mDebugPortDevice.Parity,
- &((UART_DEVICE_PATH *) DevicePath)->Parity,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
- );
- CopyMem (
- &mDebugPortDevice.DataBits,
- &((UART_DEVICE_PATH *) DevicePath)->DataBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
- );
- CopyMem (
- &mDebugPortDevice.StopBits,
- &((UART_DEVICE_PATH *) DevicePath)->StopBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
- );
- }
- }
+ if (IsDevicePathEnd (DevicePath)) {
+ FreePool (DebugPortVariable);
+ return NULL;
+ } else {
+ CopyMem (
+ &mDebugPortDevice.BaudRate,
+ &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
+ );
+ mDebugPortDevice.ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
+ mDebugPortDevice.Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
+ CopyMem (
+ &mDebugPortDevice.Parity,
+ &((UART_DEVICE_PATH *) DevicePath)->Parity,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
+ );
+ CopyMem (
+ &mDebugPortDevice.DataBits,
+ &((UART_DEVICE_PATH *) DevicePath)->DataBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
+ );
+ CopyMem (
+ &mDebugPortDevice.StopBits,
+ &((UART_DEVICE_PATH *) DevicePath)->StopBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
+ );
+ return DebugPortVariable;
}
}
@@ -196,8 +175,8 @@ DebugPortSupported (
)
{
EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *Dp1;
- EFI_DEVICE_PATH_PROTOCOL *Dp2;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *DebugPortVariable;
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEBUGPORT_PROTOCOL *DebugPortInterface;
EFI_HANDLE TempHandle;
@@ -212,25 +191,19 @@ DebugPortSupported (
//
// Read DebugPort variable to determine debug port selection and parameters
//
- GetDebugPortVariable ();
+ DebugPortVariable = GetDebugPortVariable ();
- if (mDebugPortDevice.DebugPortVariable != NULL) {
+ if (DebugPortVariable != NULL) {
//
// There's a DEBUGPORT variable, so do LocateDevicePath and check to see if
// the closest matching handle matches the controller handle, and if it does,
// check to see that the remaining device path has the DebugPort GUIDed messaging
// device path only. Otherwise, it's a mismatch and EFI_UNSUPPORTED is returned.
//
- Dp1 = DuplicateDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) mDebugPortDevice.DebugPortVariable);
- if (Dp1 == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Dp2 = Dp1;
-
+ DevicePath = DebugPortVariable;
Status = gBS->LocateDevicePath (
&gEfiSerialIoProtocolGuid,
- &Dp2,
+ &DevicePath,
&TempHandle
);
@@ -239,18 +212,18 @@ DebugPortSupported (
}
if (Status == EFI_SUCCESS &&
- (Dp2->Type != MESSAGING_DEVICE_PATH ||
- Dp2->SubType != MSG_VENDOR_DP ||
- *((UINT16 *) Dp2->Length) != sizeof (DEBUGPORT_DEVICE_PATH))) {
+ (DevicePath->Type != MESSAGING_DEVICE_PATH ||
+ DevicePath->SubType != MSG_VENDOR_DP ||
+ *((UINT16 *) DevicePath->Length) != sizeof (DEBUGPORT_DEVICE_PATH))) {
Status = EFI_UNSUPPORTED;
}
- if (Status == EFI_SUCCESS && !CompareGuid (&gEfiDebugPortDevicePathGuid, (GUID *) (Dp2 + 1))) {
+ if (Status == EFI_SUCCESS && !CompareGuid (&gEfiDebugPortDevicePathGuid, (GUID *) (DevicePath + 1))) {
Status = EFI_UNSUPPORTED;
}
- FreePool (Dp1);
+ FreePool (DebugPortVariable);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -713,16 +686,60 @@ ImageUnloadHandler (
EFI_HANDLE ImageHandle
)
{
+ EFI_STATUS Status;
+ VOID *ComponentName;
+ VOID *ComponentName2;
+
if (mDebugPortDevice.SerialIoBinding != NULL) {
return EFI_ABORTED;
}
//
- // Clean up allocations
+ // Driver is stopped already.
//
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- FreePool (mDebugPortDevice.DebugPortVariable);
+ Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentNameProtocolGuid, &ComponentName);
+ if (EFI_ERROR (Status)) {
+ ComponentName = NULL;
}
- return EFI_SUCCESS;
+ Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentName2ProtocolGuid, &ComponentName2);
+ if (EFI_ERROR (Status)) {
+ ComponentName2 = NULL;
+ }
+
+ if (ComponentName == NULL) {
+ if (ComponentName2 == NULL) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ NULL
+ );
+ } else {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentName2ProtocolGuid, ComponentName2,
+ NULL
+ );
+ }
+ } else {
+ if (ComponentName2 == NULL) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentNameProtocolGuid, ComponentName,
+ NULL
+ );
+ } else {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentNameProtocolGuid, ComponentName,
+ &gEfiComponentName2ProtocolGuid, ComponentName2,
+ NULL
+ );
+ }
+ }
+
+ return Status;
}
diff --git a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
index f10822365..3ce702dfa 100644
--- a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
+++ b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
@@ -1,7 +1,7 @@
/** @file
Definitions and prototypes for DebugPort driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, 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
@@ -52,7 +52,6 @@ typedef struct {
UINT32 Signature;
EFI_HANDLE DriverBindingHandle;
EFI_HANDLE DebugPortDeviceHandle;
- VOID *DebugPortVariable;
EFI_DEVICE_PATH_PROTOCOL *DebugPortDevicePath;
EFI_DEBUGPORT_PROTOCOL DebugPortInterface;
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
index ee0b4e686..dccb46054 100644
--- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
+++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
@@ -1,7 +1,7 @@
/** @file
Source file for CD recovery PEIM
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -259,7 +259,7 @@ FindRecoveryCapsules (
while (TRUE) {
SetMem (Buffer, BufferSize, 0);
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
BlockIoPpi,
IndexBlockDevice,
Lba,
@@ -350,7 +350,7 @@ RetrieveCapsuleFileFromRoot (
SetMem (Buffer, BufferSize, 0);
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
BlockIoPpi,
IndexBlockDevice,
Lba,
@@ -566,7 +566,7 @@ LoadRecoveryCapsule (
BlockIoPpi = PrivateData->CapsuleData[CapsuleInstance - 1].BlockIo;
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ PeiServices,
BlockIoPpi,
PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
index 99edd3d5a..b452747e7 100644
--- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
+++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
@@ -1,7 +1,7 @@
/** @file
Header file for CD recovery PEIM
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -74,7 +74,6 @@ typedef struct {
typedef struct {
UINTN Signature;
- EFI_PEI_SERVICES **PeiServices;
EFI_PEI_DEVICE_RECOVERY_MODULE_PPI DeviceRecoveryPpi;
EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index f53c3d91d..eb3edeb53 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -1111,6 +1111,7 @@ DiskIo2FlushDiskEx (
return Status;
}
Task->Signature = DISK_IO2_FLUSH_TASK_SIGNATURE;
+ Task->Token = Token;
Status = Private->BlockIo2->FlushBlocksEx (Private->BlockIo2, &Task->BlockIo2Token);
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Task->BlockIo2Token.Event);
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf b/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
index 323fcadb8..6a32221b2 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
@@ -54,9 +54,6 @@
gEdkiiFormDisplayEngineProtocolGuid
gEdkiiFormBrowserEx2ProtocolGuid
-[Guids]
- gEfiIfrTianoGuid ## CONSUMES ## GUID
-
[Depex]
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid AND gEdkiiFormBrowserEx2ProtocolGuid
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index dbc5685b0..5dfc482f3 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -1,7 +1,7 @@
/** @file
Entry and initialization module for the browser.
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, 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
@@ -699,6 +699,13 @@ ConvertStatementToMenu (
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
+ //
+ // Skip the opcode not recognized by Display core.
+ //
+ if (NestStatement->OpCode->OpCode == EFI_IFR_GUID_OP) {
+ continue;
+ }
+
UiAddMenuOption (NestStatement, &MenuItemCount, TRUE);
}
}
@@ -1713,6 +1720,7 @@ HasOptionString (
@param SkipLine The skip line for this menu.
@param BottomRow The bottom row for this form.
@param Highlight Whether this menu will be highlight.
+ @param UpdateCol Whether need to update the column info for Date/Time.
@retval EFI_SUCESSS Process the user selection success.
@@ -1724,7 +1732,8 @@ DisplayOneMenu (
IN UINTN BeginCol,
IN UINTN SkipLine,
IN UINTN BottomRow,
- IN BOOLEAN Highlight
+ IN BOOLEAN Highlight,
+ IN BOOLEAN UpdateCol
)
{
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
@@ -1773,7 +1782,7 @@ DisplayOneMenu (
//
// Adjust option string for date/time opcode.
//
- ProcessStringForDateTime(MenuOption, OptionString, TRUE);
+ ProcessStringForDateTime(MenuOption, OptionString, UpdateCol);
}
Width = (UINT16) gOptionBlockWidth - 1;
@@ -1798,8 +1807,9 @@ DisplayOneMenu (
} 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);
+ // The OutputString has a NARROW_CHAR or WIDE_CHAR at the begin of the string,
+ // so need to - 1 to remove it, otherwise, it will clean 1 extr char follow it.
+ DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString) - 1, Highlight);
}
} else {
DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight);
@@ -2160,7 +2170,8 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn + gModalSkipColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
- (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),
+ TRUE
);
} else {
Status = DisplayOneMenu (MenuOption,
@@ -2168,8 +2179,9 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
- (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
- );
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),
+ TRUE
+ );
}
if (EFI_ERROR (Status)) {
@@ -2272,6 +2284,7 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Temp,
BottomRow,
+ FALSE,
FALSE
);
}
@@ -2293,7 +2306,8 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Temp2,
BottomRow,
- TRUE
+ TRUE,
+ FALSE
);
}
break;
@@ -2548,12 +2562,12 @@ UiDisplayMenu (
// If the screen has no menu items, and the user didn't select UiReset
// ignore the selection and go back to reading keys.
//
+ ASSERT(MenuOption != NULL);
if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) {
ControlFlag = CfReadKey;
break;
}
- ASSERT(MenuOption != NULL);
Statement = MenuOption->ThisTag;
if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP)
|| (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)
@@ -2736,7 +2750,8 @@ UiDisplayMenu (
case CfUiHotKey:
ControlFlag = CfRepaint;
-
+
+ ASSERT (HotKey != NULL);
gUserInput->Action = HotKey->Action;
ControlFlag = CfExit;
break;
@@ -2774,16 +2789,16 @@ UiDisplayMenu (
NewLine = TRUE;
SavedListEntry = NewPos;
-
ASSERT(NewPos != NULL);
+
+ MenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ ASSERT (MenuOption != NULL);
+
//
// Adjust Date/Time position before we advance forward.
//
AdjustDateAndTimePosition (TRUE, &NewPos);
- MenuOption = MENU_OPTION_FROM_LINK (NewPos);
- ASSERT (MenuOption != NULL);
-
NewPos = NewPos->BackLink;
//
// Find next selectable menu or the first menu beyond current form.
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
index f4576447d..b44e1e21a 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
@@ -3,7 +3,7 @@
# which provides fault tolerant write capability for block devices.
# Its implementation depends on the full functionality FVB protocol that support read, write/erase flash access.
#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, 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
@@ -68,6 +68,12 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#
+# gBS->CalculateCrc32() is consumed in EntryPoint.
+# PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_ARCH_PROTOCOL
+# has been installed, then the Boot Service CalculateCrc32() is available.
+# So add gEfiRuntimeArchProtocolGuid Depex here.
+#
[Depex]
- gEfiFirmwareVolumeBlockProtocolGuid
+ gEfiFirmwareVolumeBlockProtocolGuid AND gEfiRuntimeArchProtocolGuid
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
index 7740efa35..a6fdd9818 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
@@ -4,7 +4,7 @@
# depends on the full functionality SMM FVB protocol that support read, write/erase
# flash access.
#
-# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2014, 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
@@ -73,6 +73,12 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#
+# gBS->CalculateCrc32() is consumed in EntryPoint.
+# PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_ARCH_PROTOCOL
+# has been installed, then the Boot Service CalculateCrc32() is available.
+# So add gEfiRuntimeArchProtocolGuid Depex here.
+#
[Depex]
- gEfiSmmFirmwareVolumeBlockProtocolGuid
+ gEfiSmmFirmwareVolumeBlockProtocolGuid AND gEfiRuntimeArchProtocolGuid
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index fb69b9ca1..0b2138ce6 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -1287,7 +1287,7 @@ IsThisVarstore (
//
// If ConfigHdr has name field and varstore not has name, return FALSE.
//
- if (Name == NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {
+ if (Name == NULL && ConfigHdr != NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {
return FALSE;
}
@@ -1432,13 +1432,11 @@ IsThisPackageList (
// No matched varstore is found and directly return.
//
goto Done;
- break;
default:
break;
}
}
-
Done:
if (HiiFormPackage != NULL) {
FreePool (HiiFormPackage);
diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
index 529ca7775..1804e8ac3 100644
--- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
+++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
@@ -60,5 +60,4 @@
gEfiLockBoxProtocolGuid ## PRODUCED
[Depex]
- gEfiSmmSwDispatch2ProtocolGuid
-
+ TRUE
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index f4663d9f5..b38961047 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,7 +1,7 @@
/** @file
The entry point of IScsi driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, 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
@@ -439,10 +439,12 @@ EfiIScsiUnload (
IN EFI_HANDLE ImageHandle
)
{
- EFI_STATUS Status;
- UINTN DeviceHandleCount;
- EFI_HANDLE *DeviceHandleBuffer;
- UINTN Index;
+ EFI_STATUS Status;
+ UINTN DeviceHandleCount;
+ EFI_HANDLE *DeviceHandleBuffer;
+ UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Try to disonnect the driver from the devices it's controlling.
@@ -454,40 +456,89 @@ EfiIScsiUnload (
&DeviceHandleCount,
&DeviceHandleBuffer
);
- if (!EFI_ERROR (Status)) {
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
- }
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- if (DeviceHandleBuffer != NULL) {
- FreePool (DeviceHandleBuffer);
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = IScsiTestManagedDevice (
+ DeviceHandleBuffer[Index],
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiTcp4ProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ continue;
}
- }
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gIScsiDriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
//
// Unload the iSCSI configuration form.
//
- IScsiConfigFormUnload (gIScsiDriverBinding.DriverBindingHandle);
+ Status = IScsiConfigFormUnload (gIScsiDriverBinding.DriverBindingHandle);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
//
- // Uninstall the protocols installed by iSCSI driver.
+ // Uninstall the ComponentName and ComponentName2 protocol from iSCSI4 driver binding handle
+ // if it has been installed.
//
+ Status = gBS->HandleProtocol (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ Status = gBS->HandleProtocol (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
Status = gBS->UninstallMultipleProtocolInterfaces (
ImageHandle,
&gEfiDriverBindingProtocolGuid,
&gIScsiDriverBinding,
- &gEfiComponentName2ProtocolGuid,
- &gIScsiComponentName2,
- &gEfiComponentNameProtocolGuid,
- &gIScsiComponentName,
&gEfiIScsiInitiatorNameProtocolGuid,
&gIScsiInitiatorName,
NULL
);
+ON_EXIT:
+ if (DeviceHandleBuffer != NULL) {
+ FreePool (DeviceHandleBuffer);
+ }
+
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index 04f5df34a..372efdc15 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -349,9 +349,16 @@ IScsiFillNICAndTargetSections (
Target->Header.Index = (UINT8) Index;
Target->Header.Flags = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BLOCK_VALID | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BOOT_SELECTED;
Target->Port = SessionConfigData->NvData.TargetPort;
- Target->CHAPType = AuthConfig->CHAPType;
Target->NicIndex = (UINT8) Index;
+ if (AuthConfig->CHAPType == ISCSI_CHAP_NONE) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP;
+ } if (AuthConfig->CHAPType == ISCSI_CHAP_UNI) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP;
+ } else if (AuthConfig->CHAPType == ISCSI_CHAP_MUTUAL) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP;
+ }
+
IScsiMapV4ToV6Addr (&SessionConfigData->NvData.TargetIp, &Target->Ip);
CopyMem (Target->BootLun, SessionConfigData->NvData.BootLun, sizeof (Target->BootLun));
@@ -364,7 +371,7 @@ IScsiFillNICAndTargetSections (
Target->IScsiNameLength = Length;
Target->IScsiNameOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);
- if (Target->CHAPType != ISCSI_CHAP_NONE) {
+ if (Target->CHAPType != EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP) {
//
// CHAP Name
//
@@ -381,7 +388,7 @@ IScsiFillNICAndTargetSections (
Target->CHAPSecretLength = Length;
Target->CHAPSecretOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);
- if (Target->CHAPType == ISCSI_CHAP_MUTUAL) {
+ if (Target->CHAPType == EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP) {
//
// Reverse CHAP Name
//
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
index 2e43b415e..a00d805b8 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
@@ -1,7 +1,7 @@
/** @file
Miscellaneous routines for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, 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
@@ -852,3 +852,70 @@ IScsiOnExitBootService (
IScsiSessionAbort (&Private->Session);
}
+
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ )
+{
+ EFI_STATUS Status;
+ VOID *ManagedInterface;
+ EFI_HANDLE NicControllerHandle;
+
+ ASSERT (ProtocolGuid != NULL);
+
+ NicControllerHandle = NetLibGetNicHandle (ControllerHandle, ProtocolGuid);
+ if (NicControllerHandle == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ &ManagedInterface,
+ DriverBindingHandle,
+ NicControllerHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->CloseProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ DriverBindingHandle,
+ NicControllerHandle
+ );
+ return EFI_UNSUPPORTED;
+ }
+
+ if (Status != EFI_ALREADY_STARTED) {
+ return EFI_UNSUPPORTED;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
index b310c9c57..052a90f8d 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
@@ -1,7 +1,7 @@
/** @file
Miscellaneous definitions for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, 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
@@ -275,6 +275,35 @@ IScsiOnExitBootService (
IN VOID *Context
);
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ );
#endif
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
index 1aa3207ea..7f03b848e 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
@@ -1,7 +1,7 @@
/** @file
Implementation of Managed Network Protocol I/O functions.
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2014, 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
@@ -128,12 +128,19 @@ MnpBuildTxPacket (
MNP_DEVICE_DATA *MnpDerviceData;
MnpDerviceData = MnpServiceData->MnpDeviceData;
+
+ //
+ // Reserve space for vlan tag.
+ //
+ *PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;
+
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {
- //
- // Media header is in FragmentTable and there is only one fragment,
- // use fragment buffer directly.
- //
- *PktBuf = TxData->FragmentTable[0].FragmentBuffer;
+ CopyMem (
+ *PktBuf,
+ TxData->FragmentTable[0].FragmentBuffer,
+ TxData->FragmentTable[0].FragmentLength
+ );
+
*PktLen = TxData->FragmentTable[0].FragmentLength;
} else {
//
@@ -141,9 +148,8 @@ MnpBuildTxPacket (
// one fragment, copy the data into the packet buffer. Reserve the
// media header space if necessary.
//
- SnpMode = MnpDerviceData->Snp->Mode;
- DstPos = MnpDerviceData->TxBuf;
-
+ SnpMode = MnpDerviceData->Snp->Mode;
+ DstPos = *PktBuf;
*PktLen = 0;
if (TxData->DestinationAddress != NULL) {
//
@@ -167,9 +173,8 @@ MnpBuildTxPacket (
}
//
- // Set the buffer pointer and the buffer length.
+ // Set the buffer length.
//
- *PktBuf = MnpDerviceData->TxBuf;
*PktLen += TxData->DataLength + TxData->HeaderLength;
}
}
@@ -235,10 +240,15 @@ MnpSyncSendPacket (
goto SIGNAL_TOKEN;
}
- //
- // Insert VLAN tag
- //
- MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+
+ if (MnpServiceData->VlanId != 0) {
+ //
+ // Insert VLAN tag
+ //
+ MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+ } else {
+ ProtocolType = TxData->ProtocolType;
+ }
for (;;) {
//
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
index 850ed5162..aa7da980d 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
@@ -1,7 +1,7 @@
/** @file
VLAN Config Protocol implementation and VLAN packet process routine.
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 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
@@ -171,7 +171,7 @@ MnpRemoveVlanTag (
/**
- Build the packet to transmit from the TxData passed in.
+ Build the vlan packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
@@ -197,11 +197,6 @@ MnpInsertVlanTag (
MNP_DEVICE_DATA *MnpDeviceData;
EFI_SIMPLE_NETWORK_MODE *SnpMode;
- if (MnpServiceData->VlanId == 0) {
- *ProtocolType = TxData->ProtocolType;
- return ;
- }
-
MnpDeviceData = MnpServiceData->MnpDeviceData;
SnpMode = MnpDeviceData->Snp->Mode;
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
index 70b6cec26..d8eac8d07 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
@@ -1,7 +1,7 @@
/** @file
Header file to be included by MnpVlan.c.
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 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
@@ -59,7 +59,7 @@ MnpRemoveVlanTag (
);
/**
- Build the packet to transmit from the TxData passed in.
+ Build the vlan packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
index dd0af8d7b..c9043958b 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
@@ -1,7 +1,7 @@
/** @file
UEFI Component Name(2) protocol implementation for Tcp4Dxe driver.
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -259,7 +259,7 @@ UpdateName (
Status = Tcp4->GetModeData (Tcp4, NULL, &Tcp4ConfigData, NULL, NULL, NULL);
if (!EFI_ERROR (Status)) {
UnicodeSPrint (HandleName, sizeof (HandleName),
- L"TCPv4 (SrcPort=%d, DestPort=&d, ActiveFlag=%s)",
+ L"TCPv4 (SrcPort=%d, DestPort=%d, ActiveFlag=%s)",
Tcp4ConfigData.AccessPoint.StationPort,
Tcp4ConfigData.AccessPoint.RemotePort,
(Tcp4ConfigData.AccessPoint.ActiveFlag ? L"TRUE" : L"FALSE")
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index 8be753151..e016cc0f5 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -2,7 +2,7 @@
Support for PxeBc dhcp functions.
Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, 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
@@ -147,13 +147,43 @@ PxeBcParseCachedDhcpPacket (
//
// Parse interested dhcp options and store their pointers in CachedPacket->Dhcp4Option.
+ // First, try to parse DHCPv4 options from the DHCP optional parameters field.
//
for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
Options[Index] = PxeBcParseExtendOptions (
- Offer->Dhcp4.Option,
- GET_OPTION_BUFFER_LEN (Offer),
- mInterestedDhcp4Tags[Index]
- );
+ Offer->Dhcp4.Option,
+ GET_OPTION_BUFFER_LEN (Offer),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ //
+ // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
+ // If yes, try to parse options from the BootFileName field, then ServerName field.
+ //
+ Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
+ if (Option != NULL) {
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseExtendOptions (
+ (UINT8 *) Offer->Dhcp4.Header.BootFileName,
+ sizeof (Offer->Dhcp4.Header.BootFileName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_SERVER_NAME) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseExtendOptions (
+ (UINT8 *) Offer->Dhcp4.Header.ServerName,
+ sizeof (Offer->Dhcp4.Header.ServerName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
}
//
@@ -177,31 +207,23 @@ PxeBcParseCachedDhcpPacket (
}
}
+
//
- // Check whether bootfilename/serverhostname overloaded (See details in dhcp spec).
- // If overloaded, parse this buffer as nested dhcp options, or just parse bootfilename/
- // serverhostname option.
+ // Parse PXE boot file name:
+ // According to PXE spec, boot file name should be read from DHCP option 67 (bootfile name) if present.
+ // Otherwise, read from boot file field in DHCP header.
//
- Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
- if ((Option != NULL) && ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0)) {
-
- Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = PxeBcParseExtendOptions (
- (UINT8 *) Offer->Dhcp4.Header.BootFileName,
- sizeof (Offer->Dhcp4.Header.BootFileName),
- PXEBC_DHCP4_TAG_BOOTFILE
- );
+ if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
//
// RFC 2132, Section 9.5 does not strictly state Bootfile name (option 67) is null
// terminated string. So force to append null terminated character at the end of string.
//
- if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
- Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
- Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
- *Ptr8 = '\0';
+ Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
+ Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
+ if (*(Ptr8 - 1) != '\0') {
+ *Ptr8 = '\0';
}
-
- } else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) &&
- (Offer->Dhcp4.Header.BootFileName[0] != 0)) {
+ } else if (Offer->Dhcp4.Header.BootFileName[0] != 0) {
//
// If the bootfile is not present and bootfilename is present in dhcp packet, just parse it.
// And do not count dhcp option header, or else will destroy the serverhostname.
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
index 8a3e8cd50..4828af2b9 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -231,7 +231,7 @@ DxeGetPcdInfoGetSku (
VOID
)
{
- return mPcdDatabase.PeiDb->SystemSkuId;
+ return mPcdDatabase.DxeDb->SystemSkuId;
}
/**
@@ -261,7 +261,7 @@ DxePcdSetSku (
IN UINTN SkuId
)
{
- mPcdDatabase.PeiDb->SystemSkuId = (SKU_ID) SkuId;
+ mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId;
return;
}
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index b082f0a6d..a9e1ca49a 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -50,6 +50,7 @@ GetLocalTokenNumber (
IN UINTN TokenNumber
)
{
+ UINTN TmpTokenNumber;
UINT32 *LocalTokenNumberTable;
UINT32 LocalTokenNumber;
UINTN Size;
@@ -62,6 +63,11 @@ GetLocalTokenNumber (
//
TokenNumber--;
+ //
+ // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
+ //
+ TmpTokenNumber = TokenNumber;
+
LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
(UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
@@ -72,7 +78,7 @@ GetLocalTokenNumber (
if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == PCD_TYPE_SKU_ENABLED) {
if (Size == 0) {
- GetPtrTypeSize (TokenNumber, &MaxSize);
+ GetPtrTypeSize (TmpTokenNumber, &MaxSize);
} else {
MaxSize = Size;
}
@@ -768,6 +774,18 @@ BuildPcdDxeDataBase (
UINT32 PcdDxeDbLen;
VOID *PcdDxeDb;
+ //
+ // Assign PCD Entries with default value to PCD DATABASE
+ //
+ mPcdDatabase.DxeDb = LocateExPcdBinary ();
+ ASSERT(mPcdDatabase.DxeDb != NULL);
+ PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
+ PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
+ ASSERT (PcdDxeDb != NULL);
+ CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
+ FreePool (mPcdDatabase.DxeDb);
+ mPcdDatabase.DxeDb = PcdDxeDb;
+
GuidHob = GetFirstGuidHob (&gPcdDataBaseHobGuid);
if (GuidHob != NULL) {
@@ -783,21 +801,16 @@ BuildPcdDxeDataBase (
// Assign PCD Entries refereneced in PEI phase to PCD DATABASE
//
mPcdDatabase.PeiDb = PeiDatabase;
+ //
+ // Inherit the SystemSkuId from PEI phase.
+ //
+ mPcdDatabase.DxeDb->SystemSkuId = mPcdDatabase.PeiDb->SystemSkuId;
+ } else {
+ mPcdDatabase.PeiDb = AllocateZeroPool (sizeof (PEI_PCD_DATABASE));
+ ASSERT(mPcdDatabase.PeiDb != NULL);
}
//
- // Assign PCD Entries with default value to PCD DATABASE
- //
- mPcdDatabase.DxeDb = LocateExPcdBinary ();
- ASSERT(mPcdDatabase.DxeDb != NULL);
- PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
- PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
- ASSERT (PcdDxeDb != NULL);
- CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
- FreePool (mPcdDatabase.DxeDb);
- mPcdDatabase.DxeDb = PcdDxeDb;
-
- //
// Initialized the external PCD database local variables
//
mPeiLocalTokenCount = mPcdDatabase.PeiDb->LocalTokenCount;
@@ -939,7 +952,7 @@ GetSkuEnabledTokenNumber (
//
FoundSku = FALSE;
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (mPcdDatabase.PeiDb->SystemSkuId == SkuIdTable[Index + 1]) {
+ if (mPcdDatabase.DxeDb->SystemSkuId == SkuIdTable[Index + 1]) {
FoundSku = TRUE;
break;
}
@@ -1698,7 +1711,7 @@ GetPtrTypeSize (
//
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
+ if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
return SizeTable[SizeTableIdx + 1 + Index];
}
}
@@ -1788,7 +1801,7 @@ SetPtrTypeSize (
//
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
+ if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
SizeTable[SizeTableIdx + 1 + Index] = (SIZE_INFO) *CurrentSize;
return TRUE;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index ce2ba6fab..41f89ea7f 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
UINT16 mStatementIndex;
UINT16 mExpressionOpCodeIndex;
EFI_QUESTION_ID mUsedQuestionId;
-BOOLEAN mInScopeSubtitle;
extern LIST_ENTRY gBrowserStorageList;
/**
Initialize Statement header members.
@@ -79,8 +78,6 @@ CreateStatement (
CopyMem (Statement->Expression->Expression, GetConditionalExpressionList(ExpressStatement), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
}
- Statement->InSubtitle = mInScopeSubtitle;
-
//
// Insert this Statement into current Form
//
@@ -379,12 +376,18 @@ FindStorageInList (
Link = GetFirstNode (&gBrowserStorageList);
while (!IsNull (&gBrowserStorageList, Link)) {
BrowserStorage = BROWSER_STORAGE_FROM_LINK (Link);
+ Link = GetNextNode (&gBrowserStorageList, Link);
if ((BrowserStorage->Type == StorageType) && CompareGuid (&BrowserStorage->Guid, StorageGuid)) {
- if (StorageType == EFI_HII_VARSTORE_NAME_VALUE && BrowserStorage->HiiHandle == HiiHandle) {
- return BrowserStorage;
+ if (StorageType == EFI_HII_VARSTORE_NAME_VALUE) {
+ if (BrowserStorage->HiiHandle == HiiHandle) {
+ return BrowserStorage;
+ }
+
+ continue;
}
+ ASSERT (StorageName != NULL);
if (StrCmp (BrowserStorage->Name, StorageName) == 0) {
if (StorageType == EFI_HII_VARSTORE_EFI_VARIABLE || StorageType == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
return BrowserStorage;
@@ -393,11 +396,6 @@ FindStorageInList (
}
}
}
-
- //
- // Get Next Storage.
- //
- Link = GetNextNode (&gBrowserStorageList, Link);
}
return NULL;
@@ -1038,6 +1036,39 @@ IsExpressionOpCode (
}
}
+/**
+ Tell whether this Operand is an Statement OpCode.
+
+ @param Operand Operand of an IFR OpCode.
+
+ @retval TRUE This is an Statement OpCode.
+ @retval FALSE Not an Statement OpCode.
+
+**/
+BOOLEAN
+IsStatementOpCode (
+ IN UINT8 Operand
+ )
+{
+ if ((Operand == EFI_IFR_SUBTITLE_OP) ||
+ (Operand == EFI_IFR_TEXT_OP) ||
+ (Operand == EFI_IFR_RESET_BUTTON_OP) ||
+ (Operand == EFI_IFR_REF_OP) ||
+ (Operand == EFI_IFR_ACTION_OP) ||
+ (Operand == EFI_IFR_NUMERIC_OP) ||
+ (Operand == EFI_IFR_ORDERED_LIST_OP) ||
+ (Operand == EFI_IFR_CHECKBOX_OP) ||
+ (Operand == EFI_IFR_STRING_OP) ||
+ (Operand == EFI_IFR_PASSWORD_OP) ||
+ (Operand == EFI_IFR_DATE_OP) ||
+ (Operand == EFI_IFR_TIME_OP) ||
+ (Operand == EFI_IFR_GUID_OP) ||
+ (Operand == EFI_IFR_ONE_OF_OP)) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
/**
Calculate number of Statemens(Questions) and Expression OpCodes.
@@ -1099,6 +1130,7 @@ ParseOpCodes (
EFI_STATUS Status;
FORM_BROWSER_FORM *CurrentForm;
FORM_BROWSER_STATEMENT *CurrentStatement;
+ FORM_BROWSER_STATEMENT *ParentStatement;
EXPRESSION_OPCODE *ExpressionOpCode;
FORM_EXPRESSION *CurrentExpression;
UINT8 Operand;
@@ -1131,7 +1163,6 @@ ParseOpCodes (
BOOLEAN InScopeDisable;
INTN ConditionalExprCount;
- mInScopeSubtitle = FALSE;
SuppressForQuestion = FALSE;
SuppressForOption = FALSE;
InScopeDisable = FALSE;
@@ -1179,6 +1210,7 @@ ParseOpCodes (
CurrentForm = NULL;
CurrentStatement = NULL;
+ ParentStatement = NULL;
ResetScopeStack ();
@@ -1269,8 +1301,8 @@ ParseOpCodes (
break;
case EFI_IFR_THIS_OP:
- ASSERT (CurrentStatement != NULL);
- ExpressionOpCode->QuestionId = CurrentStatement->QuestionId;
+ ASSERT (ParentStatement != NULL);
+ ExpressionOpCode->QuestionId = ParentStatement->QuestionId;
break;
case EFI_IFR_SECURITY_OP:
@@ -1684,9 +1716,6 @@ ParseOpCodes (
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
- if (Scope != 0) {
- mInScopeSubtitle = TRUE;
- }
break;
case EFI_IFR_TEXT_OP:
@@ -1926,7 +1955,7 @@ ParseOpCodes (
//
// Insert to Default Value list of current Question
//
- InsertTailList (&CurrentStatement->DefaultListHead, &CurrentDefault->Link);
+ InsertTailList (&ParentStatement->DefaultListHead, &CurrentDefault->Link);
if (Scope != 0) {
InScopeDefault = TRUE;
@@ -1965,16 +1994,15 @@ ParseOpCodes (
CopyMem (CurrentOption->SuppressExpression->Expression, GetConditionalExpressionList(ExpressOption), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
}
+ ASSERT (ParentStatement != NULL);
//
// Insert to Option list of current Question
//
- InsertTailList (&CurrentStatement->OptionListHead, &CurrentOption->Link);
-
+ InsertTailList (&ParentStatement->OptionListHead, &CurrentOption->Link);
//
// Now we know the Storage width of nested Ordered List
//
- ASSERT (CurrentStatement != NULL);
- if ((CurrentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (CurrentStatement->BufferValue == NULL)) {
+ if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (ParentStatement->BufferValue == NULL)) {
Width = 1;
switch (CurrentOption->Value.Type) {
case EFI_IFR_TYPE_NUM_SIZE_8:
@@ -2000,15 +2028,15 @@ ParseOpCodes (
break;
}
- CurrentStatement->StorageWidth = (UINT16) (CurrentStatement->MaxContainers * Width);
- CurrentStatement->BufferValue = AllocateZeroPool (CurrentStatement->StorageWidth);
- CurrentStatement->ValueType = CurrentOption->Value.Type;
- if (CurrentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
- CurrentStatement->HiiValue.Buffer = CurrentStatement->BufferValue;
- CurrentStatement->HiiValue.BufferLen = CurrentStatement->StorageWidth;
+ ParentStatement->StorageWidth = (UINT16) (ParentStatement->MaxContainers * Width);
+ ParentStatement->BufferValue = AllocateZeroPool (ParentStatement->StorageWidth);
+ ParentStatement->ValueType = CurrentOption->Value.Type;
+ if (ParentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
+ ParentStatement->HiiValue.Buffer = ParentStatement->BufferValue;
+ ParentStatement->HiiValue.BufferLen = ParentStatement->StorageWidth;
}
- InitializeRequestElement (FormSet, CurrentStatement, CurrentForm);
+ InitializeRequestElement (FormSet, ParentStatement, CurrentForm);
}
break;
@@ -2025,10 +2053,10 @@ ParseOpCodes (
if (Operand == EFI_IFR_NO_SUBMIT_IF_OP) {
CurrentExpression->Type = EFI_HII_EXPRESSION_NO_SUBMIT_IF;
- InsertTailList (&CurrentStatement->NoSubmitListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->NoSubmitListHead, &CurrentExpression->Link);
} else {
CurrentExpression->Type = EFI_HII_EXPRESSION_INCONSISTENT_IF;
- InsertTailList (&CurrentStatement->InconsistentListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->InconsistentListHead, &CurrentExpression->Link);
}
//
@@ -2048,7 +2076,7 @@ ParseOpCodes (
CopyMem (&CurrentExpression->Error, &((EFI_IFR_WARNING_IF *) OpCodeData)->Warning, sizeof (EFI_STRING_ID));
CurrentExpression->TimeOut = ((EFI_IFR_WARNING_IF *) OpCodeData)->TimeOut;
CurrentExpression->Type = EFI_HII_EXPRESSION_WARNING_IF;
- InsertTailList (&CurrentStatement->WarningListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->WarningListHead, &CurrentExpression->Link);
//
// Take a look at next OpCode to see whether current expression consists
@@ -2159,8 +2187,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->ValueExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->ValueExpression = CurrentExpression;
}
//
@@ -2198,8 +2226,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->ReadExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->ReadExpression = CurrentExpression;
//
// Take a look at next OpCode to see whether current expression consists
@@ -2220,8 +2248,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->WriteExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->WriteExpression = CurrentExpression;
//
// Take a look at next OpCode to see whether current expression consists
@@ -2263,8 +2291,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- ImageId = &CurrentStatement->ImageId;
+ ASSERT (ParentStatement != NULL);
+ ImageId = &ParentStatement->ImageId;
break;
}
@@ -2276,16 +2304,16 @@ ParseOpCodes (
// Refresh
//
case EFI_IFR_REFRESH_OP:
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
break;
//
// Refresh guid.
//
case EFI_IFR_REFRESH_ID_OP:
- ASSERT (CurrentStatement != NULL);
- CopyMem (&CurrentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ ASSERT (ParentStatement != NULL);
+ CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
break;
//
@@ -2313,8 +2341,8 @@ ParseOpCodes (
break;
default:
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->Locked = TRUE;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->Locked = TRUE;
}
break;
@@ -2334,6 +2362,13 @@ ParseOpCodes (
ResetScopeStack ();
return Status;
}
+
+ //
+ // Parent statement end tag found, update ParentStatement info.
+ //
+ if (IsStatementOpCode(ScopeOpCode) && (ParentStatement != NULL) && (ParentStatement->Operand == ScopeOpCode)) {
+ ParentStatement = ParentStatement->ParentStatement;
+ }
switch (ScopeOpCode) {
case EFI_IFR_FORM_SET_OP:
@@ -2360,10 +2395,6 @@ ParseOpCodes (
CurrentOption = NULL;
break;
- case EFI_IFR_SUBTITLE_OP:
- mInScopeSubtitle = FALSE;
- break;
-
case EFI_IFR_NO_SUBMIT_IF_OP:
case EFI_IFR_INCONSISTENT_IF_OP:
case EFI_IFR_WARNING_IF_OP:
@@ -2455,6 +2486,17 @@ ParseOpCodes (
default:
break;
}
+
+ if (IsStatementOpCode(Operand)) {
+ CurrentStatement->ParentStatement = ParentStatement;
+ if (Scope != 0) {
+ //
+ // Scope != 0, other statements or options may nest in this statement.
+ // Update the ParentStatement info.
+ //
+ ParentStatement = CurrentStatement;
+ }
+ }
}
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index fb3ff7b26..f8b1d5067 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -387,18 +387,17 @@ QuestionCheck (
@param DisplayStatement Pointer to the display Statement data strucure.
@param Statement The statement need to check.
- @param HostDisplayStatement Pointer to the display Statement data strucure which is an host statement.
**/
VOID
InitializeDisplayStatement (
IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement,
- IN FORM_BROWSER_STATEMENT *Statement,
- IN FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement
+ IN FORM_BROWSER_STATEMENT *Statement
)
{
LIST_ENTRY *Link;
QUESTION_OPTION *Option;
DISPLAY_QUESTION_OPTION *DisplayOption;
+ FORM_DISPLAY_ENGINE_STATEMENT *ParentStatement;
DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
@@ -502,8 +501,10 @@ InitializeDisplayStatement (
// If this statement is nest in the subtitle, insert to the host statement.
// else insert to the form it belongs to.
//
- if (Statement->InSubtitle) {
- InsertTailList(&HostDisplayStatement->NestStatementList, &DisplayStatement->DisplayLink);
+ if (Statement->ParentStatement != NULL) {
+ ParentStatement = GetDisplayStatement(Statement->ParentStatement->OpCode);
+ ASSERT (ParentStatement != NULL);
+ InsertTailList(&ParentStatement->NestStatementList, &DisplayStatement->DisplayLink);
} else {
InsertTailList(&gDisplayFormData.StatementListHead, &DisplayStatement->DisplayLink);
}
@@ -625,14 +626,12 @@ AddStatementToDisplayForm (
LIST_ENTRY *Link;
FORM_BROWSER_STATEMENT *Statement;
FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
- FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement;
UINT8 MinRefreshInterval;
EFI_EVENT RefreshIntervalEvent;
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
BOOLEAN FormEditable;
UINT32 ExtraAttribute;
- HostDisplayStatement = NULL;
MinRefreshInterval = 0;
FormEditable = FALSE;
@@ -686,21 +685,13 @@ AddStatementToDisplayForm (
//
// Initialize this statement and add it to the display form.
//
- InitializeDisplayStatement(DisplayStatement, Statement, HostDisplayStatement);
+ InitializeDisplayStatement(DisplayStatement, Statement);
//
// Set the extra attribute.
//
DisplayStatement->Attribute |= ExtraAttribute;
- //
- // Save the Host statement info.
- // Host statement may has nest statement follow it.
- //
- if (!Statement->InSubtitle) {
- HostDisplayStatement = DisplayStatement;
- }
-
if (Statement->Storage != NULL) {
FormEditable = TRUE;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 66238e055..11c9589ce 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -4085,6 +4085,10 @@ LoadStorage (
EFI_STRING Progress;
EFI_STRING Result;
CHAR16 *StrPtr;
+ EFI_STRING ConfigRequest;
+ UINTN StrLen;
+
+ ConfigRequest = NULL;
switch (Storage->BrowserStorage->Type) {
case EFI_HII_VARSTORE_EFI_VARIABLE:
@@ -4095,6 +4099,21 @@ LoadStorage (
ConfigRequestAdjust(Storage);
return;
}
+
+ //
+ // Create the config request string to get all fields for this storage.
+ // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
+ // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
+ //
+ StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
+ ConfigRequest = AllocateZeroPool (StrLen);
+ ASSERT (ConfigRequest != NULL);
+ UnicodeSPrint (
+ ConfigRequest,
+ StrLen,
+ L"%s&OFFSET=0&WIDTH=%04x",
+ Storage->BrowserStorage->ConfigHdr,
+ Storage->BrowserStorage->Size);
break;
case EFI_HII_VARSTORE_BUFFER:
@@ -4106,6 +4125,7 @@ LoadStorage (
return;
}
Storage->BrowserStorage->Initialized = TRUE;
+ ConfigRequest = Storage->ConfigRequest;
break;
default:
@@ -4117,7 +4137,7 @@ LoadStorage (
//
Status = mHiiConfigRouting->ExtractConfig (
mHiiConfigRouting,
- Storage->ConfigRequest,
+ ConfigRequest,
&Progress,
&Result
);
@@ -4146,6 +4166,12 @@ LoadStorage (
// Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer.
//
SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
+
+ if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+ if (ConfigRequest != NULL) {
+ FreePool (ConfigRequest);
+ }
+ }
}
/**
@@ -4876,21 +4902,27 @@ IsBrowserDataModified (
LIST_ENTRY *Link;
FORM_BROWSER_FORMSET *FormSet;
- if (gCurrentSelection == NULL) {
- return FALSE;
- }
-
switch (gBrowserSettingScope) {
case FormLevel:
+ if (gCurrentSelection == NULL) {
+ return FALSE;
+ }
return IsNvUpdateRequiredForForm (gCurrentSelection->Form);
case FormSetLevel:
+ if (gCurrentSelection == NULL) {
+ return FALSE;
+ }
return IsNvUpdateRequiredForFormSet (gCurrentSelection->FormSet);
case SystemLevel:
Link = GetFirstNode (&gBrowserFormSetList);
while (!IsNull (&gBrowserFormSetList, Link)) {
FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
+ if (!ValidateFormSet(FormSet)) {
+ continue;
+ }
+
if (IsNvUpdateRequiredForFormSet (FormSet)) {
return TRUE;
}
@@ -4920,19 +4952,27 @@ ExecuteAction (
IN UINT16 DefaultId
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ FORM_BROWSER_FORMSET *FormSet;
+ FORM_BROWSER_FORM *Form;
- if (gCurrentSelection == NULL) {
+ if (gBrowserSettingScope < SystemLevel && gCurrentSelection == NULL) {
return EFI_NOT_READY;
}
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ FormSet = NULL;
+ Form = NULL;
+ if (gBrowserSettingScope < SystemLevel) {
+ FormSet = gCurrentSelection->FormSet;
+ Form = gCurrentSelection->Form;
+ }
//
// Executet the discard action.
//
if ((Action & BROWSER_ACTION_DISCARD) != 0) {
- Status = DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ Status = DiscardForm (FormSet, Form, gBrowserSettingScope);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4942,7 +4982,7 @@ ExecuteAction (
// Executet the difault action.
//
if ((Action & BROWSER_ACTION_DEFAULT) != 0) {
- Status = ExtractDefault (gCurrentSelection->FormSet, gCurrentSelection->Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
+ Status = ExtractDefault (FormSet, Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4952,7 +4992,7 @@ ExecuteAction (
// Executet the submit action.
//
if ((Action & BROWSER_ACTION_SUBMIT) != 0) {
- Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ Status = SubmitForm (FormSet, Form, gBrowserSettingScope);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4969,7 +5009,7 @@ ExecuteAction (
// Executet the exit action.
//
if ((Action & BROWSER_ACTION_EXIT) != 0) {
- DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ DiscardForm (FormSet, Form, gBrowserSettingScope);
if (gBrowserSettingScope == SystemLevel) {
if (ExitHandlerFunction != NULL) {
ExitHandlerFunction ();
@@ -4989,6 +5029,7 @@ ExecuteAction (
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
UINT32
@@ -5001,6 +5042,7 @@ SaveReminder (
FORM_BROWSER_FORMSET *FormSet;
BOOLEAN IsDataChanged;
UINT32 DataSavedAction;
+ UINT32 ConfirmRet;
DataSavedAction = BROWSER_NO_CHANGES;
IsDataChanged = FALSE;
@@ -5028,13 +5070,18 @@ SaveReminder (
// If data is changed, prompt user to save or discard it.
//
do {
- DataSavedAction = (UINT32) mFormDisplay->ConfirmDataChange();
+ ConfirmRet = (UINT32) mFormDisplay->ConfirmDataChange();
- if (DataSavedAction == BROWSER_SAVE_CHANGES) {
+ if (ConfirmRet == BROWSER_ACTION_SUBMIT) {
SubmitForm (NULL, NULL, SystemLevel);
+ DataSavedAction = BROWSER_SAVE_CHANGES;
break;
- } else if (DataSavedAction == BROWSER_DISCARD_CHANGES) {
+ } else if (ConfirmRet == BROWSER_ACTION_DISCARD) {
DiscardForm (NULL, NULL, SystemLevel);
+ DataSavedAction = BROWSER_DISCARD_CHANGES;
+ break;
+ } else if (ConfirmRet == BROWSER_ACTION_NONE) {
+ DataSavedAction = BROWSER_KEEP_CURRENT;
break;
}
} while (1);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 9cb4653c8..87305bad6 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -288,9 +288,11 @@ typedef enum {
ExpressOption
} EXPRESS_LEVEL;
+typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;
+
#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
-typedef struct {
+struct _FORM_BROWSER_STATEMENT{
UINTN Signature;
LIST_ENTRY Link;
@@ -352,7 +354,8 @@ typedef struct {
EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE
UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
- BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE
+
+ FORM_BROWSER_STATEMENT *ParentStatement;
LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)
@@ -361,7 +364,7 @@ typedef struct {
FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.
FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
-} FORM_BROWSER_STATEMENT;
+};
#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
@@ -1324,6 +1327,7 @@ ExecuteAction (
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
UINT32
diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
index 157ea8554..329bdbfc4 100644
--- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
+++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
@@ -981,7 +981,7 @@ SmbiosCreateTable (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength),
&PhysicalAddress
);
@@ -1093,7 +1093,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ 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,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
@@ -1127,7 +1127,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
1,
&PhysicalAddress
);