diff options
author | Alexei Fedorov <Alexei.Fedorov@arm.com> | 2019-11-29 10:06:37 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2019-11-29 10:06:37 +0000 |
commit | 76f25eb52b10d56b8b54fc63d748c15e428e409a (patch) | |
tree | 438e45919e2d777131a06bbad945cdd77fa70ea1 /docs | |
parent | 90d5f8bdf6aeef17597aa4e9b30654d0d30d0ca5 (diff) | |
parent | e34cc0cedca6e229847c232fe58d37fad2610ce9 (diff) | |
download | arm-trusted-firmware-76f25eb52b10d56b8b54fc63d748c15e428e409a.tar.gz |
Merge "Changes to support updated register usage in SMCCC v1.2" into integration
Diffstat (limited to 'docs')
-rw-r--r-- | docs/design/firmware-design.rst | 4 | ||||
-rw-r--r-- | docs/getting_started/rt-svc-writers-guide.rst | 26 |
2 files changed, 24 insertions, 6 deletions
diff --git a/docs/design/firmware-design.rst b/docs/design/firmware-design.rst index eb0a366d1..cae94b5d8 100644 --- a/docs/design/firmware-design.rst +++ b/docs/design/firmware-design.rst @@ -978,8 +978,8 @@ manipulation; and with ``flags`` indicating the security state of the caller. Th framework finally sets up the execution stack for the handler, and invokes the services ``handle()`` function. -On return from the handler the result registers are populated in X0-X3 before -restoring the stack and CPU state and returning from the original SMC. +On return from the handler the result registers are populated in X0-X7 as needed +before restoring the stack and CPU state and returning from the original SMC. Exception Handling Framework ---------------------------- diff --git a/docs/getting_started/rt-svc-writers-guide.rst b/docs/getting_started/rt-svc-writers-guide.rst index 6a06025ef..5375b659d 100644 --- a/docs/getting_started/rt-svc-writers-guide.rst +++ b/docs/getting_started/rt-svc-writers-guide.rst @@ -244,17 +244,35 @@ The handler is responsible for: TF-A expects owning entities to follow this recommendation. -#. Returning the result to the caller. The `SMCCC`_ allows for up to 256 bits - of return value in SMC64 using X0-X3 and 128 bits in SMC32 using W0-W3. The - framework provides a family of macros to set the multi-register return - value and complete the handler: +#. Returning the result to the caller. Based on `SMCCC`_ spec, results are + returned in W0-W7(X0-X7) registers for SMC32(SMC64) calls from AArch64 + state. Results are returned in R0-R7 registers for SMC32 calls from AArch32 + state. The framework provides a family of macros to set the multi-register + return value and complete the handler: .. code:: c + AArch64 state: + SMC_RET1(handle, x0); SMC_RET2(handle, x0, x1); SMC_RET3(handle, x0, x1, x2); SMC_RET4(handle, x0, x1, x2, x3); + SMC_RET5(handle, x0, x1, x2, x3, x4); + SMC_RET6(handle, x0, x1, x2, x3, x4, x5); + SMC_RET7(handle, x0, x1, x2, x3, x4, x5, x6); + SMC_RET8(handle, x0, x1, x2, x3, x4, x5, x6, x7); + + AArch32 state: + + SMC_RET1(handle, r0); + SMC_RET2(handle, r0, r1); + SMC_RET3(handle, r0, r1, r2); + SMC_RET4(handle, r0, r1, r2, r3); + SMC_RET5(handle, r0, r1, r2, r3, r4); + SMC_RET6(handle, r0, r1, r2, r3, r4, r5); + SMC_RET7(handle, r0, r1, r2, r3, r4, r5, r6); + SMC_RET8(handle, r0, r1, r2, r3, r4, r5, r6, r7); The ``cookie`` parameter to the handler is reserved for future use and can be ignored. The ``handle`` is returned by the SMC handler - completion of the |