xref: /arm-trusted-firmware/bl32/tsp/aarch64/tsp_request.S (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu/*
2*91f16700Schasinglulu * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
3*91f16700Schasinglulu *
4*91f16700Schasinglulu * SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu */
6*91f16700Schasinglulu
7*91f16700Schasinglulu#include <asm_macros.S>
8*91f16700Schasinglulu#include <bl32/tsp/tsp.h>
9*91f16700Schasinglulu
10*91f16700Schasinglulu	.globl tsp_get_magic
11*91f16700Schasinglulu
12*91f16700Schasinglulu/*
13*91f16700Schasinglulu * This function raises an SMC to retrieve arguments from secure
14*91f16700Schasinglulu * monitor/dispatcher, saves the returned arguments the array received in x0,
15*91f16700Schasinglulu * and then returns to the caller
16*91f16700Schasinglulu */
17*91f16700Schasinglulufunc tsp_get_magic
18*91f16700Schasinglulu	/* Load arguments */
19*91f16700Schasinglulu	ldr	w0, _tsp_fid_get_magic
20*91f16700Schasinglulu
21*91f16700Schasinglulu	/* Raise SMC */
22*91f16700Schasinglulu	smc	#0
23*91f16700Schasinglulu
24*91f16700Schasinglulu	/* Return arguments in x1:x0 */
25*91f16700Schasinglulu	ret
26*91f16700Schasingluluendfunc tsp_get_magic
27*91f16700Schasinglulu
28*91f16700Schasinglulu	.align 2
29*91f16700Schasinglulu_tsp_fid_get_magic:
30*91f16700Schasinglulu	.word	TSP_GET_ARGS
31