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
\r
#include <IndustryStandard/ArmStdSmc.h>\r
\r
+STATIC UINT32 mArmPsciMethod;\r
+\r
+RETURN_STATUS\r
+EFIAPI\r
+ArmPsciResetSystemLibConstructor (\r
+ VOID\r
+ )\r
+{\r
+ mArmPsciMethod = PcdGet32 (PcdArmPsciMethod);\r
+ return RETURN_SUCCESS;\r
+}\r
+\r
/**\r
Resets the entire platform.\r
\r
return EFI_UNSUPPORTED;\r
}\r
\r
- switch (PcdGet32 (PcdArmPsciMethod)) {\r
+ switch (mArmPsciMethod) {\r
case 1:\r
ArmCallHvc (&ArmHvcArgs);\r
break;\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = EfiResetSystemLib\r
+ CONSTRUCTOR = ArmPsciResetSystemLibConstructor\r
\r
[Sources]\r
ArmPsciResetSystemLib.c\r