On 2016/6/3 16:22, Laszlo Ersek wrote:
On 06/03/16 04:09, Star Zeng wrote:
PiDxeS3BootScriptLib has a constructor S3BootScriptLibInitialize() that
registers ready-to-lock callback S3BootScriptSmmEventCallBack() and several
more. The library is linked to SMM modules. If the module entry-point
function returns error (because of lack of resources, unsupported,
whatever), the module will be unloaded and the notify callback pointers
will point to undefined memory. On ready-to-lock exception occurs when
calling S3BootScriptSmmEventCallBack(), and probably all the other
callbacks registered by the constructor would also cause exception.
This patch is to implement library Destructor to free the resources
allocated by S3BootScriptLibInitialize() and unregister callbacks.
Cc: Jiewen Yao <jienwen....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.z...@intel.com>
---
.../Library/PiDxeS3BootScriptLib/BootScriptSave.c | 138 +++++++++++++++++----
.../PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf | 3 +-
2 files changed, 115 insertions(+), 26 deletions(-)
Do you agree that after this patch, a third patch should be added to the
series, to revert git commit 058196bbb345?
With a destructor implemented, the shortcut from 058196bbb345 should be
unnecessary.
If you post a v2, I'll seek to test it in OVMF (with S3 enabled and S3
disabled).
I agree to revert git commit 058196bbb345 in V2 patch series.
Thanks for the comments.
Star
Thanks!
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel