Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | From a9edc50077d72cdd7e40ba3f03aee974848cd532 Mon Sep 17 00:00:00 2001 |
| 2 | From: Imre Kis <imre.kis@arm.com> |
| 3 | Date: Tue, 19 Jul 2022 17:38:00 +0200 |
| 4 | Subject: [PATCH 21/24] Add 64 bit direct message handling to libsp |
| 5 | |
| 6 | * Change direct message struct to allow 64 bit arguments |
| 7 | * Add 64 bit direct message req/resp functions to FF-A layer |
| 8 | * Distinguish 32/64 bit messages on SP layer by field in sp_msg |
| 9 | * Update tests and mocks |
| 10 | |
| 11 | The FF-A direct message response must match the request's 32/64bit mode |
| 12 | which is the responsibility of the callee and it should be validated by |
| 13 | the SPMC. |
| 14 | |
| 15 | Signed-off-by: Imre Kis <imre.kis@arm.com> |
| 16 | Change-Id: Ibbd64ca0291dfe142a23471a649a07ba1a036824 |
| 17 | |
| 18 | Upstream-Status: Pending [In review] |
| 19 | Signed-off-by: Anton Antonov <Anton.Antonov@arm.com> |
| 20 | |
| 21 | --- |
| 22 | components/messaging/ffa/libsp/ffa.c | 84 ++- |
| 23 | .../libsp/ffa_direct_msg_routing_extension.c | 28 +- |
| 24 | .../messaging/ffa/libsp/include/ffa_api.h | 58 +- |
| 25 | .../ffa/libsp/include/ffa_api_defines.h | 5 + |
| 26 | .../ffa/libsp/include/ffa_api_types.h | 7 +- |
| 27 | .../ffa/libsp/include/sp_messaging.h | 9 +- |
| 28 | .../messaging/ffa/libsp/mock/mock_ffa_api.cpp | 100 +++- |
| 29 | .../messaging/ffa/libsp/mock/mock_ffa_api.h | 34 +- |
| 30 | .../ffa/libsp/mock/test/test_mock_ffa_api.cpp | 50 +- |
| 31 | components/messaging/ffa/libsp/sp_messaging.c | 74 ++- |
| 32 | .../messaging/ffa/libsp/test/test_ffa_api.cpp | 337 ++++++++++-- |
| 33 | .../ffa/libsp/test/test_sp_messaging.cpp | 498 ++++++++++-------- |
| 34 | .../rpc/ffarpc/caller/sp/ffarpc_caller.c | 31 +- |
| 35 | .../rpc/ffarpc/endpoint/ffarpc_call_ep.c | 4 +- |
| 36 | .../endpoint/sp/mm_communicate_call_ep.c | 16 +- |
| 37 | .../smm-gateway/common/smm_gateway_sp.c | 8 +- |
| 38 | 16 files changed, 961 insertions(+), 382 deletions(-) |
| 39 | |
| 40 | diff --git a/components/messaging/ffa/libsp/ffa.c b/components/messaging/ffa/libsp/ffa.c |
| 41 | index 374e940..caacc79 100644 |
| 42 | --- a/components/messaging/ffa/libsp/ffa.c |
| 43 | +++ b/components/messaging/ffa/libsp/ffa.c |
| 44 | @@ -33,11 +33,20 @@ static inline void ffa_unpack_direct_msg(struct ffa_params *svc_result, |
| 45 | msg->function_id = svc_result->a0; |
| 46 | msg->source_id = (svc_result->a1 >> 16); |
| 47 | msg->destination_id = svc_result->a1; |
| 48 | - msg->args[0] = svc_result->a3; |
| 49 | - msg->args[1] = svc_result->a4; |
| 50 | - msg->args[2] = svc_result->a5; |
| 51 | - msg->args[3] = svc_result->a6; |
| 52 | - msg->args[4] = svc_result->a7; |
| 53 | + |
| 54 | + if (FFA_IS_32_BIT_FUNC(msg->function_id)) { |
| 55 | + msg->args.args32[0] = svc_result->a3; |
| 56 | + msg->args.args32[1] = svc_result->a4; |
| 57 | + msg->args.args32[2] = svc_result->a5; |
| 58 | + msg->args.args32[3] = svc_result->a6; |
| 59 | + msg->args.args32[4] = svc_result->a7; |
| 60 | + } else { |
| 61 | + msg->args.args64[0] = svc_result->a3; |
| 62 | + msg->args.args64[1] = svc_result->a4; |
| 63 | + msg->args.args64[2] = svc_result->a5; |
| 64 | + msg->args.args64[3] = svc_result->a6; |
| 65 | + msg->args.args64[4] = svc_result->a7; |
| 66 | + } |
| 67 | } |
| 68 | |
| 69 | /* |
| 70 | @@ -217,7 +226,7 @@ ffa_result ffa_msg_wait(struct ffa_direct_msg *msg) |
| 71 | |
| 72 | if (result.a0 == FFA_ERROR) { |
| 73 | return ffa_get_errorcode(&result); |
| 74 | - } else if (result.a0 == FFA_MSG_SEND_DIRECT_REQ_32) { |
| 75 | + } else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) { |
| 76 | ffa_unpack_direct_msg(&result, msg); |
| 77 | } else { |
| 78 | assert(result.a0 == FFA_SUCCESS_32); |
| 79 | @@ -227,13 +236,15 @@ ffa_result ffa_msg_wait(struct ffa_direct_msg *msg) |
| 80 | return FFA_OK; |
| 81 | } |
| 82 | |
| 83 | -ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 84 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 85 | - uint32_t a4, struct ffa_direct_msg *msg) |
| 86 | +static ffa_result ffa_msg_send_direct_req(uint32_t function_id, uint32_t resp_id, |
| 87 | + uint16_t source, uint16_t dest, |
| 88 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 89 | + uint64_t a3, uint64_t a4, |
| 90 | + struct ffa_direct_msg *msg) |
| 91 | { |
| 92 | struct ffa_params result = {0}; |
| 93 | |
| 94 | - ffa_svc(FFA_MSG_SEND_DIRECT_REQ_32, |
| 95 | + ffa_svc(function_id, |
| 96 | SHIFT_U32(source, FFA_MSG_SEND_DIRECT_REQ_SOURCE_ID_SHIFT) | |
| 97 | dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result); |
| 98 | |
| 99 | @@ -244,7 +255,7 @@ ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 100 | |
| 101 | if (result.a0 == FFA_ERROR) { |
| 102 | return ffa_get_errorcode(&result); |
| 103 | - } else if (result.a0 == FFA_MSG_SEND_DIRECT_RESP_32) { |
| 104 | + } else if (result.a0 == resp_id) { |
| 105 | ffa_unpack_direct_msg(&result, msg); |
| 106 | } else { |
| 107 | assert(result.a0 == FFA_SUCCESS_32); |
| 108 | @@ -254,13 +265,36 @@ ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 109 | return FFA_OK; |
| 110 | } |
| 111 | |
| 112 | -ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 113 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 114 | - uint32_t a4, struct ffa_direct_msg *msg) |
| 115 | +ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest, |
| 116 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 117 | + uint32_t a3, uint32_t a4, |
| 118 | + struct ffa_direct_msg *msg) |
| 119 | +{ |
| 120 | + return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_32, |
| 121 | + FFA_MSG_SEND_DIRECT_RESP_32, |
| 122 | + source, dest, a0, a1, a2, a3, a4, msg); |
| 123 | +} |
| 124 | + |
| 125 | +ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest, |
| 126 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 127 | + uint64_t a3, uint64_t a4, |
| 128 | + struct ffa_direct_msg *msg) |
| 129 | +{ |
| 130 | + return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_64, |
| 131 | + FFA_MSG_SEND_DIRECT_RESP_64, |
| 132 | + source, dest, a0, a1, a2, a3, a4, msg); |
| 133 | +} |
| 134 | + |
| 135 | +static ffa_result ffa_msg_send_direct_resp(uint32_t function_id, |
| 136 | + uint16_t source, uint16_t dest, |
| 137 | + uint64_t a0, uint64_t a1, |
| 138 | + uint64_t a2, uint64_t a3, |
| 139 | + uint64_t a4, |
| 140 | + struct ffa_direct_msg *msg) |
| 141 | { |
| 142 | struct ffa_params result = {0}; |
| 143 | |
| 144 | - ffa_svc(FFA_MSG_SEND_DIRECT_RESP_32, |
| 145 | + ffa_svc(function_id, |
| 146 | SHIFT_U32(source, FFA_MSG_SEND_DIRECT_RESP_SOURCE_ID_SHIFT) | |
| 147 | dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result); |
| 148 | |
| 149 | @@ -271,7 +305,7 @@ ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 150 | |
| 151 | if (result.a0 == FFA_ERROR) { |
| 152 | return ffa_get_errorcode(&result); |
| 153 | - } else if (result.a0 == FFA_MSG_SEND_DIRECT_REQ_32) { |
| 154 | + } else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) { |
| 155 | ffa_unpack_direct_msg(&result, msg); |
| 156 | } else { |
| 157 | assert(result.a0 == FFA_SUCCESS_32); |
| 158 | @@ -281,6 +315,24 @@ ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 159 | return FFA_OK; |
| 160 | } |
| 161 | |
| 162 | +ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, |
| 163 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 164 | + uint32_t a3, uint32_t a4, |
| 165 | + struct ffa_direct_msg *msg) |
| 166 | +{ |
| 167 | + return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_32, source, |
| 168 | + dest, a0, a1, a2, a3, a4, msg); |
| 169 | +} |
| 170 | + |
| 171 | +ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, |
| 172 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 173 | + uint64_t a3, uint64_t a4, |
| 174 | + struct ffa_direct_msg *msg) |
| 175 | +{ |
| 176 | + return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_64, source, |
| 177 | + dest, a0, a1, a2, a3, a4, msg); |
| 178 | +} |
| 179 | + |
| 180 | ffa_result ffa_mem_donate(uint32_t total_length, uint32_t fragment_length, |
| 181 | void *buffer_address, uint32_t page_count, |
| 182 | uint64_t *handle) |
| 183 | diff --git a/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c b/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c |
| 184 | index 6813573..03a372f 100644 |
| 185 | --- a/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c |
| 186 | +++ b/components/messaging/ffa/libsp/ffa_direct_msg_routing_extension.c |
| 187 | @@ -1,6 +1,6 @@ |
| 188 | // SPDX-License-Identifier: BSD-3-Clause |
| 189 | /* |
| 190 | - * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved. |
| 191 | + * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
| 192 | */ |
| 193 | |
| 194 | #include "ffa_direct_msg_routing_extension.h" |
| 195 | @@ -20,23 +20,23 @@ static uint16_t callee_id = SP_ID_INVALID; |
| 196 | |
| 197 | static bool is_rc_message(const struct ffa_direct_msg *msg) |
| 198 | { |
| 199 | - return msg->args[0] & FFA_ROUTING_EXT_RC_BIT; |
| 200 | + return msg->args.args32[0] & FFA_ROUTING_EXT_RC_BIT; |
| 201 | } |
| 202 | |
| 203 | static bool is_error_message(const struct ffa_direct_msg *msg) |
| 204 | { |
| 205 | - return msg->args[0] & FFA_ROUTING_EXT_ERROR_BIT; |
| 206 | + return msg->args.args32[0] & FFA_ROUTING_EXT_ERROR_BIT; |
| 207 | } |
| 208 | |
| 209 | static ffa_result get_error_code_from_message(const struct ffa_direct_msg *msg) |
| 210 | { |
| 211 | - return (ffa_result)msg->args[1]; |
| 212 | + return (ffa_result)msg->args.args32[1]; |
| 213 | } |
| 214 | |
| 215 | static ffa_result send_rc_error_message(struct ffa_direct_msg *req, |
| 216 | ffa_result error_code) |
| 217 | { |
| 218 | - return ffa_msg_send_direct_resp(req->destination_id, req->source_id, |
| 219 | + return ffa_msg_send_direct_resp_32(req->destination_id, req->source_id, |
| 220 | (FFA_ROUTING_EXT_ERROR_BIT | |
| 221 | FFA_ROUTING_EXT_RC_BIT), |
| 222 | error_code, 0, 0, 0, req); |
| 223 | @@ -45,7 +45,7 @@ static ffa_result send_rc_error_message(struct ffa_direct_msg *req, |
| 224 | static ffa_result send_rc_error_message_to_rc_root(struct ffa_direct_msg *resp, |
| 225 | ffa_result error_code) |
| 226 | { |
| 227 | - return ffa_msg_send_direct_req(own_id, callee_id, |
| 228 | + return ffa_msg_send_direct_req_32(own_id, callee_id, |
| 229 | (FFA_ROUTING_EXT_RC_BIT | |
| 230 | FFA_ROUTING_EXT_ERROR_BIT), |
| 231 | error_code, 0, 0, 0, resp); |
| 232 | @@ -128,10 +128,10 @@ ffa_result ffa_direct_msg_routing_ext_req_post_hook(struct ffa_direct_msg *resp) |
| 233 | /* Forwarding RC request towards the root (normal world) */ |
| 234 | state = forwarding; |
| 235 | |
| 236 | - ffa_res = ffa_msg_send_direct_resp(own_id, caller_id, |
| 237 | - resp->args[0], resp->args[1], |
| 238 | - resp->args[2], resp->args[3], |
| 239 | - resp->args[4], &rc_resp); |
| 240 | + ffa_res = ffa_msg_send_direct_resp_32(own_id, caller_id, |
| 241 | + resp->args.args32[0], resp->args.args32[1], |
| 242 | + resp->args.args32[2], resp->args.args32[3], |
| 243 | + resp->args.args32[4], &rc_resp); |
| 244 | if (ffa_res != FFA_OK) |
| 245 | goto forward_ffa_error_to_rc_root; |
| 246 | |
| 247 | @@ -145,9 +145,9 @@ ffa_result ffa_direct_msg_routing_ext_req_post_hook(struct ffa_direct_msg *resp) |
| 248 | |
| 249 | /* Forwarding RC response towards the RC root. */ |
| 250 | state = internal; |
| 251 | - ffa_res = ffa_msg_send_direct_req( |
| 252 | - own_id, callee_id, rc_resp.args[0], rc_resp.args[1], |
| 253 | - rc_resp.args[2], rc_resp.args[3], rc_resp.args[4], |
| 254 | + ffa_res = ffa_msg_send_direct_req_32( |
| 255 | + own_id, callee_id, rc_resp.args.args32[0], rc_resp.args.args32[1], |
| 256 | + rc_resp.args.args32[2], rc_resp.args.args32[3], rc_resp.args.args32[4], |
| 257 | resp); |
| 258 | |
| 259 | goto break_on_ffa_error; |
| 260 | @@ -197,7 +197,7 @@ void ffa_direct_msg_routing_ext_resp_error_hook(void) |
| 261 | |
| 262 | void ffa_direct_msg_routing_ext_rc_req_pre_hook(struct ffa_direct_msg *req) |
| 263 | { |
| 264 | - req->args[0] = FFA_ROUTING_EXT_RC_BIT; |
| 265 | + req->args.args32[0] = FFA_ROUTING_EXT_RC_BIT; |
| 266 | state = rc_root; |
| 267 | } |
| 268 | |
| 269 | diff --git a/components/messaging/ffa/libsp/include/ffa_api.h b/components/messaging/ffa/libsp/include/ffa_api.h |
| 270 | index ec5cb04..4b7073b 100644 |
| 271 | --- a/components/messaging/ffa/libsp/include/ffa_api.h |
| 272 | +++ b/components/messaging/ffa/libsp/include/ffa_api.h |
| 273 | @@ -126,8 +126,8 @@ ffa_result ffa_msg_wait(struct ffa_direct_msg *msg); |
| 274 | /** Messaging interfaces */ |
| 275 | |
| 276 | /** |
| 277 | - * @brief Sends a partition message in parameter registers as a request and |
| 278 | - * blocks until the response is available. |
| 279 | + * @brief Sends a 32 bit partition message in parameter registers as a |
| 280 | + * request and blocks until the response is available. |
| 281 | * @note The ffa_interrupt_handler function can be called during the |
| 282 | * execution of this function |
| 283 | * |
| 284 | @@ -138,13 +138,14 @@ ffa_result ffa_msg_wait(struct ffa_direct_msg *msg); |
| 285 | * |
| 286 | * @return The FF-A error status code |
| 287 | */ |
| 288 | -ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 289 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 290 | - uint32_t a4, struct ffa_direct_msg *msg); |
| 291 | +ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest, |
| 292 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 293 | + uint32_t a3, uint32_t a4, |
| 294 | + struct ffa_direct_msg *msg); |
| 295 | |
| 296 | /** |
| 297 | - * @brief Sends a partition message in parameter registers as a response |
| 298 | - * and blocks until the response is available. |
| 299 | + * @brief Sends a 64 bit partition message in parameter registers as a |
| 300 | + * request and blocks until the response is available. |
| 301 | * @note The ffa_interrupt_handler function can be called during the |
| 302 | * execution of this function |
| 303 | * |
| 304 | @@ -155,9 +156,46 @@ ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 305 | * |
| 306 | * @return The FF-A error status code |
| 307 | */ |
| 308 | -ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 309 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 310 | - uint32_t a4, struct ffa_direct_msg *msg); |
| 311 | +ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest, |
| 312 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 313 | + uint64_t a3, uint64_t a4, |
| 314 | + struct ffa_direct_msg *msg); |
| 315 | + |
| 316 | +/** |
| 317 | + * @brief Sends a 32 bit partition message in parameter registers as a |
| 318 | + * response and blocks until the response is available. |
| 319 | + * @note The ffa_interrupt_handler function can be called during the |
| 320 | + * execution of this function |
| 321 | + * |
| 322 | + * @param[in] source Source endpoint ID |
| 323 | + * @param[in] dest Destination endpoint ID |
| 324 | + * @param[in] a0,a1,a2,a3,a4 Implementation defined message values |
| 325 | + * @param[out] msg The response message |
| 326 | + * |
| 327 | + * @return The FF-A error status code |
| 328 | + */ |
| 329 | +ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, |
| 330 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 331 | + uint32_t a3, uint32_t a4, |
| 332 | + struct ffa_direct_msg *msg); |
| 333 | + |
| 334 | +/** |
| 335 | + * @brief Sends a 64 bit partition message in parameter registers as a |
| 336 | + * response and blocks until the response is available. |
| 337 | + * @note The ffa_interrupt_handler function can be called during the |
| 338 | + * execution of this function |
| 339 | + * |
| 340 | + * @param[in] source Source endpoint ID |
| 341 | + * @param[in] dest Destination endpoint ID |
| 342 | + * @param[in] a0,a1,a2,a3,a4 Implementation defined message values |
| 343 | + * @param[out] msg The response message |
| 344 | + * |
| 345 | + * @return The FF-A error status code |
| 346 | + */ |
| 347 | +ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, |
| 348 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 349 | + uint64_t a3, uint64_t a4, |
| 350 | + struct ffa_direct_msg *msg); |
| 351 | |
| 352 | /** |
| 353 | * Memory management interfaces |
| 354 | diff --git a/components/messaging/ffa/libsp/include/ffa_api_defines.h b/components/messaging/ffa/libsp/include/ffa_api_defines.h |
| 355 | index 95bcb0c..163a0cd 100644 |
| 356 | --- a/components/messaging/ffa/libsp/include/ffa_api_defines.h |
| 357 | +++ b/components/messaging/ffa/libsp/include/ffa_api_defines.h |
| 358 | @@ -58,6 +58,11 @@ |
| 359 | #define FFA_MEM_PERM_GET UINT32_C(0x84000088) |
| 360 | #define FFA_MEM_PERM_SET UINT32_C(0x84000089) |
| 361 | |
| 362 | +/* Utility macros */ |
| 363 | +#define FFA_TO_32_BIT_FUNC(x) ((x) & (~UINT32_C(0x40000000))) |
| 364 | +#define FFA_IS_32_BIT_FUNC(x) (((x) & UINT32_C(0x40000000)) == 0) |
| 365 | +#define FFA_IS_64_BIT_FUNC(x) (((x) & UINT32_C(0x40000000)) != 0) |
| 366 | + |
| 367 | /* Special value for MBZ parameters */ |
| 368 | #define FFA_PARAM_MBZ UINT32_C(0x0) |
| 369 | |
| 370 | diff --git a/components/messaging/ffa/libsp/include/ffa_api_types.h b/components/messaging/ffa/libsp/include/ffa_api_types.h |
| 371 | index 3686e2e..b1be7ac 100644 |
| 372 | --- a/components/messaging/ffa/libsp/include/ffa_api_types.h |
| 373 | +++ b/components/messaging/ffa/libsp/include/ffa_api_types.h |
| 374 | @@ -1,6 +1,6 @@ |
| 375 | /* SPDX-License-Identifier: BSD-3-Clause */ |
| 376 | /* |
| 377 | - * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. |
| 378 | + * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
| 379 | */ |
| 380 | |
| 381 | #ifndef LIBSP_INCLUDE_FFA_API_TYPES_H_ |
| 382 | @@ -80,7 +80,10 @@ struct ffa_direct_msg { |
| 383 | uint32_t function_id; |
| 384 | uint16_t source_id; |
| 385 | uint16_t destination_id; |
| 386 | - uint32_t args[5]; |
| 387 | + union { |
| 388 | + uint32_t args32[5]; |
| 389 | + uint64_t args64[5]; |
| 390 | + } args; |
| 391 | }; |
| 392 | |
| 393 | /** |
| 394 | diff --git a/components/messaging/ffa/libsp/include/sp_messaging.h b/components/messaging/ffa/libsp/include/sp_messaging.h |
| 395 | index 4bb45f7..7173a92 100644 |
| 396 | --- a/components/messaging/ffa/libsp/include/sp_messaging.h |
| 397 | +++ b/components/messaging/ffa/libsp/include/sp_messaging.h |
| 398 | @@ -1,6 +1,6 @@ |
| 399 | /* SPDX-License-Identifier: BSD-3-Clause */ |
| 400 | /* |
| 401 | - * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 402 | + * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. |
| 403 | */ |
| 404 | |
| 405 | #ifndef LIBSP_INCLUDE_SP_MESSAGING_H_ |
| 406 | @@ -9,6 +9,7 @@ |
| 407 | #include "sp_api_defines.h" |
| 408 | #include "sp_api_types.h" |
| 409 | |
| 410 | +#include <stdbool.h> |
| 411 | #include <stdint.h> |
| 412 | |
| 413 | #ifdef __cplusplus |
| 414 | @@ -23,7 +24,11 @@ extern "C" { |
| 415 | struct sp_msg { |
| 416 | uint16_t source_id; |
| 417 | uint16_t destination_id; |
| 418 | - uint32_t args[SP_MSG_ARG_COUNT]; |
| 419 | + bool is_64bit_message; |
| 420 | + union { |
| 421 | + uint32_t args32[SP_MSG_ARG_COUNT]; |
| 422 | + uint64_t args64[SP_MSG_ARG_COUNT]; |
| 423 | + } args; |
| 424 | }; |
| 425 | |
| 426 | /** |
| 427 | diff --git a/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp b/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp |
| 428 | index ceebcbf..a01848c 100644 |
| 429 | --- a/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp |
| 430 | +++ b/components/messaging/ffa/libsp/mock/mock_ffa_api.cpp |
| 431 | @@ -140,13 +140,13 @@ ffa_result ffa_msg_wait(struct ffa_direct_msg *msg) |
| 432 | .returnIntValue(); |
| 433 | } |
| 434 | |
| 435 | -void expect_ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 436 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 437 | - uint32_t a4, |
| 438 | - const struct ffa_direct_msg *msg, |
| 439 | - ffa_result result) |
| 440 | +void expect_ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest, |
| 441 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 442 | + uint32_t a3, uint32_t a4, |
| 443 | + const struct ffa_direct_msg *msg, |
| 444 | + ffa_result result) |
| 445 | { |
| 446 | - mock().expectOneCall("ffa_msg_send_direct_req") |
| 447 | + mock().expectOneCall("ffa_msg_send_direct_req_32") |
| 448 | .withUnsignedIntParameter("source", source) |
| 449 | .withUnsignedIntParameter("dest", dest) |
| 450 | .withUnsignedIntParameter("a0", a0) |
| 451 | @@ -158,12 +158,13 @@ void expect_ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 452 | .andReturnValue(result); |
| 453 | } |
| 454 | |
| 455 | -ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 456 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 457 | - uint32_t a4, struct ffa_direct_msg *msg) |
| 458 | +ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest, |
| 459 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 460 | + uint32_t a3,uint32_t a4, |
| 461 | + struct ffa_direct_msg *msg) |
| 462 | { |
| 463 | return mock() |
| 464 | - .actualCall("ffa_msg_send_direct_req") |
| 465 | + .actualCall("ffa_msg_send_direct_req_32") |
| 466 | .withUnsignedIntParameter("source", source) |
| 467 | .withUnsignedIntParameter("dest", dest) |
| 468 | .withUnsignedIntParameter("a0", a0) |
| 469 | @@ -175,13 +176,49 @@ ffa_result ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 470 | .returnIntValue(); |
| 471 | } |
| 472 | |
| 473 | -void expect_ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, |
| 474 | +void expect_ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest, |
| 475 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 476 | + uint64_t a3, uint64_t a4, |
| 477 | + const struct ffa_direct_msg *msg, |
| 478 | + ffa_result result) |
| 479 | +{ |
| 480 | + mock().expectOneCall("ffa_msg_send_direct_req_64") |
| 481 | + .withUnsignedIntParameter("source", source) |
| 482 | + .withUnsignedIntParameter("dest", dest) |
| 483 | + .withUnsignedLongIntParameter("a0", a0) |
| 484 | + .withUnsignedLongIntParameter("a1", a1) |
| 485 | + .withUnsignedLongIntParameter("a2", a2) |
| 486 | + .withUnsignedLongIntParameter("a3", a3) |
| 487 | + .withUnsignedLongIntParameter("a4", a4) |
| 488 | + .withOutputParameterReturning("msg", msg, sizeof(*msg)) |
| 489 | + .andReturnValue(result); |
| 490 | +} |
| 491 | + |
| 492 | +ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest, |
| 493 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 494 | + uint64_t a3, uint64_t a4, |
| 495 | + struct ffa_direct_msg *msg) |
| 496 | +{ |
| 497 | + return mock() |
| 498 | + .actualCall("ffa_msg_send_direct_req_64") |
| 499 | + .withUnsignedIntParameter("source", source) |
| 500 | + .withUnsignedIntParameter("dest", dest) |
| 501 | + .withUnsignedLongIntParameter("a0", a0) |
| 502 | + .withUnsignedLongIntParameter("a1", a1) |
| 503 | + .withUnsignedLongIntParameter("a2", a2) |
| 504 | + .withUnsignedLongIntParameter("a3", a3) |
| 505 | + .withUnsignedLongIntParameter("a4", a4) |
| 506 | + .withOutputParameter("msg", msg) |
| 507 | + .returnIntValue(); |
| 508 | +} |
| 509 | + |
| 510 | +void expect_ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, |
| 511 | uint32_t a0, uint32_t a1, uint32_t a2, |
| 512 | uint32_t a3, uint32_t a4, |
| 513 | const struct ffa_direct_msg *msg, |
| 514 | ffa_result result) |
| 515 | { |
| 516 | - mock().expectOneCall("ffa_msg_send_direct_resp") |
| 517 | + mock().expectOneCall("ffa_msg_send_direct_resp_32") |
| 518 | .withUnsignedIntParameter("source", source) |
| 519 | .withUnsignedIntParameter("dest", dest) |
| 520 | .withUnsignedIntParameter("a0", a0) |
| 521 | @@ -193,12 +230,12 @@ void expect_ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, |
| 522 | .andReturnValue(result); |
| 523 | } |
| 524 | |
| 525 | -ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 526 | +ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, uint32_t a0, |
| 527 | uint32_t a1, uint32_t a2, uint32_t a3, |
| 528 | uint32_t a4, struct ffa_direct_msg *msg) |
| 529 | { |
| 530 | return mock() |
| 531 | - .actualCall("ffa_msg_send_direct_resp") |
| 532 | + .actualCall("ffa_msg_send_direct_resp_32") |
| 533 | .withUnsignedIntParameter("source", source) |
| 534 | .withUnsignedIntParameter("dest", dest) |
| 535 | .withUnsignedIntParameter("a0", a0) |
| 536 | @@ -210,6 +247,41 @@ ffa_result ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, uint32_t a0, |
| 537 | .returnIntValue(); |
| 538 | } |
| 539 | |
| 540 | +void expect_ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, |
| 541 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 542 | + uint64_t a3, uint64_t a4, |
| 543 | + const struct ffa_direct_msg *msg, |
| 544 | + ffa_result result) |
| 545 | +{ |
| 546 | + mock().expectOneCall("ffa_msg_send_direct_resp_64") |
| 547 | + .withUnsignedIntParameter("source", source) |
| 548 | + .withUnsignedIntParameter("dest", dest) |
| 549 | + .withUnsignedLongIntParameter("a0", a0) |
| 550 | + .withUnsignedLongIntParameter("a1", a1) |
| 551 | + .withUnsignedLongIntParameter("a2", a2) |
| 552 | + .withUnsignedLongIntParameter("a3", a3) |
| 553 | + .withUnsignedLongIntParameter("a4", a4) |
| 554 | + .withOutputParameterReturning("msg", msg, sizeof(*msg)) |
| 555 | + .andReturnValue(result); |
| 556 | +} |
| 557 | + |
| 558 | +ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, uint64_t a0, |
| 559 | + uint64_t a1, uint64_t a2, uint64_t a3, |
| 560 | + uint64_t a4, struct ffa_direct_msg *msg) |
| 561 | +{ |
| 562 | + return mock() |
| 563 | + .actualCall("ffa_msg_send_direct_resp_64") |
| 564 | + .withUnsignedIntParameter("source", source) |
| 565 | + .withUnsignedIntParameter("dest", dest) |
| 566 | + .withUnsignedLongIntParameter("a0", a0) |
| 567 | + .withUnsignedLongIntParameter("a1", a1) |
| 568 | + .withUnsignedLongIntParameter("a2", a2) |
| 569 | + .withUnsignedLongIntParameter("a3", a3) |
| 570 | + .withUnsignedLongIntParameter("a4", a4) |
| 571 | + .withOutputParameter("msg", msg) |
| 572 | + .returnIntValue(); |
| 573 | +} |
| 574 | + |
| 575 | void expect_ffa_mem_donate(uint32_t total_length, uint32_t fragment_length, |
| 576 | void *buffer_address, uint32_t page_count, |
| 577 | const uint64_t *handle, ffa_result result) |
| 578 | diff --git a/components/messaging/ffa/libsp/mock/mock_ffa_api.h b/components/messaging/ffa/libsp/mock/mock_ffa_api.h |
| 579 | index b1c794f..4213ccb 100644 |
| 580 | --- a/components/messaging/ffa/libsp/mock/mock_ffa_api.h |
| 581 | +++ b/components/messaging/ffa/libsp/mock/mock_ffa_api.h |
| 582 | @@ -30,17 +30,29 @@ void expect_ffa_id_get(const uint16_t *id, ffa_result result); |
| 583 | |
| 584 | void expect_ffa_msg_wait(const struct ffa_direct_msg *msg, ffa_result result); |
| 585 | |
| 586 | -void expect_ffa_msg_send_direct_req(uint16_t source, uint16_t dest, uint32_t a0, |
| 587 | - uint32_t a1, uint32_t a2, uint32_t a3, |
| 588 | - uint32_t a4, |
| 589 | - const struct ffa_direct_msg *msg, |
| 590 | - ffa_result result); |
| 591 | - |
| 592 | -void expect_ffa_msg_send_direct_resp(uint16_t source, uint16_t dest, |
| 593 | - uint32_t a0, uint32_t a1, uint32_t a2, |
| 594 | - uint32_t a3, uint32_t a4, |
| 595 | - const struct ffa_direct_msg *msg, |
| 596 | - ffa_result result); |
| 597 | +void expect_ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest, |
| 598 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 599 | + uint32_t a3, uint32_t a4, |
| 600 | + const struct ffa_direct_msg *msg, |
| 601 | + ffa_result result); |
| 602 | + |
| 603 | +void expect_ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest, |
| 604 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 605 | + uint64_t a3, uint64_t a4, |
| 606 | + const struct ffa_direct_msg *msg, |
| 607 | + ffa_result result); |
| 608 | + |
| 609 | +void expect_ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest, |
| 610 | + uint32_t a0, uint32_t a1, uint32_t a2, |
| 611 | + uint32_t a3, uint32_t a4, |
| 612 | + const struct ffa_direct_msg *msg, |
| 613 | + ffa_result result); |
| 614 | + |
| 615 | +void expect_ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest, |
| 616 | + uint64_t a0, uint64_t a1, uint64_t a2, |
| 617 | + uint64_t a3, uint64_t a4, |
| 618 | + const struct ffa_direct_msg *msg, |
| 619 | + ffa_result result); |
| 620 | |
| 621 | void expect_ffa_mem_donate(uint32_t total_length, uint32_t fragment_length, |
| 622 | void *buffer_address, uint32_t page_count, |
| 623 | diff --git a/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp b/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp |
| 624 | index ab33649..c1cbdd6 100644 |
| 625 | --- a/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp |
| 626 | +++ b/components/messaging/ffa/libsp/mock/test/test_mock_ffa_api.cpp |
| 627 | @@ -105,7 +105,7 @@ TEST(mock_ffa_api, ffa_msg_wait) |
| 628 | MEMCMP_EQUAL(&expected_msg, &msg, sizeof(expected_msg)); |
| 629 | } |
| 630 | |
| 631 | -TEST(mock_ffa_api, ffa_msg_send_direct_req) |
| 632 | +TEST(mock_ffa_api, ffa_msg_send_direct_req_32) |
| 633 | { |
| 634 | const uint16_t source = 0x1122; |
| 635 | const uint16_t dest = 0x2233; |
| 636 | @@ -116,13 +116,30 @@ TEST(mock_ffa_api, ffa_msg_send_direct_req) |
| 637 | const uint32_t a4 = 0x89124567; |
| 638 | struct ffa_direct_msg msg = { 0 }; |
| 639 | |
| 640 | - expect_ffa_msg_send_direct_req(source, dest, a0, a1, a2, a3, a4, |
| 641 | + expect_ffa_msg_send_direct_req_32(source, dest, a0, a1, a2, a3, a4, |
| 642 | + &expected_msg, result); |
| 643 | + LONGS_EQUAL(result, ffa_msg_send_direct_req_32(source, dest, a0, a1, a2, |
| 644 | + a3, a4, &msg)); |
| 645 | +} |
| 646 | + |
| 647 | +TEST(mock_ffa_api, ffa_msg_send_direct_req_64) |
| 648 | +{ |
| 649 | + const uint16_t source = 0x1122; |
| 650 | + const uint16_t dest = 0x2233; |
| 651 | + const uint64_t a0 = 0x4567891221987654; |
| 652 | + const uint64_t a1 = 0x5678912442198765; |
| 653 | + const uint64_t a2 = 0x6789124554219876; |
| 654 | + const uint64_t a3 = 0x7891245665421987; |
| 655 | + const uint64_t a4 = 0x8912456776542198; |
| 656 | + struct ffa_direct_msg msg = { 0 }; |
| 657 | + |
| 658 | + expect_ffa_msg_send_direct_req_64(source, dest, a0, a1, a2, a3, a4, |
| 659 | &expected_msg, result); |
| 660 | - LONGS_EQUAL(result, ffa_msg_send_direct_req(source, dest, a0, a1, a2, |
| 661 | - a3, a4, &msg)); |
| 662 | + LONGS_EQUAL(result, ffa_msg_send_direct_req_64(source, dest, a0, a1, a2, |
| 663 | + a3, a4, &msg)); |
| 664 | } |
| 665 | |
| 666 | -TEST(mock_ffa_api, ffa_msg_send_direct_resp) |
| 667 | +TEST(mock_ffa_api, ffa_msg_send_direct_resp_32) |
| 668 | { |
| 669 | const uint16_t source = 0x1122; |
| 670 | const uint16_t dest = 0x2233; |
| 671 | @@ -133,10 +150,27 @@ TEST(mock_ffa_api, ffa_msg_send_direct_resp) |
| 672 | const uint32_t a4 = 0x89124567; |
| 673 | struct ffa_direct_msg msg = { 0 }; |
| 674 | |
| 675 | - expect_ffa_msg_send_direct_resp(source, dest, a0, a1, a2, a3, a4, |
| 676 | + expect_ffa_msg_send_direct_resp_32(source, dest, a0, a1, a2, a3, a4, |
| 677 | &expected_msg, result); |
| 678 | - LONGS_EQUAL(result, ffa_msg_send_direct_resp(source, dest, a0, a1, a2, |
| 679 | - a3, a4, &msg)); |
| 680 | + LONGS_EQUAL(result, ffa_msg_send_direct_resp_32(source, dest, a0, a1, |
| 681 | + a2, a3, a4, &msg)); |
| 682 | +} |
| 683 | + |
| 684 | +TEST(mock_ffa_api, ffa_msg_send_direct_resp_64) |
| 685 | +{ |
| 686 | + const uint16_t source = 0x1122; |
| 687 | + const uint16_t dest = 0x2233; |
| 688 | + const uint64_t a0 = 0x4567891221987654; |
| 689 | + const uint64_t a1 = 0x5678912442198765; |
| 690 | + const uint64_t a2 = 0x6789124554219876; |
| 691 | + const uint64_t a3 = 0x7891245665421987; |
| 692 | + const uint64_t a4 = 0x8912456776542198; |
| 693 | + struct ffa_direct_msg msg = { 0 }; |
| 694 | + |
| 695 | + expect_ffa_msg_send_direct_resp_64(source, dest, a0, a1, a2, a3, a4, |
| 696 | + &expected_msg, result); |
| 697 | + LONGS_EQUAL(result, ffa_msg_send_direct_resp_64(source, dest, a0, a1, |
| 698 | + a2, a3, a4, &msg)); |
| 699 | } |
| 700 | |
| 701 | TEST(mock_ffa_api, ffa_mem_donate) |
| 702 | diff --git a/components/messaging/ffa/libsp/sp_messaging.c b/components/messaging/ffa/libsp/sp_messaging.c |
| 703 | index f7223aa..392006b 100644 |
| 704 | --- a/components/messaging/ffa/libsp/sp_messaging.c |
| 705 | +++ b/components/messaging/ffa/libsp/sp_messaging.c |
| 706 | @@ -1,6 +1,6 @@ |
| 707 | // SPDX-License-Identifier: BSD-3-Clause |
| 708 | /* |
| 709 | - * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 710 | + * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. |
| 711 | */ |
| 712 | |
| 713 | #include "ffa_api.h" |
| 714 | @@ -20,22 +20,40 @@ static void pack_ffa_direct_msg(const struct sp_msg *msg, |
| 715 | ffa_msg->source_id = msg->source_id; |
| 716 | ffa_msg->destination_id = msg->destination_id; |
| 717 | |
| 718 | - ffa_msg->args[0] = 0; |
| 719 | - memcpy(&ffa_msg->args[SP_MSG_ARG_OFFSET], msg->args, sizeof(msg->args)); |
| 720 | + ffa_msg->args.args64[0] = 0; |
| 721 | + if (msg->is_64bit_message) |
| 722 | + memcpy(&ffa_msg->args.args64[SP_MSG_ARG_OFFSET], |
| 723 | + msg->args.args64, sizeof(msg->args.args64)); |
| 724 | + else |
| 725 | + memcpy(&ffa_msg->args.args32[SP_MSG_ARG_OFFSET], |
| 726 | + msg->args.args32, sizeof(msg->args.args32)); |
| 727 | } |
| 728 | |
| 729 | static void unpack_ffa_direct_msg(const struct ffa_direct_msg *ffa_msg, |
| 730 | struct sp_msg *msg) |
| 731 | { |
| 732 | - if (ffa_msg->function_id != FFA_SUCCESS_32) { |
| 733 | + if (ffa_msg->function_id == FFA_MSG_SEND_DIRECT_REQ_32 || |
| 734 | + ffa_msg->function_id == FFA_MSG_SEND_DIRECT_RESP_32) { |
| 735 | /* |
| 736 | - * Handling request or response (error is handled before call) |
| 737 | + * Handling 32 bit request or response |
| 738 | */ |
| 739 | msg->source_id = ffa_msg->source_id; |
| 740 | msg->destination_id = ffa_msg->destination_id; |
| 741 | + msg->is_64bit_message = FFA_IS_64_BIT_FUNC(ffa_msg->function_id); |
| 742 | |
| 743 | - memcpy(msg->args, &ffa_msg->args[SP_MSG_ARG_OFFSET], |
| 744 | - sizeof(msg->args)); |
| 745 | + memcpy(msg->args.args32, &ffa_msg->args.args32[SP_MSG_ARG_OFFSET], |
| 746 | + sizeof(msg->args.args32)); |
| 747 | + } else if (ffa_msg->function_id == FFA_MSG_SEND_DIRECT_REQ_64 || |
| 748 | + ffa_msg->function_id == FFA_MSG_SEND_DIRECT_RESP_64) { |
| 749 | + /* |
| 750 | + * Handling 64 bit request or response |
| 751 | + */ |
| 752 | + msg->source_id = ffa_msg->source_id; |
| 753 | + msg->destination_id = ffa_msg->destination_id; |
| 754 | + msg->is_64bit_message = FFA_IS_64_BIT_FUNC(ffa_msg->function_id); |
| 755 | + |
| 756 | + memcpy(msg->args.args64, &ffa_msg->args.args64[SP_MSG_ARG_OFFSET], |
| 757 | + sizeof(msg->args.args64)); |
| 758 | } else { |
| 759 | /* Success has no message parameters */ |
| 760 | *msg = (struct sp_msg){ 0 }; |
| 761 | @@ -89,11 +107,18 @@ sp_result sp_msg_send_direct_req(const struct sp_msg *req, struct sp_msg *resp) |
| 762 | ffa_direct_msg_routing_ext_req_pre_hook(&ffa_req); |
| 763 | #endif |
| 764 | |
| 765 | - ffa_res = ffa_msg_send_direct_req(ffa_req.source_id, |
| 766 | - ffa_req.destination_id, |
| 767 | - ffa_req.args[0], ffa_req.args[1], |
| 768 | - ffa_req.args[2], ffa_req.args[3], |
| 769 | - ffa_req.args[4], &ffa_resp); |
| 770 | + if (req->is_64bit_message) |
| 771 | + ffa_res = ffa_msg_send_direct_req_64( |
| 772 | + ffa_req.source_id, ffa_req.destination_id, |
| 773 | + ffa_req.args.args64[0], ffa_req.args.args64[1], |
| 774 | + ffa_req.args.args64[2], ffa_req.args.args64[3], |
| 775 | + ffa_req.args.args64[4], &ffa_resp); |
| 776 | + else |
| 777 | + ffa_res = ffa_msg_send_direct_req_32( |
| 778 | + ffa_req.source_id, ffa_req.destination_id, |
| 779 | + ffa_req.args.args32[0], ffa_req.args.args32[1], |
| 780 | + ffa_req.args.args32[2], ffa_req.args.args32[3], |
| 781 | + ffa_req.args.args32[4], &ffa_resp); |
| 782 | |
| 783 | if (ffa_res != FFA_OK) { |
| 784 | #if FFA_DIRECT_MSG_ROUTING_EXTENSION |
| 785 | @@ -136,11 +161,18 @@ sp_result sp_msg_send_direct_resp(const struct sp_msg *resp, struct sp_msg *req) |
| 786 | ffa_direct_msg_routing_ext_resp_pre_hook(&ffa_resp); |
| 787 | #endif |
| 788 | |
| 789 | - ffa_res = ffa_msg_send_direct_resp(ffa_resp.source_id, |
| 790 | - ffa_resp.destination_id, |
| 791 | - ffa_resp.args[0], ffa_resp.args[1], |
| 792 | - ffa_resp.args[2], ffa_resp.args[3], |
| 793 | - ffa_resp.args[4], &ffa_req); |
| 794 | + if (resp->is_64bit_message) |
| 795 | + ffa_res = ffa_msg_send_direct_resp_64( |
| 796 | + ffa_resp.source_id, ffa_resp.destination_id, |
| 797 | + ffa_resp.args.args64[0], ffa_resp.args.args64[1], |
| 798 | + ffa_resp.args.args64[2], ffa_resp.args.args64[3], |
| 799 | + ffa_resp.args.args64[4], &ffa_req); |
| 800 | + else |
| 801 | + ffa_res = ffa_msg_send_direct_resp_32( |
| 802 | + ffa_resp.source_id, ffa_resp.destination_id, |
| 803 | + ffa_resp.args.args32[0], ffa_resp.args.args32[1], |
| 804 | + ffa_resp.args.args32[2], ffa_resp.args.args32[3], |
| 805 | + ffa_resp.args.args32[4], &ffa_req); |
| 806 | |
| 807 | if (ffa_res != FFA_OK) { |
| 808 | #if FFA_DIRECT_MSG_ROUTING_EXTENSION |
| 809 | @@ -182,11 +214,11 @@ sp_result sp_msg_send_rc_req(const struct sp_msg *req, struct sp_msg *resp) |
| 810 | |
| 811 | ffa_direct_msg_routing_ext_rc_req_pre_hook(&ffa_req); |
| 812 | |
| 813 | - ffa_res = ffa_msg_send_direct_resp(ffa_req.source_id, |
| 814 | + ffa_res = ffa_msg_send_direct_resp_32(ffa_req.source_id, |
| 815 | ffa_req.destination_id, |
| 816 | - ffa_req.args[0], ffa_req.args[1], |
| 817 | - ffa_req.args[2], ffa_req.args[3], |
| 818 | - ffa_req.args[4], &ffa_resp); |
| 819 | + ffa_req.args.args32[0], ffa_req.args.args32[1], |
| 820 | + ffa_req.args.args32[2], ffa_req.args.args32[3], |
| 821 | + ffa_req.args.args32[4], &ffa_resp); |
| 822 | |
| 823 | if (ffa_res != FFA_OK) { |
| 824 | ffa_direct_msg_routing_ext_rc_req_error_hook(); |
| 825 | diff --git a/components/messaging/ffa/libsp/test/test_ffa_api.cpp b/components/messaging/ffa/libsp/test/test_ffa_api.cpp |
| 826 | index 8fa261e..6cca085 100644 |
| 827 | --- a/components/messaging/ffa/libsp/test/test_ffa_api.cpp |
| 828 | +++ b/components/messaging/ffa/libsp/test/test_ffa_api.cpp |
| 829 | @@ -43,20 +43,35 @@ TEST_GROUP(ffa_api) |
| 830 | svc_result.a2 = (uint32_t)error_code; |
| 831 | } |
| 832 | |
| 833 | - void msg_equal(uint32_t func_id, uint16_t source_id, uint16_t dest_id, |
| 834 | - uint32_t arg0, uint32_t arg1, uint32_t arg2, |
| 835 | - uint32_t arg3, uint32_t arg4) |
| 836 | + void msg_equal_32(uint32_t func_id, uint16_t source_id, uint16_t dest_id, |
| 837 | + uint32_t arg0, uint32_t arg1, uint32_t arg2, |
| 838 | + uint32_t arg3, uint32_t arg4) |
| 839 | { |
| 840 | UNSIGNED_LONGS_EQUAL(func_id, msg.function_id); |
| 841 | UNSIGNED_LONGS_EQUAL(source_id, msg.source_id); |
| 842 | UNSIGNED_LONGS_EQUAL(dest_id, msg.destination_id); |
| 843 | - UNSIGNED_LONGS_EQUAL(arg0, msg.args[0]); |
| 844 | - UNSIGNED_LONGS_EQUAL(arg1, msg.args[1]); |
| 845 | - UNSIGNED_LONGS_EQUAL(arg2, msg.args[2]); |
| 846 | - UNSIGNED_LONGS_EQUAL(arg3, msg.args[3]); |
| 847 | - UNSIGNED_LONGS_EQUAL(arg4, msg.args[4]); |
| 848 | + UNSIGNED_LONGS_EQUAL(arg0, msg.args.args32[0]); |
| 849 | + UNSIGNED_LONGS_EQUAL(arg1, msg.args.args32[1]); |
| 850 | + UNSIGNED_LONGS_EQUAL(arg2, msg.args.args32[2]); |
| 851 | + UNSIGNED_LONGS_EQUAL(arg3, msg.args.args32[3]); |
| 852 | + UNSIGNED_LONGS_EQUAL(arg4, msg.args.args32[4]); |
| 853 | } |
| 854 | |
| 855 | + void msg_equal_64(uint32_t func_id, uint16_t source_id, uint16_t dest_id, |
| 856 | + uint64_t arg0, uint64_t arg1, uint64_t arg2, |
| 857 | + uint64_t arg3, uint64_t arg4) |
| 858 | + { |
| 859 | + UNSIGNED_LONGS_EQUAL(func_id, msg.function_id); |
| 860 | + UNSIGNED_LONGS_EQUAL(source_id, msg.source_id); |
| 861 | + UNSIGNED_LONGS_EQUAL(dest_id, msg.destination_id); |
| 862 | + UNSIGNED_LONGLONGS_EQUAL(arg0, msg.args.args64[0]); |
| 863 | + UNSIGNED_LONGLONGS_EQUAL(arg1, msg.args.args64[1]); |
| 864 | + UNSIGNED_LONGLONGS_EQUAL(arg2, msg.args.args64[2]); |
| 865 | + UNSIGNED_LONGLONGS_EQUAL(arg3, msg.args.args64[3]); |
| 866 | + UNSIGNED_LONGLONGS_EQUAL(arg4, msg.args.args64[4]); |
| 867 | + } |
| 868 | + |
| 869 | + |
| 870 | struct ffa_params svc_result; |
| 871 | struct ffa_direct_msg msg; |
| 872 | }; |
| 873 | @@ -360,7 +375,7 @@ TEST(ffa_api, ffa_msg_wait_success) |
| 874 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 875 | ffa_result result = ffa_msg_wait(&msg); |
| 876 | LONGS_EQUAL(0, result); |
| 877 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 878 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 879 | } |
| 880 | |
| 881 | TEST(ffa_api, ffa_msg_wait_error) |
| 882 | @@ -369,10 +384,10 @@ TEST(ffa_api, ffa_msg_wait_error) |
| 883 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 884 | ffa_result result = ffa_msg_wait(&msg); |
| 885 | LONGS_EQUAL(-1, result); |
| 886 | - msg_equal(0, 0, 0, 0, 0, 0, 0, 0); |
| 887 | + msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0); |
| 888 | } |
| 889 | |
| 890 | -TEST(ffa_api, ffa_msg_wait_direct_req) |
| 891 | +TEST(ffa_api, ffa_msg_wait_direct_req_32) |
| 892 | { |
| 893 | const uint16_t source_id = 0x1122; |
| 894 | const uint16_t dest_id = 0x3344; |
| 895 | @@ -392,7 +407,31 @@ TEST(ffa_api, ffa_msg_wait_direct_req) |
| 896 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 897 | ffa_result result = ffa_msg_wait(&msg); |
| 898 | LONGS_EQUAL(0, result); |
| 899 | - msg_equal(0x8400006F, source_id, dest_id, arg0, arg1, arg2, arg3, |
| 900 | + msg_equal_32(0x8400006F, source_id, dest_id, arg0, arg1, arg2, arg3, |
| 901 | + arg4); |
| 902 | +} |
| 903 | + |
| 904 | +TEST(ffa_api, ffa_msg_wait_direct_req_64) |
| 905 | +{ |
| 906 | + const uint16_t source_id = 0x1122; |
| 907 | + const uint16_t dest_id = 0x3344; |
| 908 | + const uint64_t arg0 = 0x0123456776543210ULL; |
| 909 | + const uint64_t arg1 = 0x1234567887654321ULL; |
| 910 | + const uint64_t arg2 = 0x2345678998765432ULL; |
| 911 | + const uint64_t arg3 = 0x3456789aa9876543ULL; |
| 912 | + const uint64_t arg4 = 0x456789abba987654ULL; |
| 913 | + |
| 914 | + svc_result.a0 = 0xC400006F; |
| 915 | + svc_result.a1 = ((uint32_t)source_id) << 16 | dest_id; |
| 916 | + svc_result.a3 = arg0; |
| 917 | + svc_result.a4 = arg1; |
| 918 | + svc_result.a5 = arg2; |
| 919 | + svc_result.a6 = arg3; |
| 920 | + svc_result.a7 = arg4; |
| 921 | + expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 922 | + ffa_result result = ffa_msg_wait(&msg); |
| 923 | + LONGS_EQUAL(0, result); |
| 924 | + msg_equal_64(0xC400006F, source_id, dest_id, arg0, arg1, arg2, arg3, |
| 925 | arg4); |
| 926 | } |
| 927 | |
| 928 | @@ -410,7 +449,7 @@ TEST(ffa_api, ffa_msg_wait_one_interrupt_success) |
| 929 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 930 | ffa_result result = ffa_msg_wait(&msg); |
| 931 | LONGS_EQUAL(0, result); |
| 932 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 933 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 934 | } |
| 935 | |
| 936 | TEST(ffa_api, ffa_msg_wait_two_interrupt_success) |
| 937 | @@ -434,7 +473,7 @@ TEST(ffa_api, ffa_msg_wait_two_interrupt_success) |
| 938 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 939 | ffa_result result = ffa_msg_wait(&msg); |
| 940 | LONGS_EQUAL(0, result); |
| 941 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 942 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 943 | } |
| 944 | |
| 945 | TEST(ffa_api, ffa_msg_wait_unknown_response) |
| 946 | @@ -448,7 +487,7 @@ TEST(ffa_api, ffa_msg_wait_unknown_response) |
| 947 | } |
| 948 | } |
| 949 | |
| 950 | -TEST(ffa_api, ffa_msg_send_direct_req_success) |
| 951 | +TEST(ffa_api, ffa_msg_send_direct_req_32_success) |
| 952 | { |
| 953 | const uint16_t source_id = 0x1122; |
| 954 | const uint16_t dest_id = 0x3344; |
| 955 | @@ -461,13 +500,13 @@ TEST(ffa_api, ffa_msg_send_direct_req_success) |
| 956 | svc_result.a0 = 0x84000061; |
| 957 | expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 958 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 959 | - ffa_result result = ffa_msg_send_direct_req( |
| 960 | + ffa_result result = ffa_msg_send_direct_req_32( |
| 961 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 962 | LONGS_EQUAL(0, result); |
| 963 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 964 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 965 | } |
| 966 | |
| 967 | -TEST(ffa_api, ffa_msg_send_direct_req_error) |
| 968 | +TEST(ffa_api, ffa_msg_send_direct_req_32_error) |
| 969 | { |
| 970 | const uint16_t source_id = 0x1122; |
| 971 | const uint16_t dest_id = 0x3344; |
| 972 | @@ -480,13 +519,48 @@ TEST(ffa_api, ffa_msg_send_direct_req_error) |
| 973 | setup_error_response(-1); |
| 974 | expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 975 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 976 | - ffa_result result = ffa_msg_send_direct_req( |
| 977 | + ffa_result result = ffa_msg_send_direct_req_32( |
| 978 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 979 | LONGS_EQUAL(-1, result); |
| 980 | - msg_equal(0, 0, 0, 0, 0, 0, 0, 0); |
| 981 | + msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0); |
| 982 | +} |
| 983 | + |
| 984 | +TEST(ffa_api, ffa_msg_send_direct_req_32_get_resp_64) |
| 985 | +{ |
| 986 | + const uint16_t source_id = 0x1122; |
| 987 | + const uint16_t dest_id = 0x3344; |
| 988 | + const uint32_t arg0 = 0x01234567ULL; |
| 989 | + const uint32_t arg1 = 0x12345678ULL; |
| 990 | + const uint32_t arg2 = 0x23456789ULL; |
| 991 | + const uint32_t arg3 = 0x3456789aULL; |
| 992 | + const uint32_t arg4 = 0x456789abULL; |
| 993 | + const uint16_t resp_source_id = 0x1221; |
| 994 | + const uint16_t resp_dest_id = 0x3443; |
| 995 | + const uint64_t resp_arg0 = 0x9012345665432109ULL; |
| 996 | + const uint64_t resp_arg1 = 0xa12345677654321aULL; |
| 997 | + const uint64_t resp_arg2 = 0xb23456788765432bULL; |
| 998 | + const uint64_t resp_arg3 = 0xc34567899876543cULL; |
| 999 | + const uint64_t resp_arg4 = 0xd456789aa987654dULL; |
| 1000 | + assert_environment_t assert_env; |
| 1001 | + |
| 1002 | + svc_result.a0 = 0xC4000070; |
| 1003 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1004 | + svc_result.a3 = resp_arg0; |
| 1005 | + svc_result.a4 = resp_arg1; |
| 1006 | + svc_result.a5 = resp_arg2; |
| 1007 | + svc_result.a6 = resp_arg3; |
| 1008 | + svc_result.a7 = resp_arg4; |
| 1009 | + |
| 1010 | + expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1011 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1012 | + |
| 1013 | + if (SETUP_ASSERT_ENVIRONMENT(assert_env)) { |
| 1014 | + ffa_msg_send_direct_req_32(source_id, dest_id, arg0, arg1, arg2, |
| 1015 | + arg3, arg4, &msg); |
| 1016 | + } |
| 1017 | } |
| 1018 | |
| 1019 | -TEST(ffa_api, ffa_msg_send_direct_req_direct_resp) |
| 1020 | +TEST(ffa_api, ffa_msg_send_direct_req_32_direct_resp) |
| 1021 | { |
| 1022 | const uint16_t source_id = 0x1122; |
| 1023 | const uint16_t dest_id = 0x3344; |
| 1024 | @@ -512,14 +586,82 @@ TEST(ffa_api, ffa_msg_send_direct_req_direct_resp) |
| 1025 | svc_result.a7 = resp_arg4; |
| 1026 | expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1027 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1028 | - ffa_result result = ffa_msg_send_direct_req( |
| 1029 | + ffa_result result = ffa_msg_send_direct_req_32( |
| 1030 | + source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1031 | + LONGS_EQUAL(0, result); |
| 1032 | + msg_equal_32(0x84000070, resp_source_id, resp_dest_id, resp_arg0, |
| 1033 | + resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1034 | +} |
| 1035 | + |
| 1036 | +TEST(ffa_api, ffa_msg_send_direct_req_64_success) |
| 1037 | +{ |
| 1038 | + const uint16_t source_id = 0x1122; |
| 1039 | + const uint16_t dest_id = 0x3344; |
| 1040 | + const uint64_t arg0 = 0x0123456776543210ULL; |
| 1041 | + const uint64_t arg1 = 0x1234567887654321ULL; |
| 1042 | + const uint64_t arg2 = 0x2345678998765432ULL; |
| 1043 | + const uint64_t arg3 = 0x3456789aa9876543ULL; |
| 1044 | + const uint64_t arg4 = 0x456789abba987654ULL; |
| 1045 | + const uint16_t resp_source_id = 0x1221; |
| 1046 | + const uint16_t resp_dest_id = 0x3443; |
| 1047 | + const uint64_t resp_arg0 = 0x9012345665432109ULL; |
| 1048 | + const uint64_t resp_arg1 = 0xa12345677654321aULL; |
| 1049 | + const uint64_t resp_arg2 = 0xb23456788765432bULL; |
| 1050 | + const uint64_t resp_arg3 = 0xc34567899876543cULL; |
| 1051 | + const uint64_t resp_arg4 = 0xd456789aa987654dULL; |
| 1052 | + |
| 1053 | + svc_result.a0 = 0xC4000070; |
| 1054 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1055 | + svc_result.a3 = resp_arg0; |
| 1056 | + svc_result.a4 = resp_arg1; |
| 1057 | + svc_result.a5 = resp_arg2; |
| 1058 | + svc_result.a6 = resp_arg3; |
| 1059 | + svc_result.a7 = resp_arg4; |
| 1060 | + expect_ffa_svc(0xC400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1061 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1062 | + ffa_result result = ffa_msg_send_direct_req_64( |
| 1063 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1064 | LONGS_EQUAL(0, result); |
| 1065 | - msg_equal(0x84000070, resp_source_id, resp_dest_id, resp_arg0, |
| 1066 | + msg_equal_64(0xC4000070, resp_source_id, resp_dest_id, resp_arg0, |
| 1067 | resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1068 | } |
| 1069 | |
| 1070 | -TEST(ffa_api, ffa_msg_send_direct_req_one_interrupt_success) |
| 1071 | +TEST(ffa_api, ffa_msg_send_direct_req_64_get_resp_32) |
| 1072 | +{ |
| 1073 | + const uint16_t source_id = 0x1122; |
| 1074 | + const uint16_t dest_id = 0x3344; |
| 1075 | + const uint64_t arg0 = 0x9012345665432109ULL; |
| 1076 | + const uint64_t arg1 = 0xa12345677654321aULL; |
| 1077 | + const uint64_t arg2 = 0xb23456788765432bULL; |
| 1078 | + const uint64_t arg3 = 0xc34567899876543cULL; |
| 1079 | + const uint64_t arg4 = 0xd456789aa987654dULL; |
| 1080 | + const uint16_t resp_source_id = 0x1221; |
| 1081 | + const uint16_t resp_dest_id = 0x3443; |
| 1082 | + const uint32_t resp_arg0 = 0x01234567ULL; |
| 1083 | + const uint32_t resp_arg1 = 0x12345678ULL; |
| 1084 | + const uint32_t resp_arg2 = 0x23456789ULL; |
| 1085 | + const uint32_t resp_arg3 = 0x3456789aULL; |
| 1086 | + const uint32_t resp_arg4 = 0x456789abULL; |
| 1087 | + assert_environment_t assert_env; |
| 1088 | + |
| 1089 | + svc_result.a0 = 0x84000070; |
| 1090 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1091 | + svc_result.a3 = resp_arg0; |
| 1092 | + svc_result.a4 = resp_arg1; |
| 1093 | + svc_result.a5 = resp_arg2; |
| 1094 | + svc_result.a6 = resp_arg3; |
| 1095 | + svc_result.a7 = resp_arg4; |
| 1096 | + |
| 1097 | + expect_ffa_svc(0xC400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1098 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1099 | + |
| 1100 | + if (SETUP_ASSERT_ENVIRONMENT(assert_env)) { |
| 1101 | + ffa_msg_send_direct_req_64(source_id, dest_id, arg0, arg1, arg2, |
| 1102 | + arg3, arg4, &msg); |
| 1103 | + } |
| 1104 | +} |
| 1105 | + |
| 1106 | +TEST(ffa_api, ffa_msg_send_direct_req_32_one_interrupt_success) |
| 1107 | { |
| 1108 | const uint16_t source_id = 0x1122; |
| 1109 | const uint16_t dest_id = 0x3344; |
| 1110 | @@ -539,13 +681,13 @@ TEST(ffa_api, ffa_msg_send_direct_req_one_interrupt_success) |
| 1111 | |
| 1112 | svc_result.a0 = 0x84000061; |
| 1113 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 1114 | - ffa_result result = ffa_msg_send_direct_req( |
| 1115 | + ffa_result result = ffa_msg_send_direct_req_32( |
| 1116 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1117 | LONGS_EQUAL(0, result); |
| 1118 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1119 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1120 | } |
| 1121 | |
| 1122 | -TEST(ffa_api, ffa_msg_send_direct_req_two_interrupt_success) |
| 1123 | +TEST(ffa_api, ffa_msg_send_direct_req_32_two_interrupt_success) |
| 1124 | { |
| 1125 | const uint16_t source_id = 0x1122; |
| 1126 | const uint16_t dest_id = 0x3344; |
| 1127 | @@ -573,13 +715,13 @@ TEST(ffa_api, ffa_msg_send_direct_req_two_interrupt_success) |
| 1128 | |
| 1129 | svc_result.a0 = 0x84000061; |
| 1130 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 1131 | - ffa_result result = ffa_msg_send_direct_req( |
| 1132 | + ffa_result result = ffa_msg_send_direct_req_32( |
| 1133 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1134 | LONGS_EQUAL(0, result); |
| 1135 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1136 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1137 | } |
| 1138 | |
| 1139 | -TEST(ffa_api, ffa_msg_send_direct_req_unknown_response) |
| 1140 | +TEST(ffa_api, ffa_msg_send_direct_req_32_unknown_response) |
| 1141 | { |
| 1142 | const uint16_t source_id = 0x1122; |
| 1143 | const uint16_t dest_id = 0x3344; |
| 1144 | @@ -594,12 +736,12 @@ TEST(ffa_api, ffa_msg_send_direct_req_unknown_response) |
| 1145 | expect_ffa_svc(0x8400006F, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1146 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1147 | if (SETUP_ASSERT_ENVIRONMENT(assert_env)) { |
| 1148 | - ffa_msg_send_direct_req(source_id, dest_id, arg0, arg1, arg2, |
| 1149 | + ffa_msg_send_direct_req_32(source_id, dest_id, arg0, arg1, arg2, |
| 1150 | arg3, arg4, &msg); |
| 1151 | } |
| 1152 | } |
| 1153 | |
| 1154 | -TEST(ffa_api, ffa_msg_send_direct_resp_success) |
| 1155 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_success) |
| 1156 | { |
| 1157 | const uint16_t source_id = 0x1122; |
| 1158 | const uint16_t dest_id = 0x3344; |
| 1159 | @@ -612,13 +754,13 @@ TEST(ffa_api, ffa_msg_send_direct_resp_success) |
| 1160 | svc_result.a0 = 0x84000061; |
| 1161 | expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1162 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1163 | - ffa_result result = ffa_msg_send_direct_resp( |
| 1164 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1165 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1166 | LONGS_EQUAL(0, result); |
| 1167 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1168 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1169 | } |
| 1170 | |
| 1171 | -TEST(ffa_api, ffa_msg_send_direct_resp_error) |
| 1172 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_error) |
| 1173 | { |
| 1174 | const uint16_t source_id = 0x1122; |
| 1175 | const uint16_t dest_id = 0x3344; |
| 1176 | @@ -631,13 +773,13 @@ TEST(ffa_api, ffa_msg_send_direct_resp_error) |
| 1177 | setup_error_response(-1); |
| 1178 | expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1179 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1180 | - ffa_result result = ffa_msg_send_direct_resp( |
| 1181 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1182 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1183 | LONGS_EQUAL(-1, result); |
| 1184 | - msg_equal(0, 0, 0, 0, 0, 0, 0, 0); |
| 1185 | + msg_equal_32(0, 0, 0, 0, 0, 0, 0, 0); |
| 1186 | } |
| 1187 | |
| 1188 | -TEST(ffa_api, ffa_msg_send_direct_resp_then_get_direct_req_as_response) |
| 1189 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_then_get_direct_req_32_as_response) |
| 1190 | { |
| 1191 | const uint16_t source_id = 0x1122; |
| 1192 | const uint16_t dest_id = 0x3344; |
| 1193 | @@ -663,14 +805,113 @@ TEST(ffa_api, ffa_msg_send_direct_resp_then_get_direct_req_as_response) |
| 1194 | svc_result.a7 = resp_arg4; |
| 1195 | expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1196 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1197 | - ffa_result result = ffa_msg_send_direct_resp( |
| 1198 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1199 | + source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1200 | + LONGS_EQUAL(0, result); |
| 1201 | + msg_equal_32(0x8400006F, resp_source_id, resp_dest_id, resp_arg0, |
| 1202 | + resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1203 | +} |
| 1204 | + |
| 1205 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_then_get_direct_req_64_as_response) |
| 1206 | +{ |
| 1207 | + const uint16_t source_id = 0x1122; |
| 1208 | + const uint16_t dest_id = 0x3344; |
| 1209 | + const uint32_t arg0 = 0x01234567ULL; |
| 1210 | + const uint32_t arg1 = 0x12345678ULL; |
| 1211 | + const uint32_t arg2 = 0x23456789ULL; |
| 1212 | + const uint32_t arg3 = 0x3456789aULL; |
| 1213 | + const uint32_t arg4 = 0x456789abULL; |
| 1214 | + const uint16_t resp_source_id = 0x1221; |
| 1215 | + const uint16_t resp_dest_id = 0x3443; |
| 1216 | + const uint64_t resp_arg0 = 0x9012345665432109ULL; |
| 1217 | + const uint64_t resp_arg1 = 0xa12345677654321aULL; |
| 1218 | + const uint64_t resp_arg2 = 0xb23456788765432bULL; |
| 1219 | + const uint64_t resp_arg3 = 0xc34567899876543cULL; |
| 1220 | + const uint64_t resp_arg4 = 0xd456789aa987654dULL; |
| 1221 | + |
| 1222 | + svc_result.a0 = 0xC400006F; |
| 1223 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1224 | + svc_result.a3 = resp_arg0; |
| 1225 | + svc_result.a4 = resp_arg1; |
| 1226 | + svc_result.a5 = resp_arg2; |
| 1227 | + svc_result.a6 = resp_arg3; |
| 1228 | + svc_result.a7 = resp_arg4; |
| 1229 | + expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1230 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1231 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1232 | + source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1233 | + LONGS_EQUAL(0, result); |
| 1234 | + msg_equal_64(0xC400006F, resp_source_id, resp_dest_id, resp_arg0, |
| 1235 | + resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1236 | +} |
| 1237 | + |
| 1238 | +TEST(ffa_api, ffa_msg_send_direct_resp_64_then_get_direct_req_32_as_response) |
| 1239 | +{ |
| 1240 | + const uint16_t source_id = 0x1122; |
| 1241 | + const uint16_t dest_id = 0x3344; |
| 1242 | + const uint64_t arg0 = 0x9012345665432109ULL; |
| 1243 | + const uint64_t arg1 = 0xa12345677654321aULL; |
| 1244 | + const uint64_t arg2 = 0xb23456788765432bULL; |
| 1245 | + const uint64_t arg3 = 0xc34567899876543cULL; |
| 1246 | + const uint64_t arg4 = 0xd456789aa987654dULL; |
| 1247 | + const uint16_t resp_source_id = 0x1221; |
| 1248 | + const uint16_t resp_dest_id = 0x3443; |
| 1249 | + const uint32_t resp_arg0 = 0x01234567ULL; |
| 1250 | + const uint32_t resp_arg1 = 0x12345678ULL; |
| 1251 | + const uint32_t resp_arg2 = 0x23456789ULL; |
| 1252 | + const uint32_t resp_arg3 = 0x3456789aULL; |
| 1253 | + const uint32_t resp_arg4 = 0x456789abULL; |
| 1254 | + |
| 1255 | + svc_result.a0 = 0x8400006F; |
| 1256 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1257 | + svc_result.a3 = resp_arg0; |
| 1258 | + svc_result.a4 = resp_arg1; |
| 1259 | + svc_result.a5 = resp_arg2; |
| 1260 | + svc_result.a6 = resp_arg3; |
| 1261 | + svc_result.a7 = resp_arg4; |
| 1262 | + expect_ffa_svc(0xC4000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1263 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1264 | + ffa_result result = ffa_msg_send_direct_resp_64( |
| 1265 | + source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1266 | + LONGS_EQUAL(0, result); |
| 1267 | + msg_equal_32(0x8400006F, resp_source_id, resp_dest_id, resp_arg0, |
| 1268 | + resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1269 | +} |
| 1270 | + |
| 1271 | +TEST(ffa_api, ffa_msg_send_direct_resp_64_then_get_direct_req_64_as_response) |
| 1272 | +{ |
| 1273 | + const uint16_t source_id = 0x1122; |
| 1274 | + const uint16_t dest_id = 0x3344; |
| 1275 | + const uint64_t arg0 = 0x0123456776543210ULL; |
| 1276 | + const uint64_t arg1 = 0x1234567887654321ULL; |
| 1277 | + const uint64_t arg2 = 0x2345678998765432ULL; |
| 1278 | + const uint64_t arg3 = 0x3456789aa9876543ULL; |
| 1279 | + const uint64_t arg4 = 0x456789abba987654ULL; |
| 1280 | + const uint16_t resp_source_id = 0x1221; |
| 1281 | + const uint16_t resp_dest_id = 0x3443; |
| 1282 | + const uint64_t resp_arg0 = 0x9012345665432109ULL; |
| 1283 | + const uint64_t resp_arg1 = 0xa12345677654321aULL; |
| 1284 | + const uint64_t resp_arg2 = 0xb23456788765432bULL; |
| 1285 | + const uint64_t resp_arg3 = 0xc34567899876543cULL; |
| 1286 | + const uint64_t resp_arg4 = 0xd456789aa987654dULL; |
| 1287 | + |
| 1288 | + svc_result.a0 = 0xC400006F; |
| 1289 | + svc_result.a1 = ((uint32_t)resp_source_id) << 16 | resp_dest_id; |
| 1290 | + svc_result.a3 = resp_arg0; |
| 1291 | + svc_result.a4 = resp_arg1; |
| 1292 | + svc_result.a5 = resp_arg2; |
| 1293 | + svc_result.a6 = resp_arg3; |
| 1294 | + svc_result.a7 = resp_arg4; |
| 1295 | + expect_ffa_svc(0xC4000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1296 | + arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1297 | + ffa_result result = ffa_msg_send_direct_resp_64( |
| 1298 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1299 | LONGS_EQUAL(0, result); |
| 1300 | - msg_equal(0x8400006F, resp_source_id, resp_dest_id, resp_arg0, |
| 1301 | + msg_equal_64(0xC400006F, resp_source_id, resp_dest_id, resp_arg0, |
| 1302 | resp_arg1, resp_arg2, resp_arg3, resp_arg4); |
| 1303 | } |
| 1304 | |
| 1305 | -TEST(ffa_api, ffa_msg_send_direct_resp_one_interrupt_success) |
| 1306 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_one_interrupt_success) |
| 1307 | { |
| 1308 | const uint16_t source_id = 0x1122; |
| 1309 | const uint16_t dest_id = 0x3344; |
| 1310 | @@ -690,13 +931,13 @@ TEST(ffa_api, ffa_msg_send_direct_resp_one_interrupt_success) |
| 1311 | |
| 1312 | svc_result.a0 = 0x84000061; |
| 1313 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 1314 | - ffa_result result = ffa_msg_send_direct_resp( |
| 1315 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1316 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1317 | LONGS_EQUAL(0, result); |
| 1318 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1319 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1320 | } |
| 1321 | |
| 1322 | -TEST(ffa_api, ffa_msg_send_direct_resp_two_interrupt_success) |
| 1323 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_two_interrupt_success) |
| 1324 | { |
| 1325 | const uint16_t source_id = 0x1122; |
| 1326 | const uint16_t dest_id = 0x3344; |
| 1327 | @@ -724,13 +965,13 @@ TEST(ffa_api, ffa_msg_send_direct_resp_two_interrupt_success) |
| 1328 | |
| 1329 | svc_result.a0 = 0x84000061; |
| 1330 | expect_ffa_svc(0x8400006B, 0, 0, 0, 0, 0, 0, 0, &svc_result); |
| 1331 | - ffa_result result = ffa_msg_send_direct_resp( |
| 1332 | + ffa_result result = ffa_msg_send_direct_resp_32( |
| 1333 | source_id, dest_id, arg0, arg1, arg2, arg3, arg4, &msg); |
| 1334 | LONGS_EQUAL(0, result); |
| 1335 | - msg_equal(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1336 | + msg_equal_32(0x84000061, 0, 0, 0, 0, 0, 0, 0); |
| 1337 | } |
| 1338 | |
| 1339 | -TEST(ffa_api, ffa_msg_send_direct_resp_unknown_response) |
| 1340 | +TEST(ffa_api, ffa_msg_send_direct_resp_32_unknown_response) |
| 1341 | { |
| 1342 | const uint16_t source_id = 0x1122; |
| 1343 | const uint16_t dest_id = 0x3344; |
| 1344 | @@ -745,7 +986,7 @@ TEST(ffa_api, ffa_msg_send_direct_resp_unknown_response) |
| 1345 | expect_ffa_svc(0x84000070, ((uint32_t)source_id << 16) | dest_id, 0, |
| 1346 | arg0, arg1, arg2, arg3, arg4, &svc_result); |
| 1347 | if (SETUP_ASSERT_ENVIRONMENT(assert_env)) { |
| 1348 | - ffa_msg_send_direct_resp(source_id, dest_id, arg0, arg1, arg2, |
| 1349 | + ffa_msg_send_direct_resp_32(source_id, dest_id, arg0, arg1, arg2, |
| 1350 | arg3, arg4, &msg); |
| 1351 | } |
| 1352 | } |
| 1353 | diff --git a/components/messaging/ffa/libsp/test/test_sp_messaging.cpp b/components/messaging/ffa/libsp/test/test_sp_messaging.cpp |
| 1354 | index 78bf8bf..786f66e 100644 |
| 1355 | --- a/components/messaging/ffa/libsp/test/test_sp_messaging.cpp |
| 1356 | +++ b/components/messaging/ffa/libsp/test/test_sp_messaging.cpp |
| 1357 | @@ -1,6 +1,6 @@ |
| 1358 | // SPDX-License-Identifier: BSD-3-Clause |
| 1359 | /* |
| 1360 | - * Copyright (c) 2021, Arm Limited. All rights reserved. |
| 1361 | + * Copyright (c) 2021-2022, Arm Limited. All rights reserved. |
| 1362 | */ |
| 1363 | |
| 1364 | #include <CppUTest/TestHarness.h> |
| 1365 | @@ -32,7 +32,7 @@ TEST_GROUP(sp_messaging) |
| 1366 | mock().clear(); |
| 1367 | } |
| 1368 | |
| 1369 | - void copy_sp_to_ffa_args(const uint32_t sp_args[], uint32_t ffa_args[]) |
| 1370 | + void copy_sp_to_ffa_args_32(const uint32_t sp_args[], uint32_t ffa_args[]) |
| 1371 | { |
| 1372 | int i = 0; |
| 1373 | |
| 1374 | @@ -41,7 +41,16 @@ TEST_GROUP(sp_messaging) |
| 1375 | } |
| 1376 | } |
| 1377 | |
| 1378 | - void fill_ffa_msg(struct ffa_direct_msg * msg) |
| 1379 | + void copy_sp_to_ffa_args_64(const uint64_t sp_args[], uint64_t ffa_args[]) |
| 1380 | + { |
| 1381 | + int i = 0; |
| 1382 | + |
| 1383 | + for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1384 | + ffa_args[i + SP_MSG_ARG_OFFSET] = sp_args[i]; |
| 1385 | + } |
| 1386 | + } |
| 1387 | + |
| 1388 | + void fill_ffa_msg_32(struct ffa_direct_msg * msg) |
| 1389 | { |
| 1390 | int i = 0; |
| 1391 | |
| 1392 | @@ -49,20 +58,47 @@ TEST_GROUP(sp_messaging) |
| 1393 | msg->source_id = source_id; |
| 1394 | msg->destination_id = dest_id; |
| 1395 | |
| 1396 | - msg->args[0] = 0; |
| 1397 | + msg->args.args32[0] = 0; |
| 1398 | for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1399 | - msg->args[i + SP_MSG_ARG_OFFSET] = args[i]; |
| 1400 | + msg->args.args32[i + SP_MSG_ARG_OFFSET] = args32[i]; |
| 1401 | } |
| 1402 | } |
| 1403 | |
| 1404 | - void fill_sp_msg(struct sp_msg * msg) |
| 1405 | + void fill_ffa_msg_64(struct ffa_direct_msg * msg) |
| 1406 | { |
| 1407 | int i = 0; |
| 1408 | |
| 1409 | + msg->function_id = FFA_MSG_SEND_DIRECT_REQ_64; |
| 1410 | msg->source_id = source_id; |
| 1411 | msg->destination_id = dest_id; |
| 1412 | + |
| 1413 | + msg->args.args64[0] = 0; |
| 1414 | for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1415 | - msg->args[i] = args[i + SP_MSG_ARG_OFFSET]; |
| 1416 | + msg->args.args64[i + SP_MSG_ARG_OFFSET] = args64[i]; |
| 1417 | + } |
| 1418 | + } |
| 1419 | + |
| 1420 | + void fill_sp_msg_32(struct sp_msg * msg) |
| 1421 | + { |
| 1422 | + int i = 0; |
| 1423 | + |
| 1424 | + msg->source_id = source_id; |
| 1425 | + msg->destination_id = dest_id; |
| 1426 | + msg->is_64bit_message = false; |
| 1427 | + for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1428 | + msg->args.args32[i] = args32[i + SP_MSG_ARG_OFFSET]; |
| 1429 | + } |
| 1430 | + } |
| 1431 | + |
| 1432 | + void fill_sp_msg_64(struct sp_msg * msg) |
| 1433 | + { |
| 1434 | + int i = 0; |
| 1435 | + |
| 1436 | + msg->source_id = source_id; |
| 1437 | + msg->destination_id = dest_id; |
| 1438 | + msg->is_64bit_message = true; |
| 1439 | + for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1440 | + msg->args.args64[i] = args64[i + SP_MSG_ARG_OFFSET]; |
| 1441 | } |
| 1442 | } |
| 1443 | |
| 1444 | @@ -74,10 +110,19 @@ TEST_GROUP(sp_messaging) |
| 1445 | UNSIGNED_LONGS_EQUAL(ffa_msg->source_id, sp_msg->source_id); |
| 1446 | UNSIGNED_LONGS_EQUAL(ffa_msg->destination_id, |
| 1447 | sp_msg->destination_id); |
| 1448 | - for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1449 | - UNSIGNED_LONGS_EQUAL( |
| 1450 | - ffa_msg->args[i + SP_MSG_ARG_OFFSET], |
| 1451 | - sp_msg->args[i]); |
| 1452 | + CHECK_EQUAL(FFA_IS_64_BIT_FUNC(ffa_msg->function_id), sp_msg->is_64bit_message); |
| 1453 | + if (sp_msg->is_64bit_message) { |
| 1454 | + for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1455 | + UNSIGNED_LONGS_EQUAL( |
| 1456 | + ffa_msg->args.args64[i + SP_MSG_ARG_OFFSET], |
| 1457 | + sp_msg->args.args64[i]); |
| 1458 | + } |
| 1459 | + } else { |
| 1460 | + for (i = 0; i < SP_MSG_ARG_COUNT; i++) { |
| 1461 | + UNSIGNED_LONGS_EQUAL( |
| 1462 | + ffa_msg->args.args32[i + SP_MSG_ARG_OFFSET], |
| 1463 | + sp_msg->args.args32[i]); |
| 1464 | + } |
| 1465 | } |
| 1466 | } |
| 1467 | |
| 1468 | @@ -87,7 +132,7 @@ TEST_GROUP(sp_messaging) |
| 1469 | struct ffa_direct_msg expected_ffa_req = { 0 }; |
| 1470 | struct sp_msg req = { 0 }; |
| 1471 | |
| 1472 | - fill_ffa_msg(&expected_ffa_req); |
| 1473 | + fill_ffa_msg_32(&expected_ffa_req); |
| 1474 | expected_ffa_req.source_id = source_id; |
| 1475 | expected_ffa_req.destination_id = dest_id; |
| 1476 | expect_ffa_msg_wait(&expected_ffa_req, FFA_OK); |
| 1477 | @@ -103,8 +148,10 @@ TEST_GROUP(sp_messaging) |
| 1478 | |
| 1479 | const uint16_t source_id = 0x1234; |
| 1480 | const uint16_t dest_id = 0x5678; |
| 1481 | - const uint32_t args[SP_MSG_ARG_COUNT] = { 0x01234567, 0x12345678, |
| 1482 | - 0x23456789, 0x3456789a }; |
| 1483 | + const uint32_t args32[SP_MSG_ARG_COUNT] = { 0x01234567, 0x12345678, |
| 1484 | + 0x23456789, 0x3456789a }; |
| 1485 | + const uint64_t args64[SP_MSG_ARG_COUNT] = { 0x0123456776543210, 0x1234567887654321, |
| 1486 | + 0x2345678998765432, 0x3456789aa9876543 }; |
| 1487 | const sp_result result = -1; |
| 1488 | const sp_msg empty_sp_msg = (const sp_msg){ 0 }; |
| 1489 | }; |
| 1490 | @@ -126,7 +173,7 @@ TEST(sp_messaging, sp_msg_wait_ffa_error) |
| 1491 | |
| 1492 | TEST(sp_messaging, sp_msg_wait) |
| 1493 | { |
| 1494 | - fill_ffa_msg(&ffa_msg); |
| 1495 | + fill_ffa_msg_32(&ffa_msg); |
| 1496 | expect_ffa_msg_wait(&ffa_msg, FFA_OK); |
| 1497 | |
| 1498 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_wait(&req)); |
| 1499 | @@ -139,12 +186,12 @@ TEST(sp_messaging, sp_msg_wait_deny_rc_failure) |
| 1500 | struct ffa_direct_msg rc_msg = { 0 }; |
| 1501 | ffa_result result = FFA_ABORTED; |
| 1502 | |
| 1503 | - fill_ffa_msg(&rc_msg); |
| 1504 | - rc_msg.args[0] = ROUTING_EXT_RC_BIT; |
| 1505 | + fill_ffa_msg_32(&rc_msg); |
| 1506 | + rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1507 | expect_ffa_msg_wait(&rc_msg, FFA_OK); |
| 1508 | |
| 1509 | - fill_ffa_msg(&ffa_msg); |
| 1510 | - expect_ffa_msg_send_direct_resp( |
| 1511 | + fill_ffa_msg_32(&ffa_msg); |
| 1512 | + expect_ffa_msg_send_direct_resp_32( |
| 1513 | rc_msg.destination_id, rc_msg.source_id, |
| 1514 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 1515 | SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, result); |
| 1516 | @@ -157,12 +204,12 @@ TEST(sp_messaging, sp_msg_wait_deny_rc) |
| 1517 | { |
| 1518 | struct ffa_direct_msg rc_msg = { 0 }; |
| 1519 | |
| 1520 | - fill_ffa_msg(&rc_msg); |
| 1521 | - rc_msg.args[0] = ROUTING_EXT_RC_BIT; |
| 1522 | + fill_ffa_msg_32(&rc_msg); |
| 1523 | + rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1524 | expect_ffa_msg_wait(&rc_msg, FFA_OK); |
| 1525 | |
| 1526 | - fill_ffa_msg(&ffa_msg); |
| 1527 | - expect_ffa_msg_send_direct_resp( |
| 1528 | + fill_ffa_msg_32(&ffa_msg); |
| 1529 | + expect_ffa_msg_send_direct_resp_32( |
| 1530 | rc_msg.destination_id, rc_msg.source_id, |
| 1531 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 1532 | SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, FFA_OK); |
| 1533 | @@ -191,10 +238,10 @@ TEST(sp_messaging, sp_msg_send_direct_req_ffa_error) |
| 1534 | ffa_result result = FFA_ABORTED; |
| 1535 | uint32_t expected_ffa_args[5] = { 0 }; |
| 1536 | |
| 1537 | - fill_sp_msg(&req); |
| 1538 | + fill_sp_msg_32(&req); |
| 1539 | memset(&resp, 0x5a, sizeof(resp)); |
| 1540 | - copy_sp_to_ffa_args(req.args, expected_ffa_args); |
| 1541 | - expect_ffa_msg_send_direct_req( |
| 1542 | + copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args); |
| 1543 | + expect_ffa_msg_send_direct_req_32( |
| 1544 | req.source_id, req.destination_id, expected_ffa_args[0], |
| 1545 | expected_ffa_args[1], expected_ffa_args[2], |
| 1546 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, result); |
| 1547 | @@ -203,14 +250,30 @@ TEST(sp_messaging, sp_msg_send_direct_req_ffa_error) |
| 1548 | MEMCMP_EQUAL(&empty_sp_msg, &resp, sizeof(empty_sp_msg)); |
| 1549 | } |
| 1550 | |
| 1551 | -TEST(sp_messaging, sp_msg_send_direct_req_msg) |
| 1552 | +TEST(sp_messaging, sp_msg_send_direct_req_msg_32) |
| 1553 | { |
| 1554 | uint32_t expected_ffa_args[5] = { 0 }; |
| 1555 | |
| 1556 | - fill_sp_msg(&req); |
| 1557 | - fill_ffa_msg(&ffa_msg); |
| 1558 | - copy_sp_to_ffa_args(req.args, expected_ffa_args); |
| 1559 | - expect_ffa_msg_send_direct_req( |
| 1560 | + fill_sp_msg_32(&req); |
| 1561 | + fill_ffa_msg_32(&ffa_msg); |
| 1562 | + copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args); |
| 1563 | + expect_ffa_msg_send_direct_req_32( |
| 1564 | + req.source_id, req.destination_id, expected_ffa_args[0], |
| 1565 | + expected_ffa_args[1], expected_ffa_args[2], |
| 1566 | + expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 1567 | + |
| 1568 | + LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&req, &resp)); |
| 1569 | + ffa_and_sp_msg_equal(&ffa_msg, &resp); |
| 1570 | +} |
| 1571 | + |
| 1572 | +TEST(sp_messaging, sp_msg_send_direct_req_msg_64) |
| 1573 | +{ |
| 1574 | + uint64_t expected_ffa_args[5] = { 0 }; |
| 1575 | + |
| 1576 | + fill_sp_msg_64(&req); |
| 1577 | + fill_ffa_msg_64(&ffa_msg); |
| 1578 | + copy_sp_to_ffa_args_64(req.args.args64, expected_ffa_args); |
| 1579 | + expect_ffa_msg_send_direct_req_64( |
| 1580 | req.source_id, req.destination_id, expected_ffa_args[0], |
| 1581 | expected_ffa_args[1], expected_ffa_args[2], |
| 1582 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 1583 | @@ -223,10 +286,10 @@ TEST(sp_messaging, sp_msg_send_direct_req_success) |
| 1584 | { |
| 1585 | uint32_t expected_ffa_args[5] = { 0 }; |
| 1586 | |
| 1587 | - fill_sp_msg(&req); |
| 1588 | + fill_sp_msg_32(&req); |
| 1589 | ffa_msg.function_id = FFA_SUCCESS_32; |
| 1590 | - copy_sp_to_ffa_args(req.args, expected_ffa_args); |
| 1591 | - expect_ffa_msg_send_direct_req( |
| 1592 | + copy_sp_to_ffa_args_32(req.args.args32, expected_ffa_args); |
| 1593 | + expect_ffa_msg_send_direct_req_32( |
| 1594 | req.source_id, req.destination_id, expected_ffa_args[0], |
| 1595 | expected_ffa_args[1], expected_ffa_args[2], |
| 1596 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 1597 | @@ -248,54 +311,54 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_forwarding_success) |
| 1598 | sp_msg sp_req = { 0 }; |
| 1599 | sp_msg sp_resp = { 0 }; |
| 1600 | |
| 1601 | - fill_sp_msg(&sp_req); |
| 1602 | + fill_sp_msg_32(&sp_req); |
| 1603 | sp_req.source_id = own_id; |
| 1604 | sp_req.destination_id = rc_root_id; |
| 1605 | |
| 1606 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1607 | req.source_id = own_id; |
| 1608 | req.destination_id = rc_root_id; |
| 1609 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1610 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1611 | |
| 1612 | - fill_ffa_msg(&rc_req); |
| 1613 | + fill_ffa_msg_32(&rc_req); |
| 1614 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1615 | rc_req.source_id = rc_root_id; |
| 1616 | rc_req.destination_id = own_id; |
| 1617 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 1618 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1619 | |
| 1620 | - fill_ffa_msg(&rc_resp); |
| 1621 | + fill_ffa_msg_32(&rc_resp); |
| 1622 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1623 | rc_resp.source_id = root_id; |
| 1624 | rc_resp.destination_id = own_id; |
| 1625 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 1626 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1627 | |
| 1628 | - fill_sp_msg(&sp_resp); |
| 1629 | + fill_sp_msg_32(&sp_resp); |
| 1630 | sp_resp.source_id = rc_root_id; |
| 1631 | sp_resp.destination_id = own_id; |
| 1632 | |
| 1633 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1634 | resp.source_id = rc_root_id; |
| 1635 | resp.destination_id = own_id; |
| 1636 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 1637 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 1638 | |
| 1639 | /* Initial request to current SP to set own_id */ |
| 1640 | wait_and_receive_request(root_id, own_id); |
| 1641 | |
| 1642 | /* Sending request and receiving RC request from RC root */ |
| 1643 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 1644 | - req.args[2], req.args[3], req.args[4], |
| 1645 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 1646 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 1647 | &rc_req, FFA_OK); |
| 1648 | |
| 1649 | /* Forwarding RC request to root and receiving RC response */ |
| 1650 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 1651 | - rc_req.args[1], rc_req.args[2], |
| 1652 | - rc_req.args[3], rc_req.args[4], |
| 1653 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 1654 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 1655 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 1656 | &rc_resp, FFA_OK); |
| 1657 | |
| 1658 | /* Fowarding RC response to RC root and receiving response */ |
| 1659 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0], |
| 1660 | - rc_resp.args[1], rc_resp.args[2], |
| 1661 | - rc_resp.args[3], rc_resp.args[4], &resp, |
| 1662 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0], |
| 1663 | + rc_resp.args.args32[1], rc_resp.args.args32[2], |
| 1664 | + rc_resp.args.args32[3], rc_resp.args.args32[4], &resp, |
| 1665 | FFA_OK); |
| 1666 | |
| 1667 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp)); |
| 1668 | @@ -312,28 +375,28 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_error) |
| 1669 | sp_msg sp_req = { 0 }; |
| 1670 | sp_msg sp_resp = { 0 }; |
| 1671 | |
| 1672 | - fill_sp_msg(&sp_req); |
| 1673 | + fill_sp_msg_32(&sp_req); |
| 1674 | sp_req.source_id = own_id; |
| 1675 | sp_req.destination_id = rc_root_id; |
| 1676 | |
| 1677 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1678 | req.source_id = own_id; |
| 1679 | req.destination_id = rc_root_id; |
| 1680 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1681 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1682 | |
| 1683 | - fill_ffa_msg(&rc_err); |
| 1684 | + fill_ffa_msg_32(&rc_err); |
| 1685 | rc_err.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1686 | rc_err.source_id = rc_root_id; |
| 1687 | rc_err.destination_id = own_id; |
| 1688 | - rc_err.args[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT; |
| 1689 | - rc_err.args[1] = result; |
| 1690 | + rc_err.args.args32[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT; |
| 1691 | + rc_err.args.args32[1] = result; |
| 1692 | |
| 1693 | /* Initial request to current SP to set own_id */ |
| 1694 | wait_and_receive_request(root_id, own_id); |
| 1695 | |
| 1696 | /* Sending request and receiving RC request from RC root */ |
| 1697 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 1698 | - req.args[2], req.args[3], req.args[4], |
| 1699 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 1700 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 1701 | &rc_err, FFA_OK); |
| 1702 | |
| 1703 | LONGS_EQUAL(SP_RESULT_FFA(result), |
| 1704 | @@ -354,64 +417,64 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_forwarding_success_deny_request) |
| 1705 | sp_msg sp_req = { 0 }; |
| 1706 | sp_msg sp_resp = { 0 }; |
| 1707 | |
| 1708 | - fill_sp_msg(&sp_req); |
| 1709 | + fill_sp_msg_32(&sp_req); |
| 1710 | sp_req.source_id = own_id; |
| 1711 | sp_req.destination_id = rc_root_id; |
| 1712 | |
| 1713 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1714 | req.source_id = own_id; |
| 1715 | req.destination_id = rc_root_id; |
| 1716 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1717 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1718 | |
| 1719 | - fill_ffa_msg(&rc_req); |
| 1720 | + fill_ffa_msg_32(&rc_req); |
| 1721 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1722 | rc_req.source_id = rc_root_id; |
| 1723 | rc_req.destination_id = own_id; |
| 1724 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 1725 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1726 | |
| 1727 | request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1728 | request_to_deny.source_id = root_id; |
| 1729 | request_to_deny.destination_id = own_id; |
| 1730 | - request_to_deny.args[0] = 0; |
| 1731 | + request_to_deny.args.args32[0] = 0; |
| 1732 | |
| 1733 | - fill_ffa_msg(&rc_resp); |
| 1734 | + fill_ffa_msg_32(&rc_resp); |
| 1735 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1736 | rc_resp.source_id = root_id; |
| 1737 | rc_resp.destination_id = own_id; |
| 1738 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 1739 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1740 | |
| 1741 | - fill_sp_msg(&sp_resp); |
| 1742 | + fill_sp_msg_32(&sp_resp); |
| 1743 | sp_resp.source_id = rc_root_id; |
| 1744 | sp_resp.destination_id = own_id; |
| 1745 | |
| 1746 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1747 | resp.source_id = rc_root_id; |
| 1748 | resp.destination_id = own_id; |
| 1749 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 1750 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 1751 | |
| 1752 | /* Initial request to current SP to set own_id */ |
| 1753 | wait_and_receive_request(root_id, own_id); |
| 1754 | |
| 1755 | /* Sending request and receiving RC request from RC root */ |
| 1756 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 1757 | - req.args[2], req.args[3], req.args[4], |
| 1758 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 1759 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 1760 | &rc_req, FFA_OK); |
| 1761 | |
| 1762 | /* Forwarding RC request to root and receiving a request to deny */ |
| 1763 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 1764 | - rc_req.args[1], rc_req.args[2], |
| 1765 | - rc_req.args[3], rc_req.args[4], |
| 1766 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 1767 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 1768 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 1769 | &request_to_deny, FFA_OK); |
| 1770 | |
| 1771 | /* Sending error to root and receiving RC response */ |
| 1772 | - expect_ffa_msg_send_direct_resp( |
| 1773 | + expect_ffa_msg_send_direct_resp_32( |
| 1774 | own_id, root_id, ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 1775 | SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_OK); |
| 1776 | |
| 1777 | /* Fowarding RC response to RC root and receiving response */ |
| 1778 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0], |
| 1779 | - rc_resp.args[1], rc_resp.args[2], |
| 1780 | - rc_resp.args[3], rc_resp.args[4], &resp, |
| 1781 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0], |
| 1782 | + rc_resp.args.args32[1], rc_resp.args.args32[2], |
| 1783 | + rc_resp.args.args32[3], rc_resp.args.args32[4], &resp, |
| 1784 | FFA_OK); |
| 1785 | |
| 1786 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp)); |
| 1787 | @@ -431,65 +494,65 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_forwarding_success_invalid_req_src) |
| 1788 | sp_msg sp_req = { 0 }; |
| 1789 | sp_msg sp_resp = { 0 }; |
| 1790 | |
| 1791 | - fill_sp_msg(&sp_req); |
| 1792 | + fill_sp_msg_32(&sp_req); |
| 1793 | sp_req.source_id = own_id; |
| 1794 | sp_req.destination_id = rc_root_id; |
| 1795 | |
| 1796 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1797 | req.source_id = own_id; |
| 1798 | req.destination_id = rc_root_id; |
| 1799 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1800 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1801 | |
| 1802 | - fill_ffa_msg(&rc_req); |
| 1803 | + fill_ffa_msg_32(&rc_req); |
| 1804 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1805 | rc_req.source_id = rc_root_id; |
| 1806 | rc_req.destination_id = own_id; |
| 1807 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 1808 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1809 | |
| 1810 | request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1811 | /* This source ID should be denied in the current state. */ |
| 1812 | request_to_deny.source_id = rc_root_id; |
| 1813 | request_to_deny.destination_id = own_id; |
| 1814 | - request_to_deny.args[0] = ROUTING_EXT_RC_BIT; |
| 1815 | + request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1816 | |
| 1817 | - fill_ffa_msg(&rc_resp); |
| 1818 | + fill_ffa_msg_32(&rc_resp); |
| 1819 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1820 | rc_resp.source_id = root_id; |
| 1821 | rc_resp.destination_id = own_id; |
| 1822 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 1823 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1824 | |
| 1825 | - fill_sp_msg(&sp_resp); |
| 1826 | + fill_sp_msg_32(&sp_resp); |
| 1827 | sp_resp.source_id = rc_root_id; |
| 1828 | sp_resp.destination_id = own_id; |
| 1829 | |
| 1830 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1831 | resp.source_id = rc_root_id; |
| 1832 | resp.destination_id = own_id; |
| 1833 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 1834 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 1835 | |
| 1836 | /* Initial request to current SP to set own_id */ |
| 1837 | wait_and_receive_request(root_id, own_id); |
| 1838 | |
| 1839 | /* Sending request and receiving RC request from RC root */ |
| 1840 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 1841 | - req.args[2], req.args[3], req.args[4], |
| 1842 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 1843 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 1844 | &rc_req, FFA_OK); |
| 1845 | |
| 1846 | /* Forwarding RC request to root and receiving RC response */ |
| 1847 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 1848 | - rc_req.args[1], rc_req.args[2], |
| 1849 | - rc_req.args[3], rc_req.args[4], |
| 1850 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 1851 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 1852 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 1853 | &request_to_deny, FFA_OK); |
| 1854 | |
| 1855 | /* Sending error to root and receiving RC response */ |
| 1856 | - expect_ffa_msg_send_direct_resp( |
| 1857 | + expect_ffa_msg_send_direct_resp_32( |
| 1858 | own_id, rc_root_id, ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT, |
| 1859 | SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_OK); |
| 1860 | |
| 1861 | /* Fowarding RC response to RC root and receiving response */ |
| 1862 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0], |
| 1863 | - rc_resp.args[1], rc_resp.args[2], |
| 1864 | - rc_resp.args[3], rc_resp.args[4], &resp, |
| 1865 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0], |
| 1866 | + rc_resp.args.args32[1], rc_resp.args.args32[2], |
| 1867 | + rc_resp.args.args32[3], rc_resp.args.args32[4], &resp, |
| 1868 | FFA_OK); |
| 1869 | |
| 1870 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp)); |
| 1871 | @@ -509,58 +572,58 @@ TEST(sp_messaging, sp_msg_send_direct_req_deny_fail_wait_success) |
| 1872 | sp_msg sp_req = { 0 }; |
| 1873 | sp_msg sp_resp = { 0 }; |
| 1874 | |
| 1875 | - fill_sp_msg(&sp_req); |
| 1876 | + fill_sp_msg_32(&sp_req); |
| 1877 | sp_req.source_id = own_id; |
| 1878 | sp_req.destination_id = rc_root_id; |
| 1879 | |
| 1880 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1881 | req.source_id = own_id; |
| 1882 | req.destination_id = rc_root_id; |
| 1883 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1884 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1885 | |
| 1886 | - fill_ffa_msg(&rc_req); |
| 1887 | + fill_ffa_msg_32(&rc_req); |
| 1888 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1889 | rc_req.source_id = rc_root_id; |
| 1890 | rc_req.destination_id = own_id; |
| 1891 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 1892 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1893 | |
| 1894 | request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1895 | /* This source ID should be denied in the current state. */ |
| 1896 | request_to_deny.source_id = rc_root_id; |
| 1897 | request_to_deny.destination_id = own_id; |
| 1898 | - request_to_deny.args[0] = ROUTING_EXT_RC_BIT; |
| 1899 | + request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1900 | |
| 1901 | - fill_ffa_msg(&rc_resp); |
| 1902 | + fill_ffa_msg_32(&rc_resp); |
| 1903 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1904 | rc_resp.source_id = root_id; |
| 1905 | rc_resp.destination_id = own_id; |
| 1906 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 1907 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1908 | |
| 1909 | - fill_sp_msg(&sp_resp); |
| 1910 | + fill_sp_msg_32(&sp_resp); |
| 1911 | sp_resp.source_id = rc_root_id; |
| 1912 | sp_resp.destination_id = own_id; |
| 1913 | |
| 1914 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1915 | resp.source_id = rc_root_id; |
| 1916 | resp.destination_id = own_id; |
| 1917 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 1918 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 1919 | |
| 1920 | /* Initial request to current SP to set own_id */ |
| 1921 | wait_and_receive_request(root_id, own_id); |
| 1922 | |
| 1923 | /* Sending request and receiving RC request from RC root */ |
| 1924 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 1925 | - req.args[2], req.args[3], req.args[4], |
| 1926 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 1927 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 1928 | &rc_req, FFA_OK); |
| 1929 | |
| 1930 | /* Forwarding RC request to root and receiving RC response */ |
| 1931 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 1932 | - rc_req.args[1], rc_req.args[2], |
| 1933 | - rc_req.args[3], rc_req.args[4], |
| 1934 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 1935 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 1936 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 1937 | &request_to_deny, FFA_OK); |
| 1938 | |
| 1939 | /* Sending error to root which fails */ |
| 1940 | - expect_ffa_msg_send_direct_resp( |
| 1941 | + expect_ffa_msg_send_direct_resp_32( |
| 1942 | own_id, rc_root_id, (ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT), |
| 1943 | SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_DENIED); |
| 1944 | |
| 1945 | @@ -568,9 +631,9 @@ TEST(sp_messaging, sp_msg_send_direct_req_deny_fail_wait_success) |
| 1946 | expect_ffa_msg_wait(&rc_resp, FFA_OK); |
| 1947 | |
| 1948 | /* Fowarding RC response to RC root and receiving response */ |
| 1949 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0], |
| 1950 | - rc_resp.args[1], rc_resp.args[2], |
| 1951 | - rc_resp.args[3], rc_resp.args[4], &resp, |
| 1952 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0], |
| 1953 | + rc_resp.args.args32[1], rc_resp.args.args32[2], |
| 1954 | + rc_resp.args.args32[3], rc_resp.args.args32[4], &resp, |
| 1955 | FFA_OK); |
| 1956 | |
| 1957 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_req(&sp_req, &sp_resp)); |
| 1958 | @@ -590,58 +653,58 @@ TEST(sp_messaging, sp_msg_send_direct_req_deny_fail_wait_fail_forwarding) |
| 1959 | sp_msg sp_req = { 0 }; |
| 1960 | sp_msg sp_resp = { 0 }; |
| 1961 | |
| 1962 | - fill_sp_msg(&sp_req); |
| 1963 | + fill_sp_msg_32(&sp_req); |
| 1964 | sp_req.source_id = own_id; |
| 1965 | sp_req.destination_id = rc_root_id; |
| 1966 | |
| 1967 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1968 | req.source_id = own_id; |
| 1969 | req.destination_id = rc_root_id; |
| 1970 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 1971 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 1972 | |
| 1973 | - fill_ffa_msg(&rc_req); |
| 1974 | + fill_ffa_msg_32(&rc_req); |
| 1975 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 1976 | rc_req.source_id = rc_root_id; |
| 1977 | rc_req.destination_id = own_id; |
| 1978 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 1979 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1980 | |
| 1981 | request_to_deny.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1982 | /* This source ID should be denied in the current state. */ |
| 1983 | request_to_deny.source_id = rc_root_id; |
| 1984 | request_to_deny.destination_id = own_id; |
| 1985 | - request_to_deny.args[0] = ROUTING_EXT_RC_BIT; |
| 1986 | + request_to_deny.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1987 | |
| 1988 | - fill_ffa_msg(&rc_resp); |
| 1989 | + fill_ffa_msg_32(&rc_resp); |
| 1990 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 1991 | rc_resp.source_id = root_id; |
| 1992 | rc_resp.destination_id = own_id; |
| 1993 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 1994 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 1995 | |
| 1996 | - fill_sp_msg(&sp_resp); |
| 1997 | + fill_sp_msg_32(&sp_resp); |
| 1998 | sp_resp.source_id = rc_root_id; |
| 1999 | sp_resp.destination_id = own_id; |
| 2000 | |
| 2001 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 2002 | resp.source_id = rc_root_id; |
| 2003 | resp.destination_id = own_id; |
| 2004 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 2005 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 2006 | |
| 2007 | /* Initial request to current SP to set own_id */ |
| 2008 | wait_and_receive_request(root_id, own_id); |
| 2009 | |
| 2010 | /* Sending request and receiving RC request from RC root */ |
| 2011 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 2012 | - req.args[2], req.args[3], req.args[4], |
| 2013 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 2014 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 2015 | &rc_req, FFA_OK); |
| 2016 | |
| 2017 | /* Forwarding RC request to root and receiving RC response */ |
| 2018 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 2019 | - rc_req.args[1], rc_req.args[2], |
| 2020 | - rc_req.args[3], rc_req.args[4], |
| 2021 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 2022 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 2023 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 2024 | &request_to_deny, FFA_OK); |
| 2025 | |
| 2026 | /* Sending error to root which fails */ |
| 2027 | - expect_ffa_msg_send_direct_resp( |
| 2028 | + expect_ffa_msg_send_direct_resp_32( |
| 2029 | own_id, rc_root_id, ROUTING_EXT_ERR_BIT | ROUTING_EXT_RC_BIT, |
| 2030 | SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &rc_resp, FFA_DENIED); |
| 2031 | |
| 2032 | @@ -649,7 +712,7 @@ TEST(sp_messaging, sp_msg_send_direct_req_deny_fail_wait_fail_forwarding) |
| 2033 | expect_ffa_msg_wait(&rc_resp, result); |
| 2034 | |
| 2035 | /* Fowarding RC error as FFA_MSG_WAIT failed */ |
| 2036 | - expect_ffa_msg_send_direct_req( |
| 2037 | + expect_ffa_msg_send_direct_req_32( |
| 2038 | own_id, rc_root_id, (ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT), |
| 2039 | result, 0, 0, 0, &resp, FFA_OK); |
| 2040 | |
| 2041 | @@ -670,52 +733,52 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_return_rc_error_msg) |
| 2042 | sp_msg sp_resp = { 0 }; |
| 2043 | ffa_result result = FFA_ABORTED; |
| 2044 | |
| 2045 | - fill_sp_msg(&sp_req); |
| 2046 | + fill_sp_msg_32(&sp_req); |
| 2047 | sp_req.source_id = own_id; |
| 2048 | sp_req.destination_id = rc_root_id; |
| 2049 | |
| 2050 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 2051 | req.source_id = own_id; |
| 2052 | req.destination_id = rc_root_id; |
| 2053 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 2054 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 2055 | |
| 2056 | - fill_ffa_msg(&rc_req); |
| 2057 | + fill_ffa_msg_32(&rc_req); |
| 2058 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 2059 | rc_req.source_id = rc_root_id; |
| 2060 | rc_req.destination_id = own_id; |
| 2061 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 2062 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2063 | |
| 2064 | - fill_ffa_msg(&rc_resp); |
| 2065 | + fill_ffa_msg_32(&rc_resp); |
| 2066 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 2067 | rc_resp.source_id = root_id; |
| 2068 | rc_resp.destination_id = own_id; |
| 2069 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 2070 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2071 | |
| 2072 | - fill_sp_msg(&sp_resp); |
| 2073 | + fill_sp_msg_32(&sp_resp); |
| 2074 | sp_resp.source_id = rc_root_id; |
| 2075 | sp_resp.destination_id = own_id; |
| 2076 | |
| 2077 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 2078 | resp.source_id = rc_root_id; |
| 2079 | resp.destination_id = own_id; |
| 2080 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 2081 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 2082 | |
| 2083 | /* Initial request to current SP to set own_id */ |
| 2084 | wait_and_receive_request(root_id, own_id); |
| 2085 | |
| 2086 | /* Sending request and receiving RC request from RC root */ |
| 2087 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 2088 | - req.args[2], req.args[3], req.args[4], |
| 2089 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 2090 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 2091 | &rc_req, FFA_OK); |
| 2092 | |
| 2093 | /* Forwarding RC request to root and receiving RC response */ |
| 2094 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 2095 | - rc_req.args[1], rc_req.args[2], |
| 2096 | - rc_req.args[3], rc_req.args[4], |
| 2097 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 2098 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 2099 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 2100 | &rc_resp, result); |
| 2101 | |
| 2102 | /* Fowarding RC error to RC root and receiving response */ |
| 2103 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, |
| 2104 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, |
| 2105 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 2106 | SP_RESULT_FFA(result), 0, 0, 0, &resp, |
| 2107 | FFA_OK); |
| 2108 | @@ -737,54 +800,54 @@ TEST(sp_messaging, sp_msg_send_direct_req_rc_return_resp_fail) |
| 2109 | sp_msg sp_resp = { 0 }; |
| 2110 | ffa_result result = FFA_ABORTED; |
| 2111 | |
| 2112 | - fill_sp_msg(&sp_req); |
| 2113 | + fill_sp_msg_32(&sp_req); |
| 2114 | sp_req.source_id = own_id; |
| 2115 | sp_req.destination_id = rc_root_id; |
| 2116 | |
| 2117 | req.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 2118 | req.source_id = own_id; |
| 2119 | req.destination_id = rc_root_id; |
| 2120 | - copy_sp_to_ffa_args(sp_req.args, req.args); |
| 2121 | + copy_sp_to_ffa_args_32(sp_req.args.args32, req.args.args32); |
| 2122 | |
| 2123 | - fill_ffa_msg(&rc_req); |
| 2124 | + fill_ffa_msg_32(&rc_req); |
| 2125 | rc_req.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 2126 | rc_req.source_id = rc_root_id; |
| 2127 | rc_req.destination_id = own_id; |
| 2128 | - rc_req.args[0] = ROUTING_EXT_RC_BIT; |
| 2129 | + rc_req.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2130 | |
| 2131 | - fill_ffa_msg(&rc_resp); |
| 2132 | + fill_ffa_msg_32(&rc_resp); |
| 2133 | rc_resp.function_id = FFA_MSG_SEND_DIRECT_REQ_32; |
| 2134 | rc_resp.source_id = root_id; |
| 2135 | rc_resp.destination_id = own_id; |
| 2136 | - rc_resp.args[0] = ROUTING_EXT_RC_BIT; |
| 2137 | + rc_resp.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2138 | |
| 2139 | - fill_sp_msg(&sp_resp); |
| 2140 | + fill_sp_msg_32(&sp_resp); |
| 2141 | sp_resp.source_id = rc_root_id; |
| 2142 | sp_resp.destination_id = own_id; |
| 2143 | |
| 2144 | resp.function_id = FFA_MSG_SEND_DIRECT_RESP_32; |
| 2145 | resp.source_id = rc_root_id; |
| 2146 | resp.destination_id = own_id; |
| 2147 | - copy_sp_to_ffa_args(sp_resp.args, resp.args); |
| 2148 | + copy_sp_to_ffa_args_32(sp_resp.args.args32, resp.args.args32); |
| 2149 | |
| 2150 | /* Initial request to current SP to set own_id */ |
| 2151 | wait_and_receive_request(root_id, own_id); |
| 2152 | |
| 2153 | /* Sending request and receiving RC request from RC root */ |
| 2154 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, 0, req.args[1], |
| 2155 | - req.args[2], req.args[3], req.args[4], |
| 2156 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, 0, req.args.args32[1], |
| 2157 | + req.args.args32[2], req.args.args32[3], req.args.args32[4], |
| 2158 | &rc_req, FFA_OK); |
| 2159 | |
| 2160 | /* Forwarding RC request to root and receiving RC response */ |
| 2161 | - expect_ffa_msg_send_direct_resp(own_id, root_id, rc_req.args[0], |
| 2162 | - rc_req.args[1], rc_req.args[2], |
| 2163 | - rc_req.args[3], rc_req.args[4], |
| 2164 | + expect_ffa_msg_send_direct_resp_32(own_id, root_id, rc_req.args.args32[0], |
| 2165 | + rc_req.args.args32[1], rc_req.args.args32[2], |
| 2166 | + rc_req.args.args32[3], rc_req.args.args32[4], |
| 2167 | &rc_resp, FFA_OK); |
| 2168 | |
| 2169 | /* Fowarding RC response to RC root and receiving response */ |
| 2170 | - expect_ffa_msg_send_direct_req(own_id, rc_root_id, rc_resp.args[0], |
| 2171 | - rc_resp.args[1], rc_resp.args[2], |
| 2172 | - rc_resp.args[3], rc_resp.args[4], &resp, |
| 2173 | + expect_ffa_msg_send_direct_req_32(own_id, rc_root_id, rc_resp.args.args32[0], |
| 2174 | + rc_resp.args.args32[1], rc_resp.args.args32[2], |
| 2175 | + rc_resp.args.args32[3], rc_resp.args.args32[4], &resp, |
| 2176 | result); |
| 2177 | |
| 2178 | LONGS_EQUAL(SP_RESULT_FFA(result), |
| 2179 | @@ -812,10 +875,11 @@ TEST(sp_messaging, sp_msg_send_direct_resp_ffa_error) |
| 2180 | ffa_result result = FFA_ABORTED; |
| 2181 | uint32_t expected_ffa_args[5] = { 0 }; |
| 2182 | |
| 2183 | - fill_sp_msg(&resp); |
| 2184 | + fill_sp_msg_32(&resp); |
| 2185 | memset(&req, 0x5a, sizeof(req)); |
| 2186 | - copy_sp_to_ffa_args(resp.args, expected_ffa_args); |
| 2187 | - expect_ffa_msg_send_direct_resp( |
| 2188 | + req.is_64bit_message = false; |
| 2189 | + copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args); |
| 2190 | + expect_ffa_msg_send_direct_resp_32( |
| 2191 | resp.source_id, resp.destination_id, expected_ffa_args[0], |
| 2192 | expected_ffa_args[1], expected_ffa_args[2], |
| 2193 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, result); |
| 2194 | @@ -825,14 +889,30 @@ TEST(sp_messaging, sp_msg_send_direct_resp_ffa_error) |
| 2195 | MEMCMP_EQUAL(&empty_sp_msg, &req, sizeof(empty_sp_msg)); |
| 2196 | } |
| 2197 | |
| 2198 | -TEST(sp_messaging, sp_msg_send_direct_resp_msg) |
| 2199 | +TEST(sp_messaging, sp_msg_send_direct_resp_msg_32) |
| 2200 | { |
| 2201 | uint32_t expected_ffa_args[5] = { 0 }; |
| 2202 | |
| 2203 | - fill_sp_msg(&resp); |
| 2204 | - fill_ffa_msg(&ffa_msg); |
| 2205 | - copy_sp_to_ffa_args(resp.args, expected_ffa_args); |
| 2206 | - expect_ffa_msg_send_direct_resp( |
| 2207 | + fill_sp_msg_32(&resp); |
| 2208 | + fill_ffa_msg_32(&ffa_msg); |
| 2209 | + copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args); |
| 2210 | + expect_ffa_msg_send_direct_resp_32( |
| 2211 | + resp.source_id, resp.destination_id, expected_ffa_args[0], |
| 2212 | + expected_ffa_args[1], expected_ffa_args[2], |
| 2213 | + expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 2214 | + |
| 2215 | + LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_direct_resp(&resp, &req)); |
| 2216 | + ffa_and_sp_msg_equal(&ffa_msg, &req); |
| 2217 | +} |
| 2218 | + |
| 2219 | +TEST(sp_messaging, sp_msg_send_direct_resp_msg_64) |
| 2220 | +{ |
| 2221 | + uint64_t expected_ffa_args[5] = { 0 }; |
| 2222 | + |
| 2223 | + fill_sp_msg_64(&resp); |
| 2224 | + fill_ffa_msg_64(&ffa_msg); |
| 2225 | + copy_sp_to_ffa_args_64(resp.args.args64, expected_ffa_args); |
| 2226 | + expect_ffa_msg_send_direct_resp_64( |
| 2227 | resp.source_id, resp.destination_id, expected_ffa_args[0], |
| 2228 | expected_ffa_args[1], expected_ffa_args[2], |
| 2229 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 2230 | @@ -841,15 +921,16 @@ TEST(sp_messaging, sp_msg_send_direct_resp_msg) |
| 2231 | ffa_and_sp_msg_equal(&ffa_msg, &req); |
| 2232 | } |
| 2233 | |
| 2234 | + |
| 2235 | TEST(sp_messaging, sp_msg_send_direct_resp_success) |
| 2236 | { |
| 2237 | uint32_t expected_ffa_args[5] = { 0 }; |
| 2238 | |
| 2239 | - fill_sp_msg(&req); |
| 2240 | - fill_sp_msg(&resp); |
| 2241 | + fill_sp_msg_32(&req); |
| 2242 | + fill_sp_msg_32(&resp); |
| 2243 | ffa_msg.function_id = FFA_SUCCESS_32; |
| 2244 | - copy_sp_to_ffa_args(resp.args, expected_ffa_args); |
| 2245 | - expect_ffa_msg_send_direct_resp( |
| 2246 | + copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args); |
| 2247 | + expect_ffa_msg_send_direct_resp_32( |
| 2248 | resp.source_id, resp.destination_id, expected_ffa_args[0], |
| 2249 | expected_ffa_args[1], expected_ffa_args[2], |
| 2250 | expected_ffa_args[3], expected_ffa_args[4], &ffa_msg, FFA_OK); |
| 2251 | @@ -864,20 +945,20 @@ TEST(sp_messaging, sp_msg_send_direct_resp_deny_rc_failure) |
| 2252 | uint32_t expected_ffa_args[5] = { 0 }; |
| 2253 | struct ffa_direct_msg rc_msg = { 0 }; |
| 2254 | |
| 2255 | - fill_sp_msg(&resp); |
| 2256 | + fill_sp_msg_32(&resp); |
| 2257 | |
| 2258 | - fill_ffa_msg(&rc_msg); |
| 2259 | - rc_msg.args[0] = ROUTING_EXT_RC_BIT; |
| 2260 | + fill_ffa_msg_32(&rc_msg); |
| 2261 | + rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2262 | |
| 2263 | - fill_ffa_msg(&ffa_msg); |
| 2264 | - copy_sp_to_ffa_args(resp.args, expected_ffa_args); |
| 2265 | + fill_ffa_msg_32(&ffa_msg); |
| 2266 | + copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args); |
| 2267 | |
| 2268 | - expect_ffa_msg_send_direct_resp( |
| 2269 | + expect_ffa_msg_send_direct_resp_32( |
| 2270 | resp.source_id, resp.destination_id, expected_ffa_args[0], |
| 2271 | expected_ffa_args[1], expected_ffa_args[2], |
| 2272 | expected_ffa_args[3], expected_ffa_args[4], &rc_msg, FFA_OK); |
| 2273 | |
| 2274 | - expect_ffa_msg_send_direct_resp( |
| 2275 | + expect_ffa_msg_send_direct_resp_32( |
| 2276 | rc_msg.destination_id, rc_msg.source_id, |
| 2277 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 2278 | SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, result); |
| 2279 | @@ -892,21 +973,21 @@ TEST(sp_messaging, sp_msg_send_direct_resp_deny_rc) |
| 2280 | uint32_t expected_ffa_args[5] = { 0 }; |
| 2281 | struct ffa_direct_msg rc_msg = { 0 }; |
| 2282 | |
| 2283 | - fill_sp_msg(&resp); |
| 2284 | + fill_sp_msg_32(&resp); |
| 2285 | |
| 2286 | - fill_ffa_msg(&rc_msg); |
| 2287 | - rc_msg.args[0] = ROUTING_EXT_RC_BIT; |
| 2288 | + fill_ffa_msg_32(&rc_msg); |
| 2289 | + rc_msg.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2290 | |
| 2291 | - fill_ffa_msg(&ffa_msg); |
| 2292 | - copy_sp_to_ffa_args(resp.args, expected_ffa_args); |
| 2293 | + fill_ffa_msg_32(&ffa_msg); |
| 2294 | + copy_sp_to_ffa_args_32(resp.args.args32, expected_ffa_args); |
| 2295 | |
| 2296 | - expect_ffa_msg_send_direct_resp(resp.source_id, resp.destination_id, 0, |
| 2297 | + expect_ffa_msg_send_direct_resp_32(resp.source_id, resp.destination_id, 0, |
| 2298 | expected_ffa_args[1], |
| 2299 | expected_ffa_args[2], |
| 2300 | expected_ffa_args[3], |
| 2301 | expected_ffa_args[4], &rc_msg, FFA_OK); |
| 2302 | |
| 2303 | - expect_ffa_msg_send_direct_resp( |
| 2304 | + expect_ffa_msg_send_direct_resp_32( |
| 2305 | rc_msg.destination_id, rc_msg.source_id, |
| 2306 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 2307 | SP_RESULT_FFA(FFA_DENIED), 0, 0, 0, &ffa_msg, FFA_OK); |
| 2308 | @@ -933,13 +1014,14 @@ TEST(sp_messaging, sp_msg_send_rc_req_ffa_error) |
| 2309 | { |
| 2310 | ffa_result result = FFA_ABORTED; |
| 2311 | |
| 2312 | - fill_sp_msg(&resp); |
| 2313 | + fill_sp_msg_32(&resp); |
| 2314 | memset(&req, 0x5a, sizeof(req)); |
| 2315 | - fill_ffa_msg(&ffa_msg); |
| 2316 | + req.is_64bit_message = false; |
| 2317 | + fill_ffa_msg_32(&ffa_msg); |
| 2318 | |
| 2319 | - expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id, |
| 2320 | - ROUTING_EXT_RC_BIT, req.args[0], |
| 2321 | - req.args[1], req.args[2], req.args[3], |
| 2322 | + expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id, |
| 2323 | + ROUTING_EXT_RC_BIT, req.args.args32[0], |
| 2324 | + req.args.args32[1], req.args.args32[2], req.args.args32[3], |
| 2325 | &ffa_msg, result); |
| 2326 | |
| 2327 | LONGS_EQUAL(SP_RESULT_FFA(result), sp_msg_send_rc_req(&req, &resp)); |
| 2328 | @@ -953,22 +1035,22 @@ TEST(sp_messaging, sp_msg_send_rc_req_deny_fail_wait_fail) |
| 2329 | |
| 2330 | wait_and_receive_request(root_id, own_id); |
| 2331 | |
| 2332 | - fill_sp_msg(&req); |
| 2333 | + fill_sp_msg_32(&req); |
| 2334 | req.source_id = own_id; |
| 2335 | req.destination_id = root_id; |
| 2336 | |
| 2337 | - fill_ffa_msg(&ffa_msg); |
| 2338 | + fill_ffa_msg_32(&ffa_msg); |
| 2339 | ffa_msg.source_id = root_id; |
| 2340 | ffa_msg.destination_id = own_id; |
| 2341 | /* Should be RC message so it will be denied */ |
| 2342 | - ffa_msg.args[0] = 0; |
| 2343 | + ffa_msg.args.args32[0] = 0; |
| 2344 | |
| 2345 | - expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id, |
| 2346 | - ROUTING_EXT_RC_BIT, req.args[0], |
| 2347 | - req.args[1], req.args[2], req.args[3], |
| 2348 | + expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id, |
| 2349 | + ROUTING_EXT_RC_BIT, req.args.args32[0], |
| 2350 | + req.args.args32[1], req.args.args32[2], req.args.args32[3], |
| 2351 | &ffa_msg, FFA_OK); |
| 2352 | |
| 2353 | - expect_ffa_msg_send_direct_resp( |
| 2354 | + expect_ffa_msg_send_direct_resp_32( |
| 2355 | req.source_id, req.destination_id, |
| 2356 | ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT, |
| 2357 | SP_RESULT_FFA(FFA_BUSY), 0, 0, 0, &ffa_msg, result); |
| 2358 | @@ -987,19 +1069,19 @@ TEST(sp_messaging, sp_msg_send_rc_req_rc_error) |
| 2359 | |
| 2360 | wait_and_receive_request(root_id, own_id); |
| 2361 | |
| 2362 | - fill_sp_msg(&req); |
| 2363 | + fill_sp_msg_32(&req); |
| 2364 | req.source_id = own_id; |
| 2365 | req.destination_id = root_id; |
| 2366 | |
| 2367 | - fill_ffa_msg(&ffa_msg); |
| 2368 | + fill_ffa_msg_32(&ffa_msg); |
| 2369 | ffa_msg.source_id = root_id; |
| 2370 | ffa_msg.destination_id = own_id; |
| 2371 | - ffa_msg.args[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT; |
| 2372 | - ffa_msg.args[1] = sp_err; |
| 2373 | + ffa_msg.args.args32[0] = ROUTING_EXT_RC_BIT | ROUTING_EXT_ERR_BIT; |
| 2374 | + ffa_msg.args.args32[1] = sp_err; |
| 2375 | |
| 2376 | - expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id, |
| 2377 | - ROUTING_EXT_RC_BIT, req.args[0], |
| 2378 | - req.args[1], req.args[2], req.args[3], |
| 2379 | + expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id, |
| 2380 | + ROUTING_EXT_RC_BIT, req.args.args32[0], |
| 2381 | + req.args.args32[1], req.args.args32[2], req.args.args32[3], |
| 2382 | &ffa_msg, FFA_OK); |
| 2383 | |
| 2384 | LONGS_EQUAL(sp_err, sp_msg_send_rc_req(&req, &resp)); |
| 2385 | @@ -1013,18 +1095,18 @@ TEST(sp_messaging, sp_msg_send_rc_req_success) |
| 2386 | |
| 2387 | wait_and_receive_request(root_id, own_id); |
| 2388 | |
| 2389 | - fill_sp_msg(&req); |
| 2390 | + fill_sp_msg_32(&req); |
| 2391 | req.source_id = own_id; |
| 2392 | req.destination_id = root_id; |
| 2393 | |
| 2394 | - fill_ffa_msg(&ffa_msg); |
| 2395 | + fill_ffa_msg_32(&ffa_msg); |
| 2396 | ffa_msg.source_id = root_id; |
| 2397 | ffa_msg.destination_id = own_id; |
| 2398 | - ffa_msg.args[0] = ROUTING_EXT_RC_BIT; |
| 2399 | + ffa_msg.args.args32[0] = ROUTING_EXT_RC_BIT; |
| 2400 | |
| 2401 | - expect_ffa_msg_send_direct_resp(req.source_id, req.destination_id, |
| 2402 | - ROUTING_EXT_RC_BIT, req.args[0], |
| 2403 | - req.args[1], req.args[2], req.args[3], |
| 2404 | + expect_ffa_msg_send_direct_resp_32(req.source_id, req.destination_id, |
| 2405 | + ROUTING_EXT_RC_BIT, req.args.args32[0], |
| 2406 | + req.args.args32[1], req.args.args32[2], req.args.args32[3], |
| 2407 | &ffa_msg, FFA_OK); |
| 2408 | |
| 2409 | LONGS_EQUAL(SP_RESULT_OK, sp_msg_send_rc_req(&req, &resp)); |
| 2410 | diff --git a/components/rpc/ffarpc/caller/sp/ffarpc_caller.c b/components/rpc/ffarpc/caller/sp/ffarpc_caller.c |
| 2411 | index 4ad98fb..ca3d318 100644 |
| 2412 | --- a/components/rpc/ffarpc/caller/sp/ffarpc_caller.c |
| 2413 | +++ b/components/rpc/ffarpc/caller/sp/ffarpc_caller.c |
| 2414 | @@ -81,16 +81,17 @@ static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t |
| 2415 | |
| 2416 | req.destination_id = this_context->dest_partition_id; |
| 2417 | req.source_id = own_id; |
| 2418 | - req.args[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2419 | + req.is_64bit_message = false; |
| 2420 | + req.args.args32[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2421 | FFA_CALL_ARGS_COMBINE_IFACE_ID_OPCODE(this_context->dest_iface_id, opcode); |
| 2422 | - req.args[SP_CALL_ARGS_REQ_DATA_LEN] = (uint32_t)this_context->req_len; |
| 2423 | - req.args[SP_CALL_ARGS_ENCODING] = this_context->rpc_caller.encoding; |
| 2424 | + req.args.args32[SP_CALL_ARGS_REQ_DATA_LEN] = (uint32_t)this_context->req_len; |
| 2425 | + req.args.args32[SP_CALL_ARGS_ENCODING] = this_context->rpc_caller.encoding; |
| 2426 | |
| 2427 | /* Initialise the caller ID. Depending on the call path, this may |
| 2428 | * be overridden by a higher privilege execution level, based on its |
| 2429 | * perspective of the caller identity. |
| 2430 | */ |
| 2431 | - req.args[SP_CALL_ARGS_CALLER_ID] = 0; |
| 2432 | + req.args.args32[SP_CALL_ARGS_CALLER_ID] = 0; |
| 2433 | |
| 2434 | sp_res = sp_msg_send_direct_req(&req, &resp); |
| 2435 | if (sp_res != SP_RESULT_OK) { |
| 2436 | @@ -98,9 +99,9 @@ static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t |
| 2437 | goto out; |
| 2438 | } |
| 2439 | |
| 2440 | - this_context->resp_len = (size_t)resp.args[SP_CALL_ARGS_RESP_DATA_LEN]; |
| 2441 | - status = resp.args[SP_CALL_ARGS_RESP_RPC_STATUS]; |
| 2442 | - *opstatus = (rpc_status_t)((int32_t)resp.args[SP_CALL_ARGS_RESP_OP_STATUS]); |
| 2443 | + this_context->resp_len = (size_t)resp.args.args32[SP_CALL_ARGS_RESP_DATA_LEN]; |
| 2444 | + status = resp.args.args32[SP_CALL_ARGS_RESP_RPC_STATUS]; |
| 2445 | + *opstatus = (rpc_status_t)((int32_t)resp.args.args32[SP_CALL_ARGS_RESP_OP_STATUS]); |
| 2446 | |
| 2447 | if (this_context->resp_len > this_context->shared_mem_required_size) { |
| 2448 | EMSG("invalid response length"); |
| 2449 | @@ -242,11 +243,12 @@ int ffarpc_caller_open(struct ffarpc_caller *caller, uint16_t dest_partition_id, |
| 2450 | |
| 2451 | req.source_id = own_id; |
| 2452 | req.destination_id = dest_partition_id; |
| 2453 | - req.args[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2454 | + req.is_64bit_message = false; |
| 2455 | + req.args.args32[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2456 | FFA_CALL_ARGS_COMBINE_IFACE_ID_OPCODE(FFA_CALL_MGMT_IFACE_ID, FFA_CALL_OPCODE_SHARE_BUF); |
| 2457 | - req.args[SP_CALL_ARGS_SHARE_MEM_HANDLE_LSW] = (uint32_t)(handle & UINT32_MAX); |
| 2458 | - req.args[SP_CALL_ARGS_SHARE_MEM_HANDLE_MSW] = (uint32_t)(handle >> 32); |
| 2459 | - req.args[SP_CALL_ARGS_SHARE_MEM_SIZE] = (uint32_t)(caller->shared_mem_required_size); |
| 2460 | + req.args.args32[SP_CALL_ARGS_SHARE_MEM_HANDLE_LSW] = (uint32_t)(handle & UINT32_MAX); |
| 2461 | + req.args.args32[SP_CALL_ARGS_SHARE_MEM_HANDLE_MSW] = (uint32_t)(handle >> 32); |
| 2462 | + req.args.args32[SP_CALL_ARGS_SHARE_MEM_SIZE] = (uint32_t)(caller->shared_mem_required_size); |
| 2463 | |
| 2464 | sp_res = sp_msg_send_direct_req(&req, &resp); |
| 2465 | if (sp_res != SP_RESULT_OK) { |
| 2466 | @@ -273,10 +275,11 @@ int ffarpc_caller_close(struct ffarpc_caller *caller) |
| 2467 | |
| 2468 | req.source_id = own_id; |
| 2469 | req.destination_id = caller->dest_partition_id; |
| 2470 | - req.args[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2471 | + req.is_64bit_message = false; |
| 2472 | + req.args.args32[SP_CALL_ARGS_IFACE_ID_OPCODE] = |
| 2473 | FFA_CALL_ARGS_COMBINE_IFACE_ID_OPCODE(FFA_CALL_MGMT_IFACE_ID, FFA_CALL_OPCODE_UNSHARE_BUF); |
| 2474 | - req.args[SP_CALL_ARGS_SHARE_MEM_HANDLE_LSW] = handle_lo; |
| 2475 | - req.args[SP_CALL_ARGS_SHARE_MEM_HANDLE_MSW] = handle_hi; |
| 2476 | + req.args.args32[SP_CALL_ARGS_SHARE_MEM_HANDLE_LSW] = handle_lo; |
| 2477 | + req.args.args32[SP_CALL_ARGS_SHARE_MEM_HANDLE_MSW] = handle_hi; |
| 2478 | |
| 2479 | sp_res = sp_msg_send_direct_req(&req, &resp); |
| 2480 | if (sp_res != SP_RESULT_OK) { |
| 2481 | diff --git a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c |
| 2482 | index 6a8cef0..c024196 100644 |
| 2483 | --- a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c |
| 2484 | +++ b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c |
| 2485 | @@ -260,8 +260,8 @@ void ffa_call_ep_receive(struct ffa_call_ep *call_ep, |
| 2486 | const struct sp_msg *req_msg, |
| 2487 | struct sp_msg *resp_msg) |
| 2488 | { |
| 2489 | - const uint32_t *req_args = req_msg->args; |
| 2490 | - uint32_t *resp_args = resp_msg->args; |
| 2491 | + const uint32_t *req_args = req_msg->args.args32; |
| 2492 | + uint32_t *resp_args = resp_msg->args.args32; |
| 2493 | |
| 2494 | uint16_t source_id = req_msg->source_id; |
| 2495 | uint32_t ifaceid_opcode = req_args[SP_CALL_ARGS_IFACE_ID_OPCODE]; |
| 2496 | diff --git a/components/rpc/mm_communicate/endpoint/sp/mm_communicate_call_ep.c b/components/rpc/mm_communicate/endpoint/sp/mm_communicate_call_ep.c |
| 2497 | index 09f1e2c..dc49e64 100644 |
| 2498 | --- a/components/rpc/mm_communicate/endpoint/sp/mm_communicate_call_ep.c |
| 2499 | +++ b/components/rpc/mm_communicate/endpoint/sp/mm_communicate_call_ep.c |
| 2500 | @@ -1,6 +1,6 @@ |
| 2501 | // SPDX-License-Identifier: BSD-3-Clause |
| 2502 | /* |
| 2503 | - * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 2504 | + * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. |
| 2505 | */ |
| 2506 | |
| 2507 | #include "components/rpc/mm_communicate/common/mm_communicate_call_args.h" |
| 2508 | @@ -127,15 +127,15 @@ void mm_communicate_call_ep_receive(struct mm_communicate_ep *mm_communicate_cal |
| 2509 | uintptr_t buffer_address = 0; |
| 2510 | size_t buffer_size = 0; |
| 2511 | |
| 2512 | - buffer_address = req_msg->args[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_ADDRESS]; |
| 2513 | - buffer_size = req_msg->args[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_SIZE]; |
| 2514 | + buffer_address = req_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_ADDRESS]; |
| 2515 | + buffer_size = req_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_COMM_BUFFER_SIZE]; |
| 2516 | |
| 2517 | return_value = handle_mm_communicate(mm_communicate_call_ep, req_msg->source_id, |
| 2518 | buffer_address, buffer_size); |
| 2519 | |
| 2520 | - resp_msg->args[MM_COMMUNICATE_CALL_ARGS_RETURN_ID] = ARM_SVC_ID_SP_EVENT_COMPLETE; |
| 2521 | - resp_msg->args[MM_COMMUNICATE_CALL_ARGS_RETURN_CODE] = return_value; |
| 2522 | - resp_msg->args[MM_COMMUNICATE_CALL_ARGS_MBZ0] = 0; |
| 2523 | - resp_msg->args[MM_COMMUNICATE_CALL_ARGS_MBZ1] = 0; |
| 2524 | - resp_msg->args[MM_COMMUNICATE_CALL_ARGS_MBZ2] = 0; |
| 2525 | + resp_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_RETURN_ID] = ARM_SVC_ID_SP_EVENT_COMPLETE; |
| 2526 | + resp_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_RETURN_CODE] = return_value; |
| 2527 | + resp_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_MBZ0] = 0; |
| 2528 | + resp_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_MBZ1] = 0; |
| 2529 | + resp_msg->args.args32[MM_COMMUNICATE_CALL_ARGS_MBZ2] = 0; |
| 2530 | } |
| 2531 | diff --git a/deployments/smm-gateway/common/smm_gateway_sp.c b/deployments/smm-gateway/common/smm_gateway_sp.c |
| 2532 | index 2187fea..3697b7f 100644 |
| 2533 | --- a/deployments/smm-gateway/common/smm_gateway_sp.c |
| 2534 | +++ b/deployments/smm-gateway/common/smm_gateway_sp.c |
| 2535 | @@ -70,10 +70,10 @@ void __noreturn sp_main(struct ffa_init_info *init_info) |
| 2536 | while (1) { |
| 2537 | mm_communicate_call_ep_receive(&mm_communicate_call_ep, &req_msg, &resp_msg); |
| 2538 | |
| 2539 | - ffa_msg_send_direct_resp(req_msg.destination_id, |
| 2540 | - req_msg.source_id, resp_msg.args[0], |
| 2541 | - resp_msg.args[1], resp_msg.args[2], |
| 2542 | - resp_msg.args[3], resp_msg.args[4], |
| 2543 | + ffa_msg_send_direct_resp_32(req_msg.destination_id, |
| 2544 | + req_msg.source_id, resp_msg.args.args32[0], |
| 2545 | + resp_msg.args.args32[1], resp_msg.args.args32[2], |
| 2546 | + resp_msg.args.args32[3], resp_msg.args.args32[4], |
| 2547 | &req_msg); |
| 2548 | } |
| 2549 | |
| 2550 | -- |
| 2551 | 2.17.1 |
| 2552 | |