Browse Source

feat(spmc): add helper function to obtain endpoint mailbox

Add a helper function to obtain the relevant mailbox buffers
depending on which entity was last run. This will be used in
subsequent functionality to populate requested information in
the callers RX buffer.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I85959ced4d1454be05a7b3fb6853ed3ab7f0cf3e
pull/1985/head
Marc Bonnici 3 years ago
parent
commit
f16b6ee3de
  1. 6
      services/std_svc/spm/el3_spmc/spmc.h
  2. 14
      services/std_svc/spm/el3_spmc/spmc_main.c

6
services/std_svc/spm/el3_spmc/spmc.h

@ -221,4 +221,10 @@ bool is_ffa_secure_id_valid(uint16_t partition_id);
*/
struct el3_lp_desc *get_el3_lp_array(void);
/*
* Helper function to obtain the RX/TX buffer pair descriptor of the Hypervisor
* or OS kernel in the normal world or the last SP that was run.
*/
struct mailbox *spmc_get_mbox_desc(bool secure_origin);
#endif /* SPMC_H */

14
services/std_svc/spm/el3_spmc/spmc_main.c

@ -90,6 +90,20 @@ struct ns_endpoint_desc *spmc_get_hyp_ctx(void)
return &(ns_ep_desc[0]);
}
/*
* Helper function to obtain the RX/TX buffer pair descriptor of the Hypervisor
* or OS kernel in the normal world or the last SP that was run.
*/
struct mailbox *spmc_get_mbox_desc(bool secure_origin)
{
/* Obtain the RX/TX buffer pair descriptor. */
if (secure_origin) {
return &(spmc_get_current_sp_ctx()->mailbox);
} else {
return &(spmc_get_hyp_ctx()->mailbox);
}
}
/******************************************************************************
* This function returns to the place where spmc_sp_synchronous_entry() was
* called originally.

Loading…
Cancel
Save