From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.534.1610691260666066463 for ; Thu, 14 Jan 2021 22:14:20 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: linaro.org, ip: 217.140.110.172, mailfrom: sughosh.ganu@linaro.org) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 642CDED1; Thu, 14 Jan 2021 22:14:20 -0800 (PST) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4274B3F70D; Thu, 14 Jan 2021 22:14:18 -0800 (PST) From: "Sughosh Ganu" To: devel@edk2.groups.io Cc: Sami Mujawar , Ard Biesheuvel , Leif Lindholm , Sahil Malhotra , Ilias Apalodimas , Achin Gupta Subject: [PATCH v3 02/13] ArmPkg/ArmSvcLib: Return x4-x7 in output parameters Date: Fri, 15 Jan 2021 11:43:53 +0530 Message-Id: <20210115061404.13552-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115061404.13552-1-sughosh.ganu@linaro.org> References: <20210115061404.13552-1-sughosh.ganu@linaro.org> From: Achin Gupta 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 Reviewed-by: Sami Mujawar --- Changes since V2: None ArmPkg/Include/Library/ArmSvcLib.h | 10 ++++++++-- ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Include/Library/ArmSvcLib.h b/ArmPkg/Include/Library/ArmSvcLib.h index a94ead1965..a4414270f3 100644 --- a/ArmPkg/Include/Library/ArmSvcLib.h +++ b/ArmPkg/Include/Library/ArmSvcLib.h @@ -27,10 +27,16 @@ typedef struct { /** Trigger an SVC call - SVC calls can take up to 7 arguments and return up to 4 return values. - Therefore, the 4 first fields in the ARM_SVC_ARGS structure are used + SVC calls can take up to 8 arguments and return up to 8 return values. + Therefore, the 8 first fields in the ARM_SVC_ARGS structure are used for both input and output values. + @param[in, out] Args Arguments to be passed as part of the SVC call + The return values of the SVC call are also placed + in the same structure + + @retval None + **/ VOID ArmCallSvc ( diff --git a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S index ee265f94b9..1a7c10cb79 100644 --- a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S +++ b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S @@ -33,9 +33,11 @@ ASM_PFX(ArmCallSvc): ldr x9, [sp, #16] // Store the SVC returned values into the ARM_SVC_ARGS structure. - // A SVC call can return up to 4 values - we do not need to store back x4-x7. + // A SVC call can return up to 8 values stp x0, x1, [x9, #0] stp x2, x3, [x9, #16] + stp x4, x5, [x9, #32] + stp x6, x7, [x9, #48] mov x0, x9 -- 2.17.1