blob: fbe7320beab7c9d85473d0ec10be9e4693558c07 [file] [log] [blame]
Balint Dobszay3bd6ae92020-11-23 17:57:50 +01001/*
julhal01c3f4e9a2020-12-15 13:39:01 +00002 * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
Balint Dobszay3bd6ae92020-11-23 17:57:50 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef FFA_CALL_ARGS_H
8#define FFA_CALL_ARGS_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*
15 * Defines convention for use of FFA direct call arguments by
16 * the SP service framework. This header file is used by the
17 * normal world RPC caller and the RPC listener in the SP.
18 */
19
julhal01c3f4e9a2020-12-15 13:39:01 +000020/* Macros for parameters carried in a single register */
21#define FFA_CALL_ARGS_COMBINE_IFACE_ID_OPCODE(i, o) \
22 (((i) << 16) | ((o) & 0xffff))
23#define FFA_CALL_ARGS_EXTRACT_IFACE(reg) \
24 ((reg) >> 16)
25#define FFA_CALL_ARGS_EXTRACT_OPCODE(reg) \
26 ((reg) & 0xffff)
27
Balint Dobszay3bd6ae92020-11-23 17:57:50 +010028/* Common req & resp arg offests into msg_args structure */
julhal01c3f4e9a2020-12-15 13:39:01 +000029#define FFA_CALL_ARGS_IFACE_ID_OPCODE (0)
Balint Dobszay3bd6ae92020-11-23 17:57:50 +010030
31/* Req arg offsets */
32#define FFA_CALL_ARGS_REQ_DATA_LEN (1)
julhal01c3f4e9a2020-12-15 13:39:01 +000033#define FFA_CALL_ARGS_CALLER_ID (2)
34#define FFA_CALL_ARGS_ENCODING (3)
Balint Dobszay3bd6ae92020-11-23 17:57:50 +010035
36/* Resp arg offsets */
37#define FFA_CALL_ARGS_RESP_DATA_LEN (1)
38#define FFA_CALL_ARGS_RESP_RPC_STATUS (2)
39#define FFA_CALL_ARGS_RESP_OP_STATUS (3)
40
41/* Share/unshare offsets */
42#define FFA_CALL_ARGS_SHARE_MEM_HANDLE_LSW (1)
43#define FFA_CALL_ARGS_SHARE_MEM_HANDLE_MSW (2)
44#define FFA_CALL_ARGS_SHARE_MEM_SIZE (3)
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* FFA_CALL_ARGS_H */