]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FmpDevicePkg/FmpDxe/FmpDxe.c
FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required
[mirror_edk2.git] / FmpDevicePkg / FmpDxe / FmpDxe.c
index 94fdf5608529c63254249c446584f29a88b004d5..3544afd3dee744131f2bd3f1b129ff36ba64b4b3 100644 (file)
@@ -898,6 +898,9 @@ SetTheImage (
   UINT32      AllHeaderSize;\r
   UINT32      IncommingFwVersion;\r
   UINT32      LastAttemptStatus;\r
+  EFI_STATUS  GetAttributesStatus;\r
+  UINT64      AttributesSupported;\r
+  UINT64      AttributesSetting;\r
 \r
   Status             = EFI_SUCCESS;\r
   Updateable         = 0;\r
@@ -1110,10 +1113,14 @@ SetTheImage (
 \r
   //\r
   // Set flag so the descriptor is repopulated\r
-  // This only applied to devices that do not require system reboot\r
+  // This is only applied to devices that do not require reset\r
   //\r
-  if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) {\r
-    mDescriptorPopulated = FALSE;\r
+  GetAttributesStatus = FmpDeviceGetAttributes (&AttributesSupported, &AttributesSetting);\r
+  if (!EFI_ERROR (GetAttributesStatus)) {\r
+    if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) ||\r
+        ((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) {\r
+      mDescriptorPopulated = FALSE;\r
+    }\r
   }\r
 \r
 cleanup:\r