diff options
author | Rebecca Cran <rebecca@nuviainc.com> | 2021-12-13 11:30:56 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-14 11:30:26 +0000 |
commit | c039fa7ff09729de07bc7ebcdd4878340bfaf252 (patch) | |
tree | 1bc0b9da87f0f4f4108f3a9ee367a5a8acb31548 /ArmPkg/Universal | |
parent | 4d303524451d87d411c972736015138a8a4f03f6 (diff) | |
download | edk2-c039fa7ff09729de07bc7ebcdd4878340bfaf252.tar.gz |
ArmPkg: Update SMC calls to use the new ArmCallSmc0/1/2/3 functions
New SMC helper functions have been added to reduce the amount of
template code. Update ArmSmcPsciResetSystemLib and
Smbios/ProcessorSubClassDxe to use them.
Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmPkg/Universal')
-rw-r--r-- | ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c index 7a8c3ca567..e0010a40e4 100644 --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c @@ -88,22 +88,18 @@ HasSmcArm64SocId ( VOID
)
{
- ARM_SMC_ARGS Args;
- INT32 SmcCallStatus;
- BOOLEAN Arm64SocIdSupported;
+ INT32 SmcCallStatus;
+ BOOLEAN Arm64SocIdSupported;
+ UINTN SmcParam;
Arm64SocIdSupported = FALSE;
- Args.Arg0 = SMCCC_VERSION;
- ArmCallSmc (&Args);
- SmcCallStatus = (INT32)Args.Arg0;
+ SmcCallStatus = ArmCallSmc0 (SMCCC_VERSION, NULL, NULL, NULL);
if ((SmcCallStatus < 0) || ((SmcCallStatus >> 16) >= 1)) {
- Args.Arg0 = SMCCC_ARCH_FEATURES;
- Args.Arg1 = SMCCC_ARCH_SOC_ID;
- ArmCallSmc (&Args);
-
- if (Args.Arg0 >= 0) {
+ SmcParam = SMCCC_ARCH_SOC_ID;
+ SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_FEATURES, &SmcParam, NULL, NULL);
+ if (SmcCallStatus >= 0) {
Arm64SocIdSupported = TRUE;
}
}
@@ -125,30 +121,26 @@ SmbiosGetSmcArm64SocId ( OUT INT32 *SocRevision
)
{
- ARM_SMC_ARGS Args;
- INT32 SmcCallStatus;
- EFI_STATUS Status;
+ INT32 SmcCallStatus;
+ EFI_STATUS Status;
+ UINTN SmcParam;
Status = EFI_SUCCESS;
- Args.Arg0 = SMCCC_ARCH_SOC_ID;
- Args.Arg1 = 0;
- ArmCallSmc (&Args);
- SmcCallStatus = (INT32)Args.Arg0;
+ SmcParam = 0;
+ SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
if (SmcCallStatus >= 0) {
- *Jep106Code = (INT32)Args.Arg0;
+ *Jep106Code = (INT32)SmcParam;
} else {
Status = EFI_UNSUPPORTED;
}
- Args.Arg0 = SMCCC_ARCH_SOC_ID;
- Args.Arg1 = 1;
- ArmCallSmc (&Args);
- SmcCallStatus = (INT32)Args.Arg0;
+ SmcParam = 1;
+ SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
if (SmcCallStatus >= 0) {
- *SocRevision = (INT32)Args.Arg0;
+ *SocRevision = (INT32)SmcParam;
} else {
Status = EFI_UNSUPPORTED;
}
|