mirror of https://github.com/acidanthera/audk.git
ArmPsciResetSystemLib: read PSCI method in constructor
As this library is used in the implementation of a Runtime Service, make sure to access dynamic PCDs only in the constructor. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16108 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2efbf710e2
commit
021da07b66
|
@ -25,6 +25,18 @@
|
|||
|
||||
#include <IndustryStandard/ArmStdSmc.h>
|
||||
|
||||
STATIC UINT32 mArmPsciMethod;
|
||||
|
||||
RETURN_STATUS
|
||||
EFIAPI
|
||||
ArmPsciResetSystemLibConstructor (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
mArmPsciMethod = PcdGet32 (PcdArmPsciMethod);
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Resets the entire platform.
|
||||
|
||||
|
@ -69,7 +81,7 @@ LibResetSystem (
|
|||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
switch (PcdGet32 (PcdArmPsciMethod)) {
|
||||
switch (mArmPsciMethod) {
|
||||
case 1:
|
||||
ArmCallHvc (&ArmHvcArgs);
|
||||
break;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = EfiResetSystemLib
|
||||
CONSTRUCTOR = ArmPsciResetSystemLibConstructor
|
||||
|
||||
[Sources]
|
||||
ArmPsciResetSystemLib.c
|
||||
|
|
Loading…
Reference in New Issue