fix(spmd): fix build failure due to redefinition

Clang build breaks with the following warning:

  |  In file included from services/std_svc/spmd/spmd_logical_sp.c:15:
  |  include/services/el3_spmd_logical_sp.h:15:38: error: redefinition of
  |    typedef 'spmd_spm_core_context_t' is a C11 feature [-Werror,-Wtypedef-redefinition].
  |     15 | typedef struct spmd_spm_core_context spmd_spm_core_context_t;
  |        |                                      ^
  |  services/std_svc/spmd/spmd_private.h:58:3: note: previous definition is here
  |     58 | } spmd_spm_core_context_t;
  |        |   ^
  |    CC      services/std_svc/std_svc_setup.c
  |  1 error generated.
  |  In file included from services/std_svc/spmd/spmd_main.c:35:
  |  services/std_svc/spmd/spmd_private.h:58:3: error: redefinition of typedef
  |    'spmd_spm_core_context_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
  |     58 | } spmd_spm_core_context_t;
  |        |   ^
  |  include/services/el3_spmd_logical_sp.h:15:38: note: previous definition is here
  |     15 | typedef struct spmd_spm_core_context spmd_spm_core_context_t;
  |        |                                      ^
  |  1 error generated.

A structure 'spmd_spm_core_context_t' defined in 'spmd_private.h' is
also declared in 'el3_spmd_logical_sp.h' as it is used in a couple of
function declarations. These function declarations can be moved to
spmd_private.h as they are not needed elsewhere.

Change-Id: Ic6b9a277abe00cb7129f671570abf7255be62dfa
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Sudeep Holla 2024-10-24 11:09:43 +01:00
parent ffb93d41f9
commit a869e2dc45
3 changed files with 8 additions and 12 deletions

View file

@ -12,8 +12,6 @@
/*******************************************************************************
* Structure definition, typedefs & constants for the SPMD Logical Partitions.
******************************************************************************/
typedef struct spmd_spm_core_context spmd_spm_core_context_t;
/* Prototype for SPMD logical partition initializing function. */
typedef int32_t (*ffa_spmd_lp_init_t)(void);
@ -143,12 +141,6 @@ void spmd_logical_sp_set_spmc_initialized(void);
void spmc_logical_sp_set_spmc_failure(void);
int32_t spmd_logical_sp_init(void);
bool is_spmd_logical_sp_dir_req_in_progress(
spmd_spm_core_context_t *ctx);
bool is_spmd_logical_sp_info_regs_req_in_progress(
spmd_spm_core_context_t *ctx);
bool spmd_el3_ffa_msg_direct_req(uint64_t x1,
uint64_t x2,
uint64_t x3,

View file

@ -723,8 +723,8 @@ bool spmd_el3_ffa_msg_direct_req(uint64_t x1,
#endif
}
bool is_spmd_logical_sp_info_regs_req_in_progress(
spmd_spm_core_context_t *ctx)
bool
is_spmd_logical_sp_info_regs_req_in_progress(const spmd_spm_core_context_t *ctx)
{
#if ENABLE_SPMD_LP
return ((ctx->spmd_lp_sync_req_ongoing & SPMD_LP_FFA_INFO_GET_REG_ONGOING)
@ -734,8 +734,7 @@ bool is_spmd_logical_sp_info_regs_req_in_progress(
#endif
}
bool is_spmd_logical_sp_dir_req_in_progress(
spmd_spm_core_context_t *ctx)
bool is_spmd_logical_sp_dir_req_in_progress(const spmd_spm_core_context_t *ctx)
{
#if ENABLE_SPMD_LP
return ((ctx->spmd_lp_sync_req_ongoing & SPMD_LP_FFA_DIR_REQ_ONGOING)

View file

@ -78,6 +78,11 @@ void spmd_build_spmc_message(gp_regs_t *gpregs, uint8_t target,
uint64_t spmd_spm_core_sync_entry(spmd_spm_core_context_t *ctx);
__dead2 void spmd_spm_core_sync_exit(uint64_t rc);
bool is_spmd_logical_sp_dir_req_in_progress(const spmd_spm_core_context_t *ctx);
bool is_spmd_logical_sp_info_regs_req_in_progress(
const spmd_spm_core_context_t *ctx);
/* Assembly helpers */
uint64_t spmd_spm_core_enter(uint64_t *c_rt_ctx);
void __dead2 spmd_spm_core_exit(uint64_t c_rt_ctx, uint64_t ret);