]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmSvcLib: Return x4-x7 in output parameters
authorAchin Gupta <achin.gupta@arm.com>
Fri, 19 Feb 2021 06:35:55 +0000 (12:05 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 23 Feb 2021 15:40:37 +0000 (15:40 +0000)
The Arm SMC calling convention standard v1.2 allows 8 input and output
parameter registers. The FF-A specification relies on this
communication. This patch extends the number of output registers
returned by ArmCallSvc() to match this convention.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
ArmPkg/Include/Library/ArmSvcLib.h
ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S

index a94ead1965be3c99b434830ebc32c63cc9b1f14d..a4414270f3b93e0fce416c5f3faef8d1d29a6029 100644 (file)
@@ -27,10 +27,16 @@ typedef struct {
 /**\r
   Trigger an SVC call\r
 \r
-  SVC calls can take up to 7 arguments and return up to 4 return values.\r
-  Therefore, the 4 first fields in the ARM_SVC_ARGS structure are used\r
+  SVC calls can take up to 8 arguments and return up to 8 return values.\r
+  Therefore, the 8 first fields in the ARM_SVC_ARGS structure are used\r
   for both input and output values.\r
 \r
+  @param[in, out]    Args Arguments to be passed as part of the SVC call\r
+                     The return values of the SVC call are also placed\r
+                     in the same structure\r
+\r
+  @retval None\r
+\r
 **/\r
 VOID\r
 ArmCallSvc (\r
index ee265f94b9608a0f7a29e17c16ffa1185deec3c8..1a7c10cb793183e7158851e8b8c668658e12987e 100644 (file)
@@ -33,9 +33,11 @@ ASM_PFX(ArmCallSvc):
   ldr   x9, [sp, #16]\r
 \r
   // Store the SVC returned values into the ARM_SVC_ARGS structure.\r
-  // A SVC call can return up to 4 values - we do not need to store back x4-x7.\r
+  // A SVC call can return up to 8 values\r
   stp   x0, x1, [x9, #0]\r
   stp   x2, x3, [x9, #16]\r
+  stp   x4, x5, [x9, #32]\r
+  stp   x6, x7, [x9, #48]\r
 \r
   mov   x0, x9\r
 \r