refactor(ffa): remove `plat` prefix
Rename files to remove the `plat` prefix and replace with a
module-specific prefix.
Change-Id: Ie64cefcdf91da7b20e520828d8e234af12ab5c85
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/ffa/cpu_cycles.h b/inc/hf/ffa/cpu_cycles.h
index c91268b..88b959c 100644
--- a/inc/hf/ffa/cpu_cycles.h
+++ b/inc/hf/ffa/cpu_cycles.h
@@ -15,35 +15,33 @@
/**
* Forward normal world calls of FFA_RUN ABI to other world.
*/
-bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
- struct ffa_value *ret);
+bool ffa_cpu_cycles_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
+ struct ffa_value *ret);
-struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
- struct vcpu **next);
+struct ffa_value ffa_cpu_cycles_msg_wait_prepare(
+ struct vcpu_locked current_locked, struct vcpu **next);
/**
* Check if current SP can resume target VM/SP using FFA_RUN ABI.
*/
-bool plat_ffa_run_checks(struct vcpu_locked current_locked,
- ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
- struct ffa_value *run_ret, struct vcpu **next);
+bool ffa_cpu_cycles_run_checks(struct vcpu_locked current_locked,
+ ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
+ struct ffa_value *run_ret, struct vcpu **next);
/**
* Perform checks for the state transition being requested by the Partition
* based on it's runtime model and return false if an illegal transition is
* being performed.
*/
-bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
- ffa_id_t vm_id,
- ffa_id_t receiver_vm_id,
- struct vcpu_locked locked_vcpu,
- uint32_t func,
- enum vcpu_state *next_state);
+bool ffa_cpu_cycles_check_runtime_state_transition(
+ struct vcpu_locked current_locked, ffa_id_t vm_id,
+ ffa_id_t receiver_vm_id, struct vcpu_locked locked_vcpu, uint32_t func,
+ enum vcpu_state *next_state);
-void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
- struct vcpu_locked target_locked);
+void ffa_cpu_cycles_init_schedule_mode_ffa_runeld_prepare(
+ struct vcpu_locked current_locked, struct vcpu_locked target_locked);
-struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
- struct vcpu **next,
- uint32_t timeout_low,
- uint32_t timeout_high);
+struct ffa_value ffa_cpu_cycles_yield_prepare(struct vcpu_locked current_locked,
+ struct vcpu **next,
+ uint32_t timeout_low,
+ uint32_t timeout_high);
diff --git a/inc/hf/ffa/direct_messaging.h b/inc/hf/ffa/direct_messaging.h
index d19e758..eb87da8 100644
--- a/inc/hf/ffa/direct_messaging.h
+++ b/inc/hf/ffa/direct_messaging.h
@@ -12,26 +12,26 @@
#include "hf/vm.h"
/** Check validity of a FF-A direct message request. */
-bool plat_ffa_is_direct_request_valid(struct vcpu *current,
- ffa_id_t sender_vm_id,
- ffa_id_t receiver_vm_id);
+bool ffa_direct_msg_is_direct_request_valid(struct vcpu *current,
+ ffa_id_t sender_vm_id,
+ ffa_id_t receiver_vm_id);
/** Check validity of a FF-A direct message response. */
-bool plat_ffa_is_direct_response_valid(struct vcpu *current,
- ffa_id_t sender_vm_id,
- ffa_id_t receiver_vm_id);
+bool ffa_direct_msg_is_direct_response_valid(struct vcpu *current,
+ ffa_id_t sender_vm_id,
+ ffa_id_t receiver_vm_id);
-bool plat_ffa_is_direct_request_supported(struct vm *sender_vm,
- struct vm *receiver_vm,
- uint32_t func);
+bool ffa_direct_msg_is_direct_request_supported(struct vm *sender_vm,
+ struct vm *receiver_vm,
+ uint32_t func);
-bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
- struct ffa_value args,
- struct ffa_value *ret);
+bool ffa_direct_msg_direct_request_forward(ffa_id_t receiver_vm_id,
+ struct ffa_value args,
+ struct ffa_value *ret);
-void plat_ffa_wind_call_chain_ffa_direct_req(
+void ffa_direct_msg_wind_call_chain_ffa_direct_req(
struct vcpu_locked current_locked,
struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id);
-void plat_ffa_unwind_call_chain_ffa_direct_resp(
+void ffa_direct_msg_unwind_call_chain_ffa_direct_resp(
struct vcpu_locked current_locked, struct vcpu_locked next_locked);
diff --git a/inc/hf/ffa/ffa_memory.h b/inc/hf/ffa/ffa_memory.h
index 62d876f..ee00e14 100644
--- a/inc/hf/ffa/ffa_memory.h
+++ b/inc/hf/ffa/ffa_memory.h
@@ -12,29 +12,28 @@
#include "hf/vm.h"
/** Check validity of the FF-A memory send function attempt. */
-bool plat_ffa_is_memory_send_valid(ffa_id_t receiver, ffa_id_t sender,
- uint32_t share_func, bool multiple_borrower);
+bool ffa_memory_is_send_valid(ffa_id_t receiver, ffa_id_t sender,
+ uint32_t share_func, bool multiple_borrower);
-enum ffa_memory_handle_allocator plat_ffa_memory_handle_allocator(void);
+enum ffa_memory_handle_allocator ffa_memory_get_handle_allocator(void);
/**
* Encodes memory handle according to section 5.10.2 of the FF-A v1.0 spec.
*/
-static inline ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
+static inline ffa_memory_handle_t ffa_memory_make_handle(uint64_t index)
{
- return ffa_memory_handle_make(index,
- plat_ffa_memory_handle_allocator());
+ return ffa_memory_handle_make(index, ffa_memory_get_handle_allocator());
}
/**
* Checks whether given handle was allocated by current world, according to
* handle encoding rules.
*/
-static inline bool plat_ffa_memory_handle_allocated_by_current_world(
+static inline bool ffa_memory_is_handle_allocated_by_current_world(
ffa_memory_handle_t handle)
{
return ffa_memory_handle_allocator(handle) ==
- plat_ffa_memory_handle_allocator();
+ ffa_memory_get_handle_allocator();
}
/**
@@ -42,15 +41,15 @@
* it. The SPMC will return MM_MODE_NS, and the hypervisor 0 as it only deals
* with NS accesses by default.
*/
-uint32_t plat_ffa_other_world_mode(void);
+uint32_t ffa_memory_get_other_world_mode(void);
-bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current);
-bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current);
+bool ffa_memory_is_mem_perm_get_valid(const struct vcpu *current);
+bool ffa_memory_is_mem_perm_set_valid(const struct vcpu *current);
/*
* Handles FF-A memory share calls with recipients from the other world.
*/
-struct ffa_value plat_ffa_other_world_mem_send(
+struct ffa_value ffa_memory_other_world_mem_send(
struct vm *from, uint32_t share_func,
struct ffa_memory_region **memory_region, uint32_t length,
uint32_t fragment_length, struct mpool *page_pool);
@@ -59,7 +58,7 @@
* Handles the memory reclaim if a memory handle from the other world is
* provided.
*/
-struct ffa_value plat_ffa_other_world_mem_reclaim(
+struct ffa_value ffa_memory_other_world_mem_reclaim(
struct vm *to, ffa_memory_handle_t handle,
ffa_memory_region_flags_t flags, struct mpool *page_pool);
@@ -67,12 +66,12 @@
* Handles the continuation of the memory send operation in case the memory
* region descriptor contains multiple segments.
*/
-struct ffa_value plat_ffa_other_world_mem_send_continue(
+struct ffa_value ffa_memory_other_world_mem_send_continue(
struct vm *from, void *fragment, uint32_t fragment_length,
ffa_memory_handle_t handle, struct mpool *page_pool);
/*
* Set the security bit in `attributes` if specified by `mode`.
*/
-ffa_memory_attributes_t plat_ffa_memory_add_security_bit_from_mode(
+ffa_memory_attributes_t ffa_memory_add_security_bit_from_mode(
ffa_memory_attributes_t attributes, uint32_t mode);
diff --git a/inc/hf/ffa/indirect_messaging.h b/inc/hf/ffa/indirect_messaging.h
index 21aabbd..08da12a 100644
--- a/inc/hf/ffa/indirect_messaging.h
+++ b/inc/hf/ffa/indirect_messaging.h
@@ -10,20 +10,22 @@
#include "hf/vm.h"
-bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked,
- struct vm_locked receiver_locked);
+bool ffa_indirect_msg_is_supported(struct vm_locked sender_locked,
+ struct vm_locked receiver_locked);
-bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
- struct ffa_value *ret);
+bool ffa_indirect_msg_send2_forward(ffa_id_t receiver_vm_id,
+ ffa_id_t sender_vm_id,
+ struct ffa_value *ret);
/**
* This FF-A v1.0 FFA_MSG_SEND interface.
* Implemented for the Hypervisor, but not in the SPMC.
*/
-struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
- ffa_id_t receiver_vm_id, uint32_t size,
- struct vcpu *current, struct vcpu **next);
+struct ffa_value ffa_indirect_msg_send(ffa_id_t sender_vm_id,
+ ffa_id_t receiver_vm_id, uint32_t size,
+ struct vcpu *current,
+ struct vcpu **next);
-struct ffa_value plat_ffa_msg_recv(bool block,
- struct vcpu_locked current_locked,
- struct vcpu **next);
+struct ffa_value ffa_indirect_msg_recv(bool block,
+ struct vcpu_locked current_locked,
+ struct vcpu **next);
diff --git a/inc/hf/ffa/interrupts.h b/inc/hf/ffa/interrupts.h
index 8c0d990..398585d 100644
--- a/inc/hf/ffa/interrupts.h
+++ b/inc/hf/ffa/interrupts.h
@@ -13,27 +13,28 @@
/**
* Deactivate interrupt.
*/
-int64_t plat_ffa_interrupt_deactivate(uint32_t pint_id, uint32_t vint_id,
- struct vcpu *current);
+int64_t ffa_interrupts_deactivate(uint32_t pint_id, uint32_t vint_id,
+ struct vcpu *current);
-void plat_ffa_handle_secure_interrupt(struct vcpu *current, struct vcpu **next);
-bool plat_ffa_inject_notification_pending_interrupt(
+void ffa_interrupts_handle_secure_interrupt(struct vcpu *current,
+ struct vcpu **next);
+bool ffa_interrupts_inject_notification_pending_interrupt(
struct vcpu_locked next_locked, struct vcpu_locked current_locked,
struct vm_locked receiver_locked);
-bool plat_ffa_intercept_call(struct vcpu_locked current_locked,
- struct vcpu_locked next_locked,
- struct ffa_value *signal_interrupt);
+bool ffa_interrupts_intercept_call(struct vcpu_locked current_locked,
+ struct vcpu_locked next_locked,
+ struct ffa_value *signal_interrupt);
-struct vcpu *plat_ffa_unwind_nwd_call_chain_interrupt(struct vcpu *current);
+struct vcpu *ffa_interrupts_unwind_nwd_call_chain(struct vcpu *current);
-void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
- struct vm_locked vm_locked);
+void ffa_interrupts_enable_virtual_interrupts(struct vcpu_locked current_locked,
+ struct vm_locked vm_locked);
/**
* Reconfigure the interrupt belonging to the current partition at runtime.
*/
-int64_t plat_ffa_interrupt_reconfigure(uint32_t int_id, uint32_t command,
- uint32_t value, struct vcpu *current);
+int64_t ffa_interrupts_reconfigure(uint32_t int_id, uint32_t command,
+ uint32_t value, struct vcpu *current);
-uint32_t plat_ffa_interrupt_get(struct vcpu_locked current_locked);
+uint32_t ffa_interrupts_get(struct vcpu_locked current_locked);
diff --git a/inc/hf/ffa/notifications.h b/inc/hf/ffa/notifications.h
index 24471e6..95a82c8 100644
--- a/inc/hf/ffa/notifications.h
+++ b/inc/hf/ffa/notifications.h
@@ -11,83 +11,80 @@
#include "hf/ffa.h"
#include "hf/vm.h"
-struct ffa_value plat_ffa_is_notifications_bitmap_access_valid(
- struct vcpu *current, ffa_id_t vm_id);
+struct ffa_value ffa_notifications_is_bitmap_access_valid(struct vcpu *current,
+ ffa_id_t vm_id);
-bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
- ffa_id_t sender_id,
- ffa_id_t receiver_id);
-bool plat_ffa_notifications_update_bindings_forward(
+bool ffa_notifications_is_bind_valid(struct vcpu *current, ffa_id_t sender_id,
+ ffa_id_t receiver_id);
+bool ffa_notifications_update_bindings_forward(
ffa_id_t receiver_id, ffa_id_t sender_id,
ffa_notification_flags_t flags, ffa_notifications_bitmap_t bitmap,
bool is_bind, struct ffa_value *ret);
-bool plat_ffa_is_notification_set_valid(struct vcpu *current,
- ffa_id_t sender_id,
- ffa_id_t receiver_id);
+bool ffa_notifications_is_set_valid(struct vcpu *current, ffa_id_t sender_id,
+ ffa_id_t receiver_id);
-bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
- ffa_id_t receiver_vm_id,
- ffa_notification_flags_t flags,
- ffa_notifications_bitmap_t bitmap,
- struct ffa_value *ret);
+bool ffa_notifications_set_forward(ffa_id_t sender_vm_id,
+ ffa_id_t receiver_vm_id,
+ ffa_notification_flags_t flags,
+ ffa_notifications_bitmap_t bitmap,
+ struct ffa_value *ret);
-bool plat_ffa_is_notification_get_valid(struct vcpu *current,
- ffa_id_t receiver_id,
- ffa_notification_flags_t flags);
+bool ffa_notifications_is_get_valid(struct vcpu *current, ffa_id_t receiver_id,
+ ffa_notification_flags_t flags);
-struct ffa_value plat_ffa_notifications_get_from_sp(
+struct ffa_value ffa_notifications_get_from_sp(
struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
ffa_notifications_bitmap_t *from_sp);
-struct ffa_value plat_ffa_notifications_get_framework_notifications(
+struct ffa_value ffa_notifications_get_framework_notifications(
struct vm_locked receiver_locked, ffa_notifications_bitmap_t *from_fwk,
ffa_notification_flags_t flags, ffa_vcpu_index_t vcpu_id);
/**
* Creates a bitmap for the VM of the given ID.
*/
-struct ffa_value plat_ffa_notifications_bitmap_create(
- ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count);
+struct ffa_value ffa_notifications_bitmap_create(ffa_id_t vm_id,
+ ffa_vcpu_count_t vcpu_count);
/**
* Issues a FFA_NOTIFICATION_BITMAP_CREATE.
* Returns true if the call goes well, and false if call returns with
* FFA_ERROR_32.
*/
-bool plat_ffa_notifications_bitmap_create_call(ffa_id_t vm_id,
- ffa_vcpu_count_t vcpu_count);
+bool ffa_notifications_bitmap_create_call(ffa_id_t vm_id,
+ ffa_vcpu_count_t vcpu_count);
/**
* Destroys the notifications bitmap for the given VM ID.
*/
-struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id);
+struct ffa_value ffa_notifications_bitmap_destroy(ffa_id_t vm_id);
/**
* Helper to send SRI and safely update `ffa_sri_state`, if there has been
* a call to FFA_NOTIFICATION_SET, and the SRI has been delayed.
* To be called at a context switch to the NWd.
*/
-void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu);
+void ffa_notifications_sri_trigger_if_delayed(struct cpu *cpu);
/**
* Helper to send SRI and safely update `ffa_sri_state`, if it hasn't been
* delayed in call to FFA_NOTIFICATION_SET.
*/
-void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu);
+void ffa_notifications_sri_trigger_not_delayed(struct cpu *cpu);
/**
* Track that in current CPU there was a notification set with delay SRI flag.
*/
-void plat_ffa_sri_set_delayed(struct cpu *cpu);
+void ffa_notifications_sri_set_delayed(struct cpu *cpu);
/**
* Initialize Schedule Receiver Interrupts needed in the context of
* notifications support.
*/
-void plat_ffa_sri_init(struct cpu *cpu);
+void ffa_notifications_sri_init(struct cpu *cpu);
-void plat_ffa_notification_info_get_forward(uint16_t *ids, uint32_t *ids_count,
- uint32_t *lists_sizes,
- uint32_t *lists_count,
- uint32_t ids_count_max);
+void ffa_notifications_info_get_forward(uint16_t *ids, uint32_t *ids_count,
+ uint32_t *lists_sizes,
+ uint32_t *lists_count,
+ uint32_t ids_count_max);
diff --git a/inc/hf/ffa/power_management.h b/inc/hf/ffa/power_management.h
deleted file mode 100644
index 68c1b1e..0000000
--- a/inc/hf/ffa/power_management.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2024 The Hafnium Authors.
- *
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file or at
- * https://opensource.org/licenses/BSD-3-Clause.
- */
-
-#pragma once
-
-#include <stdbool.h>
-
-/**
- * Returns true if the FFA_SECONDARY_EP_REGISTER interface is supported at
- * the virtual FF-A instance.
- */
-bool plat_ffa_is_secondary_ep_register_supported(void);
diff --git a/inc/hf/ffa/setup_and_discovery.h b/inc/hf/ffa/setup_and_discovery.h
index 416d422..9b8f89c 100644
--- a/inc/hf/ffa/setup_and_discovery.h
+++ b/inc/hf/ffa/setup_and_discovery.h
@@ -9,40 +9,44 @@
#pragma once
#include "hf/addr.h"
-#include "hf/ffa.h"
-#include "hf/ffa_memory_internal.h"
#include "hf/manifest.h"
#include "hf/vcpu.h"
#include "hf/vm.h"
/** Returns the SPMC ID. */
-struct ffa_value plat_ffa_spmc_id_get(void);
+struct ffa_value ffa_setup_spmc_id_get(void);
-void plat_ffa_rxtx_map_spmc(paddr_t recv, paddr_t send, uint64_t page_count);
+/**
+ * Returns true if the FFA_SECONDARY_EP_REGISTER interface is supported at
+ * the virtual FF-A instance.
+ */
+bool ffa_setup_is_secondary_ep_register_supported(void);
-void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked);
+void ffa_setup_rxtx_map_spmc(paddr_t recv, paddr_t send, uint64_t page_count);
-void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked);
+void ffa_setup_rxtx_map_forward(struct vm_locked vm_locked);
-bool plat_ffa_partition_info_get_regs_forward_allowed(void);
+void ffa_setup_rxtx_unmap_forward(struct vm_locked vm_locked);
-ffa_vm_count_t plat_ffa_partition_info_get_forward(
+bool ffa_setup_partition_info_get_regs_forward_allowed(void);
+
+ffa_vm_count_t ffa_setup_partition_info_get_forward(
const struct ffa_uuid *uuid, uint32_t flags,
struct ffa_partition_info *partitions, ffa_vm_count_t vm_count);
-void plat_ffa_parse_partition_manifest(struct mm_stage1_locked stage1_locked,
- paddr_t fdt_addr,
- size_t fdt_allocated_size,
- const struct manifest_vm *manifest_vm,
- const struct boot_params *boot_params,
- struct mpool *ppool);
+void ffa_setup_parse_partition_manifest(struct mm_stage1_locked stage1_locked,
+ paddr_t fdt_addr,
+ size_t fdt_allocated_size,
+ const struct manifest_vm *manifest_vm,
+ const struct boot_params *boot_params,
+ struct mpool *ppool);
/** Return the FF-A partition info VM/SP properties given the VM id. */
-ffa_partition_properties_t plat_ffa_partition_properties(
+ffa_partition_properties_t ffa_setup_partition_properties(
ffa_id_t caller_id, const struct vm *target);
-bool plat_ffa_rx_release_forward(struct vm_locked vm_locked,
- struct ffa_value *ret);
-
-bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked,
+bool ffa_setup_rx_release_forward(struct vm_locked vm_locked,
struct ffa_value *ret);
+
+bool ffa_setup_acquire_receiver_rx(struct vm_locked to_locked,
+ struct ffa_value *ret);
diff --git a/inc/hf/ffa/vm.h b/inc/hf/ffa/vm.h
index 226ae06..1710afb 100644
--- a/inc/hf/ffa/vm.h
+++ b/inc/hf/ffa/vm.h
@@ -10,28 +10,27 @@
#include "hf/vm.h"
-void plat_ffa_disable_vm_interrupts(struct vm_locked vm_locked);
+void ffa_vm_disable_interrupts(struct vm_locked vm_locked);
-void plat_ffa_vm_init(struct mpool *ppool);
+void ffa_vm_init(struct mpool *ppool);
-struct vm_locked plat_ffa_nwd_vm_create(ffa_id_t vm_id);
+struct vm_locked ffa_vm_nwd_create(ffa_id_t vm_id);
-bool plat_ffa_vm_supports_indirect_messages(struct vm *vm);
+bool ffa_vm_supports_indirect_messages(struct vm *vm);
-bool plat_ffa_vm_notifications_info_get(uint16_t *ids, uint32_t *ids_count,
- uint32_t *lists_sizes,
- uint32_t *lists_count,
- uint32_t ids_count_max);
+bool ffa_vm_notifications_info_get(uint16_t *ids, uint32_t *ids_count,
+ uint32_t *lists_sizes, uint32_t *lists_count,
+ uint32_t ids_count_max);
/** Get NWd VM's structure. */
-struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id);
+struct vm_locked ffa_vm_find_locked(ffa_id_t vm_id);
-struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id);
+struct vm_locked ffa_vm_find_locked_create(ffa_id_t vm_id);
-void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked);
+void ffa_vm_destroy(struct vm_locked to_destroy_locked);
/** Reclaim all resources belonging to VM in aborted state. */
-void plat_ffa_free_vm_resources(struct vm_locked vm_locked);
+void ffa_vm_free_resources(struct vm_locked vm_locked);
/** Checks whether managed exit is supported by given SP. */
-bool plat_ffa_vm_managed_exit_supported(struct vm *vm);
+bool ffa_vm_managed_exit_supported(struct vm *vm);