[edk2-devel] [PATCH 1/2] Platform/SbsaQemu: read platform version
Rebecca Cran
rebecca at bsdio.com
Mon May 15 13:12:01 UTC 2023
On 5/15/23 04:24, Marcin Juszkiewicz wrote:
> + Result = ArmCallSmc0 (SIP_SVC_VERSION, &Arg0, &Arg1, NULL);
> + if (Result == SMC_ARCH_CALL_SUCCESS)
> + {
> + Result = PcdSet32S (PcdPlatformVersionMajor, Arg0);
> + ASSERT_EFI_ERROR (Result);
> + Result = PcdSet32S (PcdPlatformVersionMinor, Arg1);
> + ASSERT_EFI_ERROR (Result);
> + }
> +
> + Arg0 = PcdGet32 (PcdPlatformVersionMajor);
> + Arg1 = PcdGet32 (PcdPlatformVersionMinor);
I didn't notice this before, but PcdSet32S returns a RETURN_STATUS, not
UINTN so Result should be type RETURN_STATUS (and probably a different
variable used for the result of ArmCallSmc0).
Also, you should use ASSERT_RETURN_ERROR not ASSERT_EFI_ERROR (I checked
ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c
to see how error handling is done there).
--
Rebecca Cran
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104869): https://edk2.groups.io/g/devel/message/104869
Mute This Topic: https://groups.io/mt/98900379/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list