diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-03-08 09:40:57 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-03-23 13:38:19 +0800 |
commit | 6a9bc80154dd8771bc6f76b9b6c7579753e86e50 (patch) | |
tree | 1e798bfc59ff84e157e518d53c79ec02e74ef355 | |
parent | 28620e603d6179d7fdb95175279468e652c3be71 (diff) | |
download | edk2-platforms-6a9bc80154dd8771bc6f76b9b6c7579753e86e50.tar.xz |
MdeModulePkg RamDiskDxe: Remove unnecessary TPL raise operations
There is no asynchronous operations to the registered RAM disks link list
maintained within RamDiskDxe driver, therefore, the TPL raise and restore
operations when dealing with the link list are unnecessary.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c | 6 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 8 |
2 files changed, 0 insertions, 14 deletions
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c index d4317019a5..9df9b5b965 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c @@ -521,7 +521,6 @@ UpdateMainForm ( CHAR16 *String;
CHAR16 RamDiskStr[128];
EFI_STRING_ID StringId;
- EFI_TPL OldTpl;
//
// Init OpCode Handle
@@ -557,7 +556,6 @@ UpdateMainForm ( EndLabel->Number = MAIN_LABEL_LIST_END;
Index = 0;
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
String = RamDiskStr;
@@ -588,7 +586,6 @@ UpdateMainForm ( Index++;
}
- gBS->RestoreTPL (OldTpl);
HiiUpdateForm (
ConfigPrivate->HiiHandle,
@@ -645,7 +642,6 @@ RamDiskCallback ( EFI_FILE_HANDLE FileHandle;
LIST_ENTRY *Entry;
LIST_ENTRY *NextEntry;
- EFI_TPL OldTpl;
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -747,7 +743,6 @@ RamDiskCallback ( // Remove the selected RAM disks
//
Index = 0;
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
if (Configuration->RamDiskList[Index++] != 0) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
@@ -757,7 +752,6 @@ RamDiskCallback ( );
}
}
- gBS->RestoreTPL (OldTpl);
UpdateMainForm (ConfigPrivate);
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index 6d97994b5c..0c1df9dc73 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -103,7 +103,6 @@ RamDiskRegister ( MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode;
UINTN DevicePathSize;
LIST_ENTRY *Entry;
- EFI_TPL OldTpl;
if ((0 == RamDiskSize) || (NULL == RamDiskType) || (NULL == DevicePath)) {
return EFI_INVALID_PARAMETER;
@@ -163,7 +162,6 @@ RamDiskRegister ( // Check whether the created device path is already present in the handle
// database
//
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty(&RegisteredRamDisks)) {
DevicePathSize = GetDevicePathSize (PrivateData->DevicePath);
@@ -184,7 +182,6 @@ RamDiskRegister ( }
}
}
- gBS->RestoreTPL (OldTpl);
//
// Fill Block IO protocol informations for the RAM disk
@@ -212,10 +209,8 @@ RamDiskRegister ( //
// Insert the newly created one to the registered RAM disk list
//
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
InsertTailList (&RegisteredRamDisks, &PrivateData->ThisInstance);
ListEntryNum++;
- gBS->RestoreTPL (OldTpl);
gBS->ConnectController (PrivateData->Handle, NULL, NULL, TRUE);
@@ -269,7 +264,6 @@ RamDiskUnregister ( EFI_DEVICE_PATH_PROTOCOL *Header;
MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode;
RAM_DISK_PRIVATE_DATA *PrivateData;
- EFI_TPL OldTpl;
if (NULL == DevicePath) {
return EFI_INVALID_PARAMETER;
@@ -302,7 +296,6 @@ RamDiskUnregister ( StartingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->StartingAddr[0]));
EndingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->EndingAddr[0]));
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty(&RegisteredRamDisks)) {
EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
@@ -348,7 +341,6 @@ RamDiskUnregister ( }
}
}
- gBS->RestoreTPL (OldTpl);
if (TRUE == Found) {
return EFI_SUCCESS;
|