1# zx_smc_call
2
3## NAME
4
5<!-- Updated by update-docs-from-abigen, do not edit. -->
6
7smc_call - Make Secure Monitor Call (SMC) from user space
8
9## SYNOPSIS
10
11<!-- Updated by update-docs-from-abigen, do not edit. -->
12
13```
14#include <zircon/syscalls.h>
15#include <zircon/syscalls/smc.h>
16
17zx_status_t zx_smc_call(zx_handle_t handle,
18                        const zx_smc_parameters_t* parameters,
19                        zx_smc_result_t* out_smc_result);
20```
21
22## DESCRIPTION
23
24`zx_smc_call()` makes a Secure Monitor Call (SMC) from user space. It supports the ARM SMC Calling
25Convention using the `zx_smc_parameters_t` input parameter and `zx_smc_result_t` output parameter.
26The input *handle* must be a resource object with sufficient privileges in order to be executed.
27
28The majority of the parameters are opaque from `zx_smc_call()` perspective because they are
29dependent upon the *func_id*. The *func_id* informs the Secure Monitor the service and function
30to be invoked. The *client_id* is an optional field intended for secure software to track and
31index the calling client OS. The *secure_os_id* is an optional field intended for use when there
32are multiple secure operating systems at S-EL1, so that the caller may specify the intended
33secure OS.
34
35More information is available in the [ARM SMC Calling Convention documentation](
36http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0028b/index.html).
37
38
39## RIGHTS
40
41<!-- Updated by update-docs-from-abigen, do not edit. -->
42
43TODO(ZX-2399)
44
45## RETURN VALUE
46
47`zx_smc_call()` returns **ZX_OK** if *handle* has sufficient privilege. The
48return value of the smc call is returned via **out_smc_result** on success. In the event of
49failure, a negative error value is returned.
50
51## ERRORS
52
53**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
54
55**ZX_ERR_WRONG_TYPE**  *handle* is not a resource handle.
56
57**ZX_ERR_ACCESS_DENIED**  *handle* does not have sufficient privileges.
58
59**ZX_ERR_NOT_SUPPORTED**  smc_call is not supported on this system.
60
61**ZX_ERR_INVALID_ARGS**  *parameters* or *out_smc_result* a null pointer
62