blob: 5dbdc348e6cb209e22b15ab0279ead59c91cad08 [file] [log] [blame]
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +00001/*
2 * Copyright 2021 The Hafnium Authors.
3 *
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.
7 */
8
9#include "hf/ffa.h"
10
J-Alvesa0f317d2021-06-09 13:31:59 +010011#include "hf/ffa_internal.h"
Olivier Deprez55a189e2021-06-09 15:45:27 +020012#include "hf/vcpu.h"
J-Alvesc003a7a2021-03-18 13:06:53 +000013#include "hf/vm.h"
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000014
Daniel Boulby87b2dc82021-08-04 14:07:43 +010015struct ffa_value arch_ffa_features(uint32_t function_id)
16{
17 (void)function_id;
18 return ffa_error(FFA_NOT_SUPPORTED);
19}
20
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000021ffa_vm_id_t arch_ffa_spmc_id_get(void)
22{
23 return HF_SPMC_VM_ID;
24}
Olivier Deprez55a189e2021-06-09 15:45:27 +020025
26void plat_ffa_log_init(void)
27{
28}
29
30bool plat_ffa_is_direct_request_valid(struct vcpu *current,
31 ffa_vm_id_t sender_vm_id,
32 ffa_vm_id_t receiver_vm_id)
33{
34 (void)current;
35 (void)sender_vm_id;
36 (void)receiver_vm_id;
37
38 return true;
39}
40
41bool plat_ffa_is_direct_response_valid(struct vcpu *current,
42 ffa_vm_id_t sender_vm_id,
43 ffa_vm_id_t receiver_vm_id)
44{
45 (void)current;
46 (void)sender_vm_id;
47 (void)receiver_vm_id;
48
49 return true;
50}
51
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070052bool plat_ffa_run_forward(ffa_vm_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
53 struct ffa_value *ret)
54{
55 (void)vm_id;
56 (void)vcpu_idx;
57 (void)ret;
58
59 return false;
60}
61
Olivier Deprez55a189e2021-06-09 15:45:27 +020062bool plat_ffa_direct_request_forward(ffa_vm_id_t receiver_vm_id,
63 struct ffa_value args,
64 struct ffa_value *ret)
65{
66 (void)receiver_vm_id;
67 (void)args;
68 (void)ret;
69 return false;
70}
71
72ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
73{
74 return index;
75}
76
77bool plat_ffa_memory_handle_allocated_by_current_world(
78 ffa_memory_handle_t handle)
79{
80 (void)handle;
81 return false;
82}
Maksims Svecovsb596eab2021-04-27 00:52:27 +010083
J-Alvesc003a7a2021-03-18 13:06:53 +000084bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
85 ffa_vm_id_t sender_id,
86 ffa_vm_id_t receiver_id)
87{
88 (void)current;
89 (void)sender_id;
90 (void)receiver_id;
91 return false;
92}
93
J-Alvesb15e9402021-09-08 11:44:42 +010094bool plat_ffa_notifications_update_bindings_forward(
95 ffa_vm_id_t receiver_id, ffa_vm_id_t sender_id, uint32_t flags,
96 ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret)
97{
98 (void)ret;
99 (void)receiver_id;
100 (void)sender_id;
101 (void)flags;
102 (void)bitmap;
103 (void)is_bind;
104 (void)ret;
105
106 return false;
107}
108
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100109ffa_partition_properties_t plat_ffa_partition_properties(
110 ffa_vm_id_t current_id, const struct vm *target)
111{
112 (void)current_id;
113 (void)target;
114 return 0;
115}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100116
117bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
118{
119 (void)vm;
120 return false;
121}
J-Alvesa0f317d2021-06-09 13:31:59 +0100122
123bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
124 ffa_vm_id_t vm_id)
125{
126 (void)current;
127 (void)vm_id;
128
129 return false;
130}
131
J-Alvesaa79c012021-07-09 14:29:45 +0100132bool plat_ffa_is_notification_set_valid(struct vcpu *current,
133 ffa_vm_id_t sender_id,
134 ffa_vm_id_t receiver_id)
135{
136 (void)current;
137 (void)sender_id;
138 (void)receiver_id;
139 return false;
140}
141
142bool plat_ffa_is_notification_get_valid(struct vcpu *current,
143 ffa_vm_id_t receiver_id)
144{
145 (void)current;
146 (void)receiver_id;
147 return false;
148}
149
J-Alves98ff9562021-09-09 14:39:41 +0100150bool plat_ffa_notifications_get_from_sp(
151 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
152 const ffa_notifications_bitmap_t *from_sp, struct ffa_value *ret)
153{
154 (void)receiver_locked;
155 (void)vcpu_id;
156 (void)from_sp;
157 (void)ret;
158
159 return false;
160}
161
J-Alvesde7bd2f2021-09-09 19:54:35 +0100162bool plat_ffa_notification_set_forward(ffa_vm_id_t sender_vm_id,
163 ffa_vm_id_t receiver_vm_id,
164 uint32_t flags,
165 ffa_notifications_bitmap_t bitmap,
166 struct ffa_value *ret)
167{
168 (void)sender_vm_id;
169 (void)receiver_vm_id;
170 (void)flags;
171 (void)bitmap;
172 (void)ret;
173
174 return false;
175}
176
J-Alvesa0f317d2021-06-09 13:31:59 +0100177struct ffa_value plat_ffa_notifications_bitmap_create(
178 ffa_vm_id_t vm_id, ffa_vcpu_count_t vcpu_count)
179{
180 (void)vm_id;
181 (void)vcpu_count;
182
183 return ffa_error(FFA_NOT_SUPPORTED);
184}
185
186struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_vm_id_t vm_id)
187{
188 (void)vm_id;
189
190 return ffa_error(FFA_NOT_SUPPORTED);
191}
J-Alvesc003a7a2021-03-18 13:06:53 +0000192
193struct vm_locked plat_ffa_vm_find_locked(ffa_vm_id_t vm_id)
194{
195 (void)vm_id;
196 return (struct vm_locked){.vm = NULL};
197}
198
199bool plat_ffa_is_vm_id(ffa_vm_id_t vm_id)
200{
201 (void)vm_id;
202 return false;
203}
J-Alvesc8e8a222021-06-08 17:33:52 +0100204
205bool plat_ffa_vm_notifications_info_get(const uint16_t *ids,
206 const uint32_t *ids_count,
207 const uint32_t *lists_sizes,
208 const uint32_t *lists_count,
209 const uint32_t ids_count_max)
210{
211 (void)ids;
212 (void)ids_count;
213 (void)lists_sizes;
214 (void)lists_count;
215 (void)ids_count_max;
216
217 return false;
218}