Unverified Commit 74a44dca authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by GitHub
Browse files

Merge pull request #1399 from danielboulby-arm/db/MISRA

MISRA 5.1, 5.3 & 5.7 compliance changes
parents e109b0ff 776ff52a
...@@ -30,11 +30,11 @@ static int32_t opteed_cpu_off_handler(u_register_t unused) ...@@ -30,11 +30,11 @@ static int32_t opteed_cpu_off_handler(u_register_t unused)
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON);
/* Program the entry point and enter OPTEE */ /* Program the entry point and enter OPTEE */
cm_set_elr_el3(SECURE, (uint64_t) &optee_vectors->cpu_off_entry); cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->cpu_off_entry);
rc = opteed_synchronous_sp_entry(optee_ctx); rc = opteed_synchronous_sp_entry(optee_ctx);
/* /*
...@@ -63,11 +63,11 @@ static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl) ...@@ -63,11 +63,11 @@ static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl)
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON);
/* Program the entry point and enter OPTEE */ /* Program the entry point and enter OPTEE */
cm_set_elr_el3(SECURE, (uint64_t) &optee_vectors->cpu_suspend_entry); cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->cpu_suspend_entry);
rc = opteed_synchronous_sp_entry(optee_ctx); rc = opteed_synchronous_sp_entry(optee_ctx);
/* /*
...@@ -94,11 +94,11 @@ static void opteed_cpu_on_finish_handler(u_register_t unused) ...@@ -94,11 +94,11 @@ static void opteed_cpu_on_finish_handler(u_register_t unused)
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
entry_point_info_t optee_on_entrypoint; entry_point_info_t optee_on_entrypoint;
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_OFF); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_OFF);
opteed_init_optee_ep_state(&optee_on_entrypoint, opteed_rw, opteed_init_optee_ep_state(&optee_on_entrypoint, opteed_rw,
(uint64_t)&optee_vectors->cpu_on_entry, (uint64_t)&optee_vector_table->cpu_on_entry,
0, 0, 0, optee_ctx); 0, 0, 0, optee_ctx);
/* Initialise this cpu's secure context */ /* Initialise this cpu's secure context */
...@@ -129,14 +129,14 @@ static void opteed_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl) ...@@ -129,14 +129,14 @@ static void opteed_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl)
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_SUSPEND); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_SUSPEND);
/* Program the entry point, max_off_pwrlvl and enter the SP */ /* Program the entry point, max_off_pwrlvl and enter the SP */
write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx), write_ctx_reg(get_gpregs_ctx(&optee_ctx->cpu_ctx),
CTX_GPREG_X0, CTX_GPREG_X0,
max_off_pwrlvl); max_off_pwrlvl);
cm_set_elr_el3(SECURE, (uint64_t) &optee_vectors->cpu_resume_entry); cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->cpu_resume_entry);
rc = opteed_synchronous_sp_entry(optee_ctx); rc = opteed_synchronous_sp_entry(optee_ctx);
/* /*
...@@ -168,11 +168,11 @@ static void opteed_system_off(void) ...@@ -168,11 +168,11 @@ static void opteed_system_off(void)
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON);
/* Program the entry point */ /* Program the entry point */
cm_set_elr_el3(SECURE, (uint64_t) &optee_vectors->system_off_entry); cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->system_off_entry);
/* Enter OPTEE. We do not care about the return value because we /* Enter OPTEE. We do not care about the return value because we
* must continue the shutdown anyway */ * must continue the shutdown anyway */
...@@ -188,11 +188,11 @@ static void opteed_system_reset(void) ...@@ -188,11 +188,11 @@ static void opteed_system_reset(void)
uint32_t linear_id = plat_my_core_pos(); uint32_t linear_id = plat_my_core_pos();
optee_context_t *optee_ctx = &opteed_sp_context[linear_id]; optee_context_t *optee_ctx = &opteed_sp_context[linear_id];
assert(optee_vectors); assert(optee_vector_table);
assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON); assert(get_optee_pstate(optee_ctx->state) == OPTEE_PSTATE_ON);
/* Program the entry point */ /* Program the entry point */
cm_set_elr_el3(SECURE, (uint64_t) &optee_vectors->system_reset_entry); cm_set_elr_el3(SECURE, (uint64_t) &optee_vector_table->system_reset_entry);
/* Enter OPTEE. We do not care about the return value because we /* Enter OPTEE. We do not care about the return value because we
* must continue the reset anyway */ * must continue the reset anyway */
......
...@@ -154,7 +154,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_ep, ...@@ -154,7 +154,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_ep,
extern optee_context_t opteed_sp_context[OPTEED_CORE_COUNT]; extern optee_context_t opteed_sp_context[OPTEED_CORE_COUNT];
extern uint32_t opteed_rw; extern uint32_t opteed_rw;
extern struct optee_vectors *optee_vectors; extern struct optee_vectors *optee_vector_table;
#endif /*__ASSEMBLY__*/ #endif /*__ASSEMBLY__*/
#endif /* __OPTEED_PRIVATE_H__ */ #endif /* __OPTEED_PRIVATE_H__ */
...@@ -190,14 +190,14 @@ typedef struct tsp_context { ...@@ -190,14 +190,14 @@ typedef struct tsp_context {
} tsp_context_t; } tsp_context_t;
/* Helper macros to store and retrieve tsp args from tsp_context */ /* Helper macros to store and retrieve tsp args from tsp_context */
#define store_tsp_args(tsp_ctx, x1, x2) do {\ #define store_tsp_args(_tsp_ctx, _x1, _x2) do {\
tsp_ctx->saved_tsp_args[0] = x1;\ _tsp_ctx->saved_tsp_args[0] = _x1;\
tsp_ctx->saved_tsp_args[1] = x2;\ _tsp_ctx->saved_tsp_args[1] = _x2;\
} while (0) } while (0)
#define get_tsp_args(tsp_ctx, x1, x2) do {\ #define get_tsp_args(_tsp_ctx, _x1, _x2) do {\
x1 = tsp_ctx->saved_tsp_args[0];\ _x1 = _tsp_ctx->saved_tsp_args[0];\
x2 = tsp_ctx->saved_tsp_args[1];\ _x2 = _tsp_ctx->saved_tsp_args[1];\
} while (0) } while (0)
/* TSPD power management handlers */ /* TSPD power management handlers */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment