1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef _TF_MSG_COMMON_H_
7 #define _TF_MSG_COMMON_H_
9 /* Communication Mailboxes */
13 /* Helper to fill in the parms structure */
14 #define MSG_PREP(parms, mb, type, subtype, req, resp) do { \
16 parms.tf_type = type; \
17 parms.tf_subtype = subtype; \
18 parms.tf_resp_code = 0; \
19 parms.req_size = sizeof(req); \
20 parms.req_data = (uint32_t *)&(req); \
21 parms.resp_size = sizeof(resp); \
22 parms.resp_data = (uint32_t *)&(resp); \
25 #define MSG_PREP_NO_REQ(parms, mb, type, subtype, resp) do { \
27 parms.tf_type = type; \
28 parms.tf_subtype = subtype; \
29 parms.tf_resp_code = 0; \
31 parms.req_data = NULL; \
32 parms.resp_size = sizeof(resp); \
33 parms.resp_data = (uint32_t *)&(resp); \
36 #define MSG_PREP_NO_RESP(parms, mb, type, subtype, req) do { \
38 parms.tf_type = type; \
39 parms.tf_subtype = subtype; \
40 parms.tf_resp_code = 0; \
41 parms.req_size = sizeof(req); \
42 parms.req_data = (uint32_t *)&(req); \
43 parms.resp_size = 0; \
44 parms.resp_data = NULL; \
47 #endif /* _TF_MSG_COMMON_H_ */