Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The Hafnium Authors. |
| 3 | * |
Andrew Walbran | e959ec1 | 2020-06-17 15:01:09 +0100 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style |
| 5 | * license that can be found in the LICENSE file or at |
| 6 | * https://opensource.org/licenses/BSD-3-Clause. |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "hf/mpool.h" |
| 12 | #include "hf/vm.h" |
| 13 | |
| 14 | #include "vmapi/hf/ffa.h" |
| 15 | |
Daniel Boulby | 296ee70 | 2023-11-28 13:36:55 +0000 | [diff] [blame] | 16 | bool is_ffa_hypervisor_retrieve_request(struct ffa_memory_region *request); |
Daniel Boulby | 44e9b3b | 2024-01-17 12:21:44 +0000 | [diff] [blame] | 17 | |
Daniel Boulby | c7dc932 | 2023-10-27 15:12:07 +0100 | [diff] [blame] | 18 | bool ffa_memory_region_sanity_check(struct ffa_memory_region *memory_region, |
Karl Meakin | 0e617d9 | 2024-04-05 12:55:22 +0100 | [diff] [blame] | 19 | enum ffa_version ffa_version, |
Daniel Boulby | c7dc932 | 2023-10-27 15:12:07 +0100 | [diff] [blame] | 20 | uint32_t fragment_length, |
| 21 | bool send_transaction); |
| 22 | |
Andrew Walbran | 1a86aa9 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 23 | struct ffa_value ffa_memory_send(struct vm_locked from_locked, |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 24 | struct ffa_memory_region *memory_region, |
Andrew Walbran | 130a8ae | 2020-05-15 16:27:15 +0100 | [diff] [blame] | 25 | uint32_t memory_share_length, |
Andrew Walbran | 1a86aa9 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 26 | uint32_t fragment_length, uint32_t share_func, |
| 27 | struct mpool *page_pool); |
Andrew Walbran | ca808b1 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 28 | struct ffa_value ffa_memory_send_continue(struct vm_locked from_locked, |
| 29 | void *fragment, |
| 30 | uint32_t fragment_length, |
| 31 | ffa_memory_handle_t handle, |
| 32 | struct mpool *page_pool); |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 33 | struct ffa_value ffa_memory_retrieve(struct vm_locked to_locked, |
| 34 | struct ffa_memory_region *retrieve_request, |
Andrew Walbran | 130a8ae | 2020-05-15 16:27:15 +0100 | [diff] [blame] | 35 | uint32_t retrieve_request_length, |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 36 | struct mpool *page_pool); |
Andrew Walbran | ca808b1 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 37 | struct ffa_value ffa_memory_retrieve_continue(struct vm_locked to_locked, |
| 38 | ffa_memory_handle_t handle, |
| 39 | uint32_t fragment_offset, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 40 | ffa_id_t sender_vm_id, |
J-Alves | c3fd975 | 2024-04-04 11:45:33 +0100 | [diff] [blame] | 41 | void *retrieve_continue_page, |
Andrew Walbran | ca808b1 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 42 | struct mpool *page_pool); |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 43 | struct ffa_value ffa_memory_relinquish( |
| 44 | struct vm_locked from_locked, |
| 45 | struct ffa_mem_relinquish *relinquish_request, struct mpool *page_pool); |
| 46 | struct ffa_value ffa_memory_reclaim(struct vm_locked to_locked, |
Andrew Walbran | ca808b1 | 2020-05-15 17:22:28 +0100 | [diff] [blame] | 47 | ffa_memory_handle_t handle, |
| 48 | ffa_memory_region_flags_t flags, |
Andrew Walbran | b5ab43c | 2020-04-30 11:32:54 +0100 | [diff] [blame] | 49 | struct mpool *page_pool); |