audk/FmpDevicePkg/FmpDxe
Star Zeng 9e6c4f1527 FmpDevicePkg FmpDxe: Lock variables in entrypoint instead of callback
Current code locks variables in PcdFmpDeviceLockEventGuid callback by
VariableLock protocol whose interface will be closed at EndOfDxe.
So the PcdFmpDeviceLockEventGuid callback needs be executed before
the EndOfDxe callback in Variable driver.
When PcdFmpDeviceLockEventGuid = gEfiEndOfDxeEventGroupGuid, the
callback's execution sequence depends on the callback's TPL and
registration sequence.
When PcdFmpDeviceLockEventGuid = gEfiEventReadyToBootGuid, the
PcdFmpDeviceLockEventGuid callback will be executed after the
EndOfDxe callback in Variable driver, the locking will fail.

The patch moves the variables locking logic to entrypoint.
The patch also moves the IsLockFmpDeviceAtLockEventGuidRequired ()
checking to entrypoint.

The entrypoint's final return status should be better to depend on
the return status of RegisterFmpInstaller/InstallFmpInstance, but not
gBS->CreateEventEx.
So the patch also moves the RegisterFmpInstaller/InstallFmpInstance
calling to the end of entrypoint.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2018-08-08 19:18:29 +08:00
..
DetectTestKey.c FmpDevicePkg FmpDxe: Use local variable to store test key digest size 2018-08-02 14:46:19 -07:00
FmpDxe.c FmpDevicePkg FmpDxe: Lock variables in entrypoint instead of callback 2018-08-08 19:18:29 +08:00
FmpDxe.inf FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required 2018-08-02 14:46:19 -07:00
FmpDxe.uni FmpDevicePkg: Add FmpDxe module 2018-08-02 14:46:18 -07:00
FmpDxeExtra.uni FmpDevicePkg: Add FmpDxe module 2018-08-02 14:46:18 -07:00
FmpDxeLib.inf FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required 2018-08-02 14:46:19 -07:00
VariableSupport.c FmpDevicePkg: Fix code style issue 2018-08-02 14:46:19 -07:00
VariableSupport.h FmpDevicePkg: Fix code style issue 2018-08-02 14:46:19 -07:00