blob: 1070864312e013ec56a9482e278bb90fab4b3f0c [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
Madhukar Pappireddyc783c0b2019-11-14 23:52:37 -06002 * Copyright (c) 2016-2019, Arm Limited. All rights reserved.
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <asm_macros.S>
8
9 .globl asm_tftf_smc32
10
11/* ---------------------------------------------------------------------------
12 * void asm_tftf_smc32(const smc_args *args,
13 * smc_ret_values *smc_ret);
14 * ---------------------------------------------------------------------------
15 */
16func asm_tftf_smc32
17 /* Push r9 to keep the stack pointer aligned to 64 bit. */
18 push {r4 - r9}
19
20 /* Store the `smc_ret` pointer in a callee saved register */
21 mov r8, r1
22
23 /* Load values used as arguments for the SMC. */
24 ldm r0, {r0 - r7}
25
26 smc #0
27
28 /*
Madhukar Pappireddyc783c0b2019-11-14 23:52:37 -060029 * The returned values from the SMC are in r0-r7, put them in the
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020030 * 'smc_ret_values' return structure.
31 */
Madhukar Pappireddyc783c0b2019-11-14 23:52:37 -060032 stm r8, {r0 - r7}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020033
34 pop {r4 - r9}
35 bx lr
36endfunc asm_tftf_smc32