Revision: 18599
          http://sourceforge.net/p/edk2/code/18599
Author:   lzeng14
Date:     2015-10-10 02:53:41 +0000 (Sat, 10 Oct 2015)
Log Message:
-----------
MdeModulePkg PiDxeS3BootScriptLib: Use PcdSet64S to instead of PcdSet64

PcdSet## has no error status returned, then the caller has no idea about 
whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in 
ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with 
DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage 
with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD 
set failure is a legal case.
For this case, PcdS3BootScriptTablePrivateDataPtr and 
PcdS3BootScriptTablePrivateSmmDataPtr are expected to be DynamicDefault,
so use PcdSet64S to instead of PcdSet64 and assert when set failure.

Cc: Jiewen Yao <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c

Modified: trunk/edk2/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c       
2015-10-10 01:19:43 UTC (rev 18598)
+++ trunk/edk2/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c       
2015-10-10 02:53:41 UTC (rev 18599)
@@ -454,7 +454,8 @@
     }
     S3TablePtr = (VOID *) (UINTN) Buffer;
 
-    PcdSet64 (PcdS3BootScriptTablePrivateDataPtr, (UINT64) (UINTN)S3TablePtr); 
+    Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, (UINT64) 
(UINTN)S3TablePtr);
+    ASSERT_EFI_ERROR (Status);
     ZeroMem (S3TablePtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA));  
     //
     // Create event to notify the library system enter the SmmLocked phase.
@@ -506,7 +507,8 @@
       return RETURN_OUT_OF_RESOURCES;
     }
 
-    PcdSet64 (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64) 
(UINTN)S3TableSmmPtr);
+    Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, (UINT64) 
(UINTN)S3TableSmmPtr);
+    ASSERT_EFI_ERROR (Status);
     ZeroMem (S3TableSmmPtr, sizeof(SCRIPT_TABLE_PRIVATE_DATA));
 
     //


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to