From 6a9bc80154dd8771bc6f76b9b6c7579753e86e50 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Tue, 8 Mar 2016 09:40:57 +0800 Subject: 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 Reviewed-by: Feng Tian --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c | 6 ------ MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 8 -------- 2 files changed, 14 deletions(-) (limited to 'MdeModulePkg/Universal/Disk') 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; -- cgit v1.2.3