tsp_request.S 738 Bytes
Newer Older
1
2
3
/*
 * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
#include <asm_macros.S>
8
#include <tsp.h>
9
10
11
12
13
14
15
16
17

	.globl tsp_get_magic


/*
 * This function raises an SMC to retrieve arguments from secure
 * monitor/dispatcher, saves the returned arguments the array received in x0,
 * and then returns to the caller
 */
18
func tsp_get_magic
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	/* Save address to stack */
	stp	x0, xzr, [sp, #-16]!

	/* Load arguments */
	ldr	w0, _tsp_fid_get_magic

	/* Raise SMC */
	smc	#0

	/* Restore address from stack */
	ldp	x4, xzr, [sp], #16

	/* Store returned arguments to the array */
	stp	x0, x1, [x4, #0]

	ret
35
endfunc tsp_get_magic
36
37
38
39

	.align 2
_tsp_fid_get_magic:
	.word	TSP_GET_ARGS