blob: caacc79a13b26d4014539eb24ec04522320b7bba [file] [log] [blame]
Imre Kis9fcf8412020-11-23 03:15:45 +01001// SPDX-License-Identifier: BSD-3-Clause
2/*
Balint Dobszay40410ab2022-01-19 16:31:02 +01003 * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
Imre Kis9fcf8412020-11-23 03:15:45 +01004 */
5
6#include <assert.h> // for assert
7#include <stddef.h> // for size_t
8#include <stdint.h> // for uint32_t, uint16_t, uintptr_t, U
9#include "ffa_api.h" // for FFA_OK, ffa_interrupt_handler, ffa_fea...
10#include "ffa_api_defines.h" // for FFA_PARAM_MBZ, FFA_OK, FFA_ERROR, FFA_...
11#include "ffa_api_types.h" // for ffa_result, ffa_direct_msg, ffa_uuid
12#include "ffa_internal_api.h" // for ffa_params, ffa_svc
13#include "util.h" // for GENMASK_32, SHIFT_U32, BIT
14
15/*
16 * Unpacks the error code from the FFA_ERROR message. It is a signed 32 bit
17 * value in an unsigned 64 bit field so proper casting must be used to avoid
18 * compiler dependent behavior.
19 */
20static inline ffa_result ffa_get_errorcode(struct ffa_params *result)
21{
22 uint32_t raw_value = result->a2;
23
24 return *(ffa_result *)(&raw_value);
25}
26
27/*
28 * Unpacks the content of the SVC result into an ffa_direct_msg structure.
29 */
30static inline void ffa_unpack_direct_msg(struct ffa_params *svc_result,
31 struct ffa_direct_msg *msg)
32{
33 msg->function_id = svc_result->a0;
34 msg->source_id = (svc_result->a1 >> 16);
35 msg->destination_id = svc_result->a1;
Imre Kis1bc4a622022-07-19 17:38:00 +020036
37 if (FFA_IS_32_BIT_FUNC(msg->function_id)) {
38 msg->args.args32[0] = svc_result->a3;
39 msg->args.args32[1] = svc_result->a4;
40 msg->args.args32[2] = svc_result->a5;
41 msg->args.args32[3] = svc_result->a6;
42 msg->args.args32[4] = svc_result->a7;
43 } else {
44 msg->args.args64[0] = svc_result->a3;
45 msg->args.args64[1] = svc_result->a4;
46 msg->args.args64[2] = svc_result->a5;
47 msg->args.args64[3] = svc_result->a6;
48 msg->args.args64[4] = svc_result->a7;
49 }
Imre Kis9fcf8412020-11-23 03:15:45 +010050}
51
52/*
53 * The end of the interrupt handler is indicated by an FFA_MSG_WAIT call.
54 */
55static inline void ffa_return_from_interrupt(struct ffa_params *result)
56{
57 ffa_svc(FFA_MSG_WAIT, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
58 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
59 result);
60}
61
62static inline void ffa_uuid_to_abi_format(const struct ffa_uuid *uuid,
63 uint32_t *result)
64{
65 size_t i = 0;
66
67 for (i = 0; i < 4; i++) {
68 result[i] = uuid->uuid[4 * i];
69 result[i] |= SHIFT_U32(uuid->uuid[4 * i + 1], 8);
70 result[i] |= SHIFT_U32(uuid->uuid[4 * i + 2], 16);
71 result[i] |= SHIFT_U32(uuid->uuid[4 * i + 3], 24);
72 }
73}
74
75ffa_result ffa_version(uint32_t *version)
76{
77 struct ffa_params result = {0};
78 uint32_t self_version = 0;
79
80 self_version = (FFA_VERSION_MAJOR << FFA_VERSION_MAJOR_SHIFT) |
81 (FFA_VERSION_MINOR << FFA_VERSION_MINOR);
82
83 ffa_svc(FFA_VERSION, self_version, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
84 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
85 &result);
86
87 if (result.a0 & BIT(31)) {
88 uint32_t raw_error = result.a0;
89
90 *version = 0;
91
92 return *(ffa_result *)(&raw_error);
93 }
94
95 *version = result.a0;
96 return FFA_OK;
97}
98
99ffa_result ffa_features(uint32_t ffa_function_id,
100 struct ffa_interface_properties *interface_properties)
101{
102 struct ffa_params result = {0};
103
104 ffa_svc(FFA_FEATURES, ffa_function_id, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
105 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
106 &result);
107
108 if (result.a0 == FFA_ERROR) {
109 interface_properties->interface_properties[0] = 0;
110 interface_properties->interface_properties[1] = 0;
111 return ffa_get_errorcode(&result);
112 }
113
114 assert(result.a0 == FFA_SUCCESS_32);
115 interface_properties->interface_properties[0] = result.a2;
116 interface_properties->interface_properties[1] = result.a3;
117 return FFA_OK;
118}
119
120ffa_result ffa_rx_release(void)
121{
122 struct ffa_params result = {0};
123
124 ffa_svc(FFA_RX_RELEASE, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
125 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
126 &result);
127
128 if (result.a0 == FFA_ERROR)
129 return ffa_get_errorcode(&result);
130
131 assert(result.a0 == FFA_SUCCESS_32);
132 return FFA_OK;
133}
134
135ffa_result ffa_rxtx_map(const void *tx_buffer, const void *rx_buffer,
136 uint32_t page_count)
137{
138 struct ffa_params result = {0};
139
140 assert(page_count <= FFA_RXTX_MAP_PAGE_COUNT_MAX);
141
142 page_count = SHIFT_U32(page_count & FFA_RXTX_MAP_PAGE_COUNT_MASK,
143 FFA_RXTX_MAP_PAGE_COUNT_SHIFT);
144
Balint Dobszay40410ab2022-01-19 16:31:02 +0100145 ffa_svc(FFA_RXTX_MAP_64, (uintptr_t)tx_buffer, (uintptr_t)rx_buffer,
Imre Kis9fcf8412020-11-23 03:15:45 +0100146 page_count, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
147 FFA_PARAM_MBZ, &result);
148
149 if (result.a0 == FFA_ERROR)
150 return ffa_get_errorcode(&result);
151
Balint Dobszay40410ab2022-01-19 16:31:02 +0100152 /*
153 * There are no 64-bit parameters returned with FFA_SUCCESS, the SPMC
154 * will use the default 32-bit version.
155 */
Imre Kis9fcf8412020-11-23 03:15:45 +0100156 assert(result.a0 == FFA_SUCCESS_32);
157 return FFA_OK;
158}
159
160ffa_result ffa_rxtx_unmap(uint16_t id)
161{
162 struct ffa_params result = {0};
163
164 ffa_svc(FFA_RXTX_UNMAP, SHIFT_U32(id, FFA_RXTX_UNMAP_ID_SHIFT),
165 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
166 FFA_PARAM_MBZ, FFA_PARAM_MBZ, &result);
167
168 if (result.a0 == FFA_ERROR)
169 return ffa_get_errorcode(&result);
170
171 assert(result.a0 == FFA_SUCCESS_32);
172 return FFA_OK;
173}
174
175ffa_result ffa_partition_info_get(const struct ffa_uuid *uuid, uint32_t *count)
176{
177 struct ffa_params result = {0};
178 uint32_t abi_uuid[4] = {0};
179
180 ffa_uuid_to_abi_format(uuid, abi_uuid);
181
182 ffa_svc(FFA_PARTITION_INFO_GET, abi_uuid[0], abi_uuid[1], abi_uuid[2],
183 abi_uuid[3], FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
184 &result);
185
186 if (result.a0 == FFA_ERROR) {
187 *count = UINT32_C(0);
188 return ffa_get_errorcode(&result);
189 }
190
191 assert(result.a0 == FFA_SUCCESS_32);
192 *count = result.a2;
193 return FFA_OK;
194}
195
196ffa_result ffa_id_get(uint16_t *id)
197{
198 struct ffa_params result = {0};
199
200 ffa_svc(FFA_ID_GET, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
201 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
202 &result);
203
204 if (result.a0 == FFA_ERROR) {
205 *id = FFA_ID_GET_ID_MASK;
206 return ffa_get_errorcode(&result);
207 }
208
209 assert(result.a0 == FFA_SUCCESS_32);
210 *id = (result.a2 >> FFA_ID_GET_ID_SHIFT) & FFA_ID_GET_ID_MASK;
211 return FFA_OK;
212}
213
214ffa_result ffa_msg_wait(struct ffa_direct_msg *msg)
215{
216 struct ffa_params result = {0};
217
218 ffa_svc(FFA_MSG_WAIT, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
219 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
220 &result);
221
222 while (result.a0 == FFA_INTERRUPT) {
223 ffa_interrupt_handler(result.a2);
224 ffa_return_from_interrupt(&result);
225 }
226
227 if (result.a0 == FFA_ERROR) {
228 return ffa_get_errorcode(&result);
Imre Kis1bc4a622022-07-19 17:38:00 +0200229 } else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) {
Imre Kis9fcf8412020-11-23 03:15:45 +0100230 ffa_unpack_direct_msg(&result, msg);
231 } else {
232 assert(result.a0 == FFA_SUCCESS_32);
233 *msg = (struct ffa_direct_msg){.function_id = result.a0};
234 }
235
236 return FFA_OK;
237}
238
Imre Kis1bc4a622022-07-19 17:38:00 +0200239static ffa_result ffa_msg_send_direct_req(uint32_t function_id, uint32_t resp_id,
240 uint16_t source, uint16_t dest,
241 uint64_t a0, uint64_t a1, uint64_t a2,
242 uint64_t a3, uint64_t a4,
243 struct ffa_direct_msg *msg)
Imre Kis9fcf8412020-11-23 03:15:45 +0100244{
245 struct ffa_params result = {0};
246
Imre Kis1bc4a622022-07-19 17:38:00 +0200247 ffa_svc(function_id,
Imre Kis9fcf8412020-11-23 03:15:45 +0100248 SHIFT_U32(source, FFA_MSG_SEND_DIRECT_REQ_SOURCE_ID_SHIFT) |
249 dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result);
250
251 while (result.a0 == FFA_INTERRUPT) {
252 ffa_interrupt_handler(result.a2);
253 ffa_return_from_interrupt(&result);
254 }
255
256 if (result.a0 == FFA_ERROR) {
257 return ffa_get_errorcode(&result);
Imre Kis1bc4a622022-07-19 17:38:00 +0200258 } else if (result.a0 == resp_id) {
Imre Kis9fcf8412020-11-23 03:15:45 +0100259 ffa_unpack_direct_msg(&result, msg);
260 } else {
261 assert(result.a0 == FFA_SUCCESS_32);
262 *msg = (struct ffa_direct_msg){.function_id = result.a0};
263 }
264
265 return FFA_OK;
266}
267
Imre Kis1bc4a622022-07-19 17:38:00 +0200268ffa_result ffa_msg_send_direct_req_32(uint16_t source, uint16_t dest,
269 uint32_t a0, uint32_t a1, uint32_t a2,
270 uint32_t a3, uint32_t a4,
271 struct ffa_direct_msg *msg)
272{
273 return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_32,
274 FFA_MSG_SEND_DIRECT_RESP_32,
275 source, dest, a0, a1, a2, a3, a4, msg);
276}
277
278ffa_result ffa_msg_send_direct_req_64(uint16_t source, uint16_t dest,
279 uint64_t a0, uint64_t a1, uint64_t a2,
280 uint64_t a3, uint64_t a4,
281 struct ffa_direct_msg *msg)
282{
283 return ffa_msg_send_direct_req(FFA_MSG_SEND_DIRECT_REQ_64,
284 FFA_MSG_SEND_DIRECT_RESP_64,
285 source, dest, a0, a1, a2, a3, a4, msg);
286}
287
288static ffa_result ffa_msg_send_direct_resp(uint32_t function_id,
289 uint16_t source, uint16_t dest,
290 uint64_t a0, uint64_t a1,
291 uint64_t a2, uint64_t a3,
292 uint64_t a4,
293 struct ffa_direct_msg *msg)
Imre Kis9fcf8412020-11-23 03:15:45 +0100294{
295 struct ffa_params result = {0};
296
Imre Kis1bc4a622022-07-19 17:38:00 +0200297 ffa_svc(function_id,
Imre Kis9fcf8412020-11-23 03:15:45 +0100298 SHIFT_U32(source, FFA_MSG_SEND_DIRECT_RESP_SOURCE_ID_SHIFT) |
299 dest, FFA_PARAM_MBZ, a0, a1, a2, a3, a4, &result);
300
301 while (result.a0 == FFA_INTERRUPT) {
302 ffa_interrupt_handler(result.a2);
303 ffa_return_from_interrupt(&result);
304 }
305
306 if (result.a0 == FFA_ERROR) {
307 return ffa_get_errorcode(&result);
Imre Kis1bc4a622022-07-19 17:38:00 +0200308 } else if (FFA_TO_32_BIT_FUNC(result.a0) == FFA_MSG_SEND_DIRECT_REQ_32) {
Imre Kis9fcf8412020-11-23 03:15:45 +0100309 ffa_unpack_direct_msg(&result, msg);
310 } else {
311 assert(result.a0 == FFA_SUCCESS_32);
312 *msg = (struct ffa_direct_msg){.function_id = result.a0};
313 }
314
315 return FFA_OK;
316}
Imre Kise3112e02020-11-23 03:15:46 +0100317
Imre Kis1bc4a622022-07-19 17:38:00 +0200318ffa_result ffa_msg_send_direct_resp_32(uint16_t source, uint16_t dest,
319 uint32_t a0, uint32_t a1, uint32_t a2,
320 uint32_t a3, uint32_t a4,
321 struct ffa_direct_msg *msg)
322{
323 return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_32, source,
324 dest, a0, a1, a2, a3, a4, msg);
325}
326
327ffa_result ffa_msg_send_direct_resp_64(uint16_t source, uint16_t dest,
328 uint64_t a0, uint64_t a1, uint64_t a2,
329 uint64_t a3, uint64_t a4,
330 struct ffa_direct_msg *msg)
331{
332 return ffa_msg_send_direct_resp(FFA_MSG_SEND_DIRECT_RESP_64, source,
333 dest, a0, a1, a2, a3, a4, msg);
334}
335
Imre Kise3112e02020-11-23 03:15:46 +0100336ffa_result ffa_mem_donate(uint32_t total_length, uint32_t fragment_length,
337 void *buffer_address, uint32_t page_count,
338 uint64_t *handle)
339{
340 struct ffa_params result = {0};
341
Balint Dobszay40410ab2022-01-19 16:31:02 +0100342 ffa_svc((buffer_address) ? FFA_MEM_DONATE_64 : FFA_MEM_DONATE_32,
343 total_length, fragment_length, (uintptr_t)buffer_address,
344 page_count, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
345 &result);
Imre Kise3112e02020-11-23 03:15:46 +0100346
347 if (result.a0 == FFA_ERROR) {
348 *handle = 0U;
349 return ffa_get_errorcode(&result);
350 }
351
Balint Dobszay40410ab2022-01-19 16:31:02 +0100352 /*
353 * There are no 64-bit parameters returned with FFA_SUCCESS, the SPMC
354 * will use the default 32-bit version.
355 */
Imre Kise3112e02020-11-23 03:15:46 +0100356 assert(result.a0 == FFA_SUCCESS_32);
357 *handle = reg_pair_to_64(result.a3, result.a2);
358 return FFA_OK;
359}
360
361ffa_result ffa_mem_donate_rxtx(uint32_t total_length, uint32_t fragment_length,
362 uint64_t *handle)
363{
364 return ffa_mem_donate(total_length, fragment_length, NULL, 0, handle);
365}
366
367ffa_result ffa_mem_lend(uint32_t total_length, uint32_t fragment_length,
368 void *buffer_address, uint32_t page_count,
369 uint64_t *handle)
370{
371 struct ffa_params result = {0};
372
Balint Dobszay40410ab2022-01-19 16:31:02 +0100373 ffa_svc((buffer_address) ? FFA_MEM_LEND_64 : FFA_MEM_LEND_32,
374 total_length, fragment_length, (uintptr_t)buffer_address,
375 page_count, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
376 &result);
Imre Kise3112e02020-11-23 03:15:46 +0100377
378 if (result.a0 == FFA_ERROR) {
379 *handle = 0U;
380 return ffa_get_errorcode(&result);
381 }
382
Balint Dobszay40410ab2022-01-19 16:31:02 +0100383 /*
384 * There are no 64-bit parameters returned with FFA_SUCCESS, the SPMC
385 * will use the default 32-bit version.
386 */
Imre Kise3112e02020-11-23 03:15:46 +0100387 assert(result.a0 == FFA_SUCCESS_32);
388 *handle = reg_pair_to_64(result.a3, result.a2);
389 return FFA_OK;
390}
391
392ffa_result ffa_mem_lend_rxtx(uint32_t total_length, uint32_t fragment_length,
393 uint64_t *handle)
394{
395 return ffa_mem_lend(total_length, fragment_length, NULL, 0, handle);
396}
397
398ffa_result ffa_mem_share(uint32_t total_length, uint32_t fragment_length,
399 void *buffer_address, uint32_t page_count,
400 uint64_t *handle)
401{
402 struct ffa_params result = {0};
403
Balint Dobszay40410ab2022-01-19 16:31:02 +0100404 ffa_svc((buffer_address) ? FFA_MEM_SHARE_64 : FFA_MEM_SHARE_32,
405 total_length, fragment_length, (uintptr_t)buffer_address,
406 page_count, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
407 &result);
Imre Kise3112e02020-11-23 03:15:46 +0100408
409 if (result.a0 == FFA_ERROR) {
410 *handle = 0U;
411 return ffa_get_errorcode(&result);
412 }
413
Balint Dobszay40410ab2022-01-19 16:31:02 +0100414 /*
415 * There are no 64-bit parameters returned with FFA_SUCCESS, the SPMC
416 * will use the default 32-bit version.
417 */
Imre Kise3112e02020-11-23 03:15:46 +0100418 assert(result.a0 == FFA_SUCCESS_32);
419 *handle = reg_pair_to_64(result.a3, result.a2);
420 return FFA_OK;
421}
422
423ffa_result ffa_mem_share_rxtx(uint32_t total_length, uint32_t fragment_length,
424 uint64_t *handle)
425{
426 return ffa_mem_share(total_length, fragment_length, NULL, 0, handle);
427}
428
429ffa_result ffa_mem_retrieve_req(uint32_t total_length, uint32_t fragment_length,
430 void *buffer_address, uint32_t page_count,
431 uint32_t *resp_total_length,
432 uint32_t *resp_fragment_length)
433{
434 struct ffa_params result = {0};
435
Balint Dobszay40410ab2022-01-19 16:31:02 +0100436 ffa_svc((buffer_address) ? FFA_MEM_RETRIEVE_REQ_64 : FFA_MEM_RETRIEVE_REQ_32,
437 total_length, fragment_length, (uintptr_t)buffer_address,
438 page_count, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
439 &result);
Imre Kise3112e02020-11-23 03:15:46 +0100440
441 if (result.a0 == FFA_ERROR) {
442 *resp_total_length = 0U;
443 *resp_fragment_length = 0U;
444 return ffa_get_errorcode(&result);
445 }
446
447 assert(result.a0 == FFA_MEM_RETRIEVE_RESP);
448 *resp_total_length = result.a1;
449 *resp_fragment_length = result.a2;
450 return FFA_OK;
451}
452
453ffa_result ffa_mem_retrieve_req_rxtx(uint32_t total_length,
454 uint32_t fragment_length,
455 uint32_t *resp_total_length,
456 uint32_t *resp_fragment_length)
457{
458 return ffa_mem_retrieve_req(total_length, fragment_length, NULL, 0,
459 resp_total_length, resp_fragment_length);
460}
461
462ffa_result ffa_mem_relinquish(void)
463{
464 struct ffa_params result = {0};
465
466 ffa_svc(FFA_MEM_RELINQUISH, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
467 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
468 &result);
469
470 if (result.a0 == FFA_ERROR)
471 return ffa_get_errorcode(&result);
472
473 assert(result.a0 == FFA_SUCCESS_32);
474 return FFA_OK;
475}
476
477ffa_result ffa_mem_reclaim(uint64_t handle, uint32_t flags)
478{
479 struct ffa_params result = {0};
480 uint32_t handle_hi = 0;
481 uint32_t handle_lo = 0;
482
483 reg_pair_from_64(handle, &handle_hi, &handle_lo);
484
485 ffa_svc(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, FFA_PARAM_MBZ,
486 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, &result);
487
488 if (result.a0 == FFA_ERROR)
489 return ffa_get_errorcode(&result);
490
491 assert(result.a0 == FFA_SUCCESS_32);
492 return FFA_OK;
493}
Imre Kisa5201e42022-02-22 15:25:21 +0100494
495ffa_result ffa_mem_perm_get(const void *base_address, uint32_t *mem_perm)
496{
497 struct ffa_params result = {0};
498
499 ffa_svc(FFA_MEM_PERM_GET, (uintptr_t)base_address, FFA_PARAM_MBZ,
500 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
501 FFA_PARAM_MBZ, &result);
502
503 if (result.a0 == FFA_ERROR)
504 return ffa_get_errorcode(&result);
505
506 assert(result.a0 == FFA_SUCCESS_32);
507 *mem_perm = result.a2;
508 return FFA_OK;
509}
510
511ffa_result ffa_mem_perm_set(const void *base_address, uint32_t page_count,
512 uint32_t mem_perm)
513{
514 struct ffa_params result = {0};
515
516 assert((mem_perm & FFA_MEM_PERM_RESERVED_MASK) == 0);
517
518 ffa_svc(FFA_MEM_PERM_SET, (uintptr_t)base_address, page_count, mem_perm,
519 FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
520 &result);
521
522 if (result.a0 == FFA_ERROR)
523 return ffa_get_errorcode(&result);
524
525 assert(result.a0 == FFA_SUCCESS_32);
526 return FFA_OK;
527}