J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 1 | /* |
Max Shvetsov | 103e056 | 2021-02-04 16:58:31 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018-2021, Arm Limited. All rights reserved. |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef FFA_HELPERS_H |
| 8 | #define FFA_HELPERS_H |
| 9 | |
J-Alves | 8f08a05 | 2020-05-26 17:14:40 +0100 | [diff] [blame] | 10 | #include <ffa_svc.h> |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 11 | #include <tftf_lib.h> |
| 12 | #include <utils_def.h> |
| 13 | |
| 14 | /* This error code must be different to the ones used by FFA */ |
| 15 | #define FFA_TFTF_ERROR -42 |
| 16 | |
J-Alves | 5aecd98 | 2020-06-11 10:25:33 +0100 | [diff] [blame] | 17 | typedef unsigned short ffa_vm_id_t; |
| 18 | typedef unsigned short ffa_vm_count_t; |
| 19 | typedef unsigned short ffa_vcpu_count_t; |
Manish Pandey | 6b3840a | 2020-09-15 22:31:58 +0100 | [diff] [blame] | 20 | typedef uint32_t ffa_int_id_t; |
J-Alves | f3a393c | 2020-10-23 16:00:39 +0100 | [diff] [blame] | 21 | typedef uint64_t ffa_memory_handle_t; |
| 22 | /** Flags to indicate properties of receivers during memory region retrieval. */ |
| 23 | typedef uint8_t ffa_memory_receiver_flags_t; |
J-Alves | 5aecd98 | 2020-06-11 10:25:33 +0100 | [diff] [blame] | 24 | |
J-Alves | d708c03 | 2020-11-19 12:14:21 +0000 | [diff] [blame] | 25 | struct ffa_uuid { |
| 26 | const uint32_t uuid[4]; |
| 27 | }; |
| 28 | |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 29 | #ifndef __ASSEMBLY__ |
| 30 | |
| 31 | #include <stdint.h> |
| 32 | |
Max Shvetsov | c32f478 | 2020-06-23 09:41:15 +0100 | [diff] [blame] | 33 | struct ffa_partition_info { |
| 34 | /** The ID of the VM the information is about */ |
| 35 | ffa_vm_id_t id; |
| 36 | /** The number of execution contexts implemented by the partition */ |
| 37 | uint16_t exec_context; |
| 38 | /** The Partition's properties, e.g. supported messaging methods */ |
| 39 | uint32_t properties; |
| 40 | }; |
| 41 | |
J-Alves | 6cb21d9 | 2021-01-07 15:18:12 +0000 | [diff] [blame^] | 42 | static inline uint32_t ffa_func_id(smc_ret_values val) { |
| 43 | return (uint32_t) val.ret0; |
| 44 | } |
| 45 | |
| 46 | static inline int32_t ffa_error_code(smc_ret_values val) { |
| 47 | return (int32_t) val.ret2; |
| 48 | } |
| 49 | |
J-Alves | f3a393c | 2020-10-23 16:00:39 +0100 | [diff] [blame] | 50 | enum ffa_data_access { |
| 51 | FFA_DATA_ACCESS_NOT_SPECIFIED, |
| 52 | FFA_DATA_ACCESS_RO, |
| 53 | FFA_DATA_ACCESS_RW, |
| 54 | FFA_DATA_ACCESS_RESERVED, |
| 55 | }; |
| 56 | |
| 57 | enum ffa_instruction_access { |
| 58 | FFA_INSTRUCTION_ACCESS_NOT_SPECIFIED, |
| 59 | FFA_INSTRUCTION_ACCESS_NX, |
| 60 | FFA_INSTRUCTION_ACCESS_X, |
| 61 | FFA_INSTRUCTION_ACCESS_RESERVED, |
| 62 | }; |
| 63 | |
| 64 | enum ffa_memory_type { |
| 65 | FFA_MEMORY_NOT_SPECIFIED_MEM, |
| 66 | FFA_MEMORY_DEVICE_MEM, |
| 67 | FFA_MEMORY_NORMAL_MEM, |
| 68 | }; |
| 69 | |
| 70 | enum ffa_memory_cacheability { |
| 71 | FFA_MEMORY_CACHE_RESERVED = 0x0, |
| 72 | FFA_MEMORY_CACHE_NON_CACHEABLE = 0x1, |
| 73 | FFA_MEMORY_CACHE_RESERVED_1 = 0x2, |
| 74 | FFA_MEMORY_CACHE_WRITE_BACK = 0x3, |
| 75 | FFA_MEMORY_DEV_NGNRNE = 0x0, |
| 76 | FFA_MEMORY_DEV_NGNRE = 0x1, |
| 77 | FFA_MEMORY_DEV_NGRE = 0x2, |
| 78 | FFA_MEMORY_DEV_GRE = 0x3, |
| 79 | }; |
| 80 | |
| 81 | enum ffa_memory_shareability { |
| 82 | FFA_MEMORY_SHARE_NON_SHAREABLE, |
| 83 | FFA_MEMORY_SHARE_RESERVED, |
| 84 | FFA_MEMORY_OUTER_SHAREABLE, |
| 85 | FFA_MEMORY_INNER_SHAREABLE, |
| 86 | }; |
| 87 | |
| 88 | typedef uint8_t ffa_memory_access_permissions_t; |
| 89 | |
| 90 | /** |
| 91 | * This corresponds to table "Memory region attributes descriptor" of the FF-A |
| 92 | * 1.0 specification. |
| 93 | */ |
| 94 | typedef uint8_t ffa_memory_attributes_t; |
| 95 | |
| 96 | #define FFA_DATA_ACCESS_OFFSET (0x0U) |
| 97 | #define FFA_DATA_ACCESS_MASK ((0x3U) << FFA_DATA_ACCESS_OFFSET) |
| 98 | |
| 99 | #define FFA_INSTRUCTION_ACCESS_OFFSET (0x2U) |
| 100 | #define FFA_INSTRUCTION_ACCESS_MASK ((0x3U) << FFA_INSTRUCTION_ACCESS_OFFSET) |
| 101 | |
| 102 | #define FFA_MEMORY_TYPE_OFFSET (0x4U) |
| 103 | #define FFA_MEMORY_TYPE_MASK ((0x3U) << FFA_MEMORY_TYPE_OFFSET) |
| 104 | |
| 105 | #define FFA_MEMORY_CACHEABILITY_OFFSET (0x2U) |
| 106 | #define FFA_MEMORY_CACHEABILITY_MASK ((0x3U) << FFA_MEMORY_CACHEABILITY_OFFSET) |
| 107 | |
| 108 | #define FFA_MEMORY_SHAREABILITY_OFFSET (0x0U) |
| 109 | #define FFA_MEMORY_SHAREABILITY_MASK ((0x3U) << FFA_MEMORY_SHAREABILITY_OFFSET) |
| 110 | |
| 111 | #define ATTR_FUNCTION_SET(name, container_type, offset, mask) \ |
| 112 | static inline void ffa_set_##name##_attr(container_type *attr, \ |
| 113 | const enum ffa_##name perm) \ |
| 114 | { \ |
| 115 | *attr = (*attr & ~(mask)) | ((perm << offset) & mask); \ |
| 116 | } |
| 117 | |
| 118 | #define ATTR_FUNCTION_GET(name, container_type, offset, mask) \ |
| 119 | static inline enum ffa_##name ffa_get_##name##_attr( \ |
| 120 | container_type attr) \ |
| 121 | { \ |
| 122 | return (enum ffa_##name)((attr & mask) >> offset); \ |
| 123 | } |
| 124 | |
| 125 | ATTR_FUNCTION_SET(data_access, ffa_memory_access_permissions_t, |
| 126 | FFA_DATA_ACCESS_OFFSET, FFA_DATA_ACCESS_MASK) |
| 127 | ATTR_FUNCTION_GET(data_access, ffa_memory_access_permissions_t, |
| 128 | FFA_DATA_ACCESS_OFFSET, FFA_DATA_ACCESS_MASK) |
| 129 | |
| 130 | ATTR_FUNCTION_SET(instruction_access, ffa_memory_access_permissions_t, |
| 131 | FFA_INSTRUCTION_ACCESS_OFFSET, FFA_INSTRUCTION_ACCESS_MASK) |
| 132 | ATTR_FUNCTION_GET(instruction_access, ffa_memory_access_permissions_t, |
| 133 | FFA_INSTRUCTION_ACCESS_OFFSET, FFA_INSTRUCTION_ACCESS_MASK) |
| 134 | |
| 135 | ATTR_FUNCTION_SET(memory_type, ffa_memory_attributes_t, FFA_MEMORY_TYPE_OFFSET, |
| 136 | FFA_MEMORY_TYPE_MASK) |
| 137 | ATTR_FUNCTION_GET(memory_type, ffa_memory_attributes_t, FFA_MEMORY_TYPE_OFFSET, |
| 138 | FFA_MEMORY_TYPE_MASK) |
| 139 | |
| 140 | ATTR_FUNCTION_SET(memory_cacheability, ffa_memory_attributes_t, |
| 141 | FFA_MEMORY_CACHEABILITY_OFFSET, FFA_MEMORY_CACHEABILITY_MASK) |
| 142 | ATTR_FUNCTION_GET(memory_cacheability, ffa_memory_attributes_t, |
| 143 | FFA_MEMORY_CACHEABILITY_OFFSET, FFA_MEMORY_CACHEABILITY_MASK) |
| 144 | |
| 145 | ATTR_FUNCTION_SET(memory_shareability, ffa_memory_attributes_t, |
| 146 | FFA_MEMORY_SHAREABILITY_OFFSET, FFA_MEMORY_SHAREABILITY_MASK) |
| 147 | ATTR_FUNCTION_GET(memory_shareability, ffa_memory_attributes_t, |
| 148 | FFA_MEMORY_SHAREABILITY_OFFSET, FFA_MEMORY_SHAREABILITY_MASK) |
| 149 | |
| 150 | #define FFA_MEMORY_HANDLE_ALLOCATOR_MASK \ |
| 151 | ((ffa_memory_handle_t)(UINT64_C(1) << 63)) |
| 152 | #define FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR \ |
| 153 | ((ffa_memory_handle_t)(UINT64_C(1) << 63)) |
| 154 | #define FFA_MEMORY_HANDLE_INVALID (~UINT64_C(0)) |
| 155 | |
| 156 | /** |
| 157 | * A set of contiguous pages which is part of a memory region. This corresponds |
| 158 | * to table "Constituent memory region descriptor" of the FFA 1.0 specification. |
| 159 | */ |
| 160 | struct ffa_memory_region_constituent { |
| 161 | /** |
| 162 | * The base IPA of the constituent memory region, aligned to 4 kiB page |
| 163 | * size granularity. |
| 164 | */ |
| 165 | void *address; |
| 166 | /** The number of 4 kiB pages in the constituent memory region. */ |
| 167 | uint32_t page_count; |
| 168 | /** Reserved field, must be 0. */ |
| 169 | uint32_t reserved; |
| 170 | }; |
| 171 | |
| 172 | /** |
| 173 | * A set of pages comprising a memory region. This corresponds to table |
| 174 | * "Composite memory region descriptor" of the FFA 1.0 specification. |
| 175 | */ |
| 176 | struct ffa_composite_memory_region { |
| 177 | /** |
| 178 | * The total number of 4 kiB pages included in this memory region. This |
| 179 | * must be equal to the sum of page counts specified in each |
| 180 | * `ffa_memory_region_constituent`. |
| 181 | */ |
| 182 | uint32_t page_count; |
| 183 | /** |
| 184 | * The number of constituents (`ffa_memory_region_constituent`) |
| 185 | * included in this memory region range. |
| 186 | */ |
| 187 | uint32_t constituent_count; |
| 188 | /** Reserved field, must be 0. */ |
| 189 | uint64_t reserved_0; |
| 190 | /** An array of `constituent_count` memory region constituents. */ |
| 191 | struct ffa_memory_region_constituent constituents[]; |
| 192 | }; |
| 193 | |
| 194 | /** |
| 195 | * This corresponds to table "Memory access permissions descriptor" of the FFA |
| 196 | * 1.0 specification. |
| 197 | */ |
| 198 | struct ffa_memory_region_attributes { |
| 199 | /** The ID of the VM to which the memory is being given or shared. */ |
| 200 | ffa_vm_id_t receiver; |
| 201 | /** |
| 202 | * The permissions with which the memory region should be mapped in the |
| 203 | * receiver's page table. |
| 204 | */ |
| 205 | ffa_memory_access_permissions_t permissions; |
| 206 | /** |
| 207 | * Flags used during FFA_MEM_RETRIEVE_REQ and FFA_MEM_RETRIEVE_RESP |
| 208 | * for memory regions with multiple borrowers. |
| 209 | */ |
| 210 | ffa_memory_receiver_flags_t flags; |
| 211 | }; |
| 212 | |
| 213 | /** Flags to control the behaviour of a memory sharing transaction. */ |
| 214 | typedef uint32_t ffa_memory_region_flags_t; |
| 215 | |
| 216 | /** |
| 217 | * Clear memory region contents after unmapping it from the sender and before |
| 218 | * mapping it for any receiver. |
| 219 | */ |
| 220 | #define FFA_MEMORY_REGION_FLAG_CLEAR 0x1U |
| 221 | |
| 222 | /** |
| 223 | * Whether the hypervisor may time slice the memory sharing or retrieval |
| 224 | * operation. |
| 225 | */ |
| 226 | #define FFA_MEMORY_REGION_FLAG_TIME_SLICE 0x2U |
| 227 | |
| 228 | /** |
| 229 | * Whether the hypervisor should clear the memory region after the receiver |
| 230 | * relinquishes it or is aborted. |
| 231 | */ |
| 232 | #define FFA_MEMORY_REGION_FLAG_CLEAR_RELINQUISH 0x4U |
| 233 | |
| 234 | #define FFA_MEMORY_REGION_TRANSACTION_TYPE_MASK ((0x3U) << 3) |
| 235 | #define FFA_MEMORY_REGION_TRANSACTION_TYPE_UNSPECIFIED ((0x0U) << 3) |
| 236 | #define FFA_MEMORY_REGION_TRANSACTION_TYPE_SHARE ((0x1U) << 3) |
| 237 | #define FFA_MEMORY_REGION_TRANSACTION_TYPE_LEND ((0x2U) << 3) |
| 238 | #define FFA_MEMORY_REGION_TRANSACTION_TYPE_DONATE ((0x3U) << 3) |
| 239 | |
J-Alves | 0435cae | 2020-11-06 10:49:56 +0000 | [diff] [blame] | 240 | /** The maximum number of recipients a memory region may be sent to. */ |
| 241 | #define MAX_MEM_SHARE_RECIPIENTS 1U |
| 242 | |
J-Alves | f3a393c | 2020-10-23 16:00:39 +0100 | [diff] [blame] | 243 | /** |
| 244 | * This corresponds to table "Endpoint memory access descriptor" of the FFA 1.0 |
| 245 | * specification. |
| 246 | */ |
| 247 | struct ffa_memory_access { |
| 248 | struct ffa_memory_region_attributes receiver_permissions; |
| 249 | /** |
| 250 | * Offset in bytes from the start of the outer `ffa_memory_region` to |
| 251 | * an `ffa_composite_memory_region` struct. |
| 252 | */ |
| 253 | uint32_t composite_memory_region_offset; |
| 254 | uint64_t reserved_0; |
| 255 | }; |
| 256 | |
| 257 | /** |
| 258 | * Information about a set of pages which are being shared. This corresponds to |
| 259 | * table "Lend, donate or share memory transaction descriptor" of the FFA |
| 260 | * 1.0 specification. Note that it is also used for retrieve requests and |
| 261 | * responses. |
| 262 | */ |
| 263 | struct ffa_memory_region { |
| 264 | /** |
| 265 | * The ID of the VM which originally sent the memory region, i.e. the |
| 266 | * owner. |
| 267 | */ |
| 268 | ffa_vm_id_t sender; |
| 269 | ffa_memory_attributes_t attributes; |
| 270 | /** Reserved field, must be 0. */ |
| 271 | uint8_t reserved_0; |
| 272 | /** Flags to control behaviour of the transaction. */ |
| 273 | ffa_memory_region_flags_t flags; |
| 274 | ffa_memory_handle_t handle; |
| 275 | /** |
| 276 | * An implementation defined value associated with the receiver and the |
| 277 | * memory region. |
| 278 | */ |
| 279 | uint64_t tag; |
| 280 | /** Reserved field, must be 0. */ |
| 281 | uint32_t reserved_1; |
| 282 | /** |
| 283 | * The number of `ffa_memory_access` entries included in this |
| 284 | * transaction. |
| 285 | */ |
| 286 | uint32_t receiver_count; |
| 287 | /** |
| 288 | * An array of `attribute_count` endpoint memory access descriptors. |
| 289 | * Each one specifies a memory region offset, an endpoint and the |
| 290 | * attributes with which this memory region should be mapped in that |
| 291 | * endpoint's page table. |
| 292 | */ |
| 293 | struct ffa_memory_access receivers[]; |
| 294 | }; |
| 295 | |
| 296 | /** |
| 297 | * Descriptor used for FFA_MEM_RELINQUISH requests. This corresponds to table |
| 298 | * "Descriptor to relinquish a memory region" of the FFA 1.0 specification. |
| 299 | */ |
| 300 | struct ffa_mem_relinquish { |
| 301 | ffa_memory_handle_t handle; |
| 302 | ffa_memory_region_flags_t flags; |
| 303 | uint32_t endpoint_count; |
| 304 | ffa_vm_id_t endpoints[]; |
| 305 | }; |
| 306 | |
| 307 | static inline ffa_memory_handle_t ffa_assemble_handle(uint32_t h1, uint32_t h2) |
| 308 | { |
| 309 | return (uint64_t)h1 | (uint64_t)h2 << 32; |
| 310 | } |
| 311 | |
| 312 | static inline ffa_memory_handle_t ffa_mem_success_handle(smc_ret_values r) |
| 313 | { |
| 314 | return ffa_assemble_handle(r.ret2, r.ret3); |
| 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Gets the `ffa_composite_memory_region` for the given receiver from an |
| 319 | * `ffa_memory_region`, or NULL if it is not valid. |
| 320 | */ |
| 321 | static inline struct ffa_composite_memory_region * |
| 322 | ffa_memory_region_get_composite(struct ffa_memory_region *memory_region, |
| 323 | uint32_t receiver_index) |
| 324 | { |
| 325 | uint32_t offset = memory_region->receivers[receiver_index] |
| 326 | .composite_memory_region_offset; |
| 327 | |
| 328 | if (offset == 0) { |
| 329 | return NULL; |
| 330 | } |
| 331 | |
| 332 | return (struct ffa_composite_memory_region *)((uint8_t *)memory_region + |
| 333 | offset); |
| 334 | } |
| 335 | |
| 336 | static inline uint32_t ffa_mem_relinquish_init( |
| 337 | struct ffa_mem_relinquish *relinquish_request, |
| 338 | ffa_memory_handle_t handle, ffa_memory_region_flags_t flags, |
| 339 | ffa_vm_id_t sender) |
| 340 | { |
| 341 | relinquish_request->handle = handle; |
| 342 | relinquish_request->flags = flags; |
| 343 | relinquish_request->endpoint_count = 1; |
| 344 | relinquish_request->endpoints[0] = sender; |
| 345 | return sizeof(struct ffa_mem_relinquish) + sizeof(ffa_vm_id_t); |
| 346 | } |
| 347 | |
| 348 | uint32_t ffa_memory_retrieve_request_init( |
| 349 | struct ffa_memory_region *memory_region, ffa_memory_handle_t handle, |
| 350 | ffa_vm_id_t sender, ffa_vm_id_t receiver, uint32_t tag, |
| 351 | ffa_memory_region_flags_t flags, enum ffa_data_access data_access, |
| 352 | enum ffa_instruction_access instruction_access, |
| 353 | enum ffa_memory_type type, enum ffa_memory_cacheability cacheability, |
| 354 | enum ffa_memory_shareability shareability); |
| 355 | |
| 356 | uint32_t ffa_memory_region_init( |
| 357 | struct ffa_memory_region *memory_region, size_t memory_region_max_size, |
| 358 | ffa_vm_id_t sender, ffa_vm_id_t receiver, |
| 359 | const struct ffa_memory_region_constituent constituents[], |
| 360 | uint32_t constituent_count, uint32_t tag, |
| 361 | ffa_memory_region_flags_t flags, enum ffa_data_access data_access, |
| 362 | enum ffa_instruction_access instruction_access, |
| 363 | enum ffa_memory_type type, enum ffa_memory_cacheability cacheability, |
| 364 | enum ffa_memory_shareability shareability, uint32_t *total_length, |
| 365 | uint32_t *fragment_length); |
| 366 | |
J-Alves | 3106b07 | 2020-11-18 10:37:21 +0000 | [diff] [blame] | 367 | ffa_memory_handle_t ffa_memory_send( |
| 368 | struct ffa_memory_region *memory_region, uint32_t mem_func, |
| 369 | uint32_t fragment_length, uint32_t total_length); |
| 370 | |
| 371 | ffa_memory_handle_t ffa_memory_init_and_send( |
| 372 | struct ffa_memory_region *memory_region, size_t memory_region_max_size, |
| 373 | ffa_vm_id_t sender, ffa_vm_id_t receiver, |
| 374 | const struct ffa_memory_region_constituent* constituents, |
| 375 | uint32_t constituents_count, uint32_t mem_func); |
| 376 | |
J-Alves | 6cb21d9 | 2021-01-07 15:18:12 +0000 | [diff] [blame^] | 377 | static inline ffa_vm_id_t ffa_dir_msg_dest(smc_ret_values val) { |
| 378 | return (ffa_vm_id_t)val.ret1 & U(0xFFFF); |
| 379 | } |
| 380 | |
| 381 | static inline ffa_vm_id_t ffa_dir_msg_source(smc_ret_values val) { |
| 382 | return (ffa_vm_id_t)(val.ret1 >> 16U); |
| 383 | } |
| 384 | |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 385 | smc_ret_values ffa_msg_send_direct_req(uint32_t source_id, uint32_t dest_id, uint32_t message); |
J-Alves | d1aae29 | 2020-10-08 17:16:58 +0100 | [diff] [blame] | 386 | smc_ret_values ffa_msg_send_direct_req64_5args(uint32_t source_id, uint32_t dest_id, |
| 387 | uint64_t arg0, uint64_t arg1, |
| 388 | uint64_t arg2, uint64_t arg3, |
| 389 | uint64_t arg4); |
| 390 | |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 391 | smc_ret_values ffa_run(uint32_t dest_id, uint32_t vcpu_id); |
J-Alves | 8f08a05 | 2020-05-26 17:14:40 +0100 | [diff] [blame] | 392 | smc_ret_values ffa_version(uint32_t input_version); |
J-Alves | 5aecd98 | 2020-06-11 10:25:33 +0100 | [diff] [blame] | 393 | smc_ret_values ffa_id_get(void); |
| 394 | smc_ret_values ffa_msg_wait(void); |
| 395 | smc_ret_values ffa_msg_send_direct_resp(ffa_vm_id_t source_id, |
| 396 | ffa_vm_id_t dest_id, uint32_t message); |
| 397 | smc_ret_values ffa_error(int32_t error_code); |
Max Shvetsov | c17c1d3 | 2020-06-11 15:03:01 +0100 | [diff] [blame] | 398 | smc_ret_values ffa_features(uint32_t feature); |
Max Shvetsov | c32f478 | 2020-06-23 09:41:15 +0100 | [diff] [blame] | 399 | smc_ret_values ffa_partition_info_get(const uint32_t uuid[4]); |
| 400 | smc_ret_values ffa_rx_release(void); |
Ruari Phipps | bd0a7e4 | 2020-07-17 16:42:21 +0100 | [diff] [blame] | 401 | smc_ret_values ffa_rxtx_map(uintptr_t send, uintptr_t recv, uint32_t pages); |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 402 | |
J-Alves | 3ea46d1 | 2020-09-09 11:13:05 +0100 | [diff] [blame] | 403 | smc_ret_values ffa_mem_donate(uint32_t descriptor_length, |
| 404 | uint32_t fragment_length); |
| 405 | smc_ret_values ffa_mem_lend(uint32_t descriptor_length, |
| 406 | uint32_t fragment_length); |
| 407 | smc_ret_values ffa_mem_share(uint32_t descriptor_length, |
| 408 | uint32_t fragment_length); |
| 409 | smc_ret_values ffa_mem_retrieve_req(uint32_t descriptor_length, |
| 410 | uint32_t fragment_length); |
| 411 | smc_ret_values ffa_mem_relinquish(void); |
| 412 | smc_ret_values ffa_mem_reclaim(uint64_t handle, uint32_t flags); |
| 413 | |
J-Alves | 7581c38 | 2020-05-07 18:34:20 +0100 | [diff] [blame] | 414 | #endif /* __ASSEMBLY__ */ |
| 415 | |
| 416 | #endif /* FFA_HELPERS_H */ |