diff options
Diffstat (limited to 'lib/psci/psci_on.c')
-rw-r--r-- | lib/psci/psci_on.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c index 470b4f33e..dd48e105d 100644 --- a/lib/psci/psci_on.c +++ b/lib/psci/psci_on.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -20,12 +20,12 @@ /* * Helper functions for the CPU level spinlocks */ -static inline void psci_spin_lock_cpu(int idx) +static inline void psci_spin_lock_cpu(unsigned int idx) { spin_lock(&psci_cpu_pd_nodes[idx].cpu_lock); } -static inline void psci_spin_unlock_cpu(int idx) +static inline void psci_spin_unlock_cpu(unsigned int idx) { spin_unlock(&psci_cpu_pd_nodes[idx].cpu_lock); } @@ -61,12 +61,14 @@ int psci_cpu_on_start(u_register_t target_cpu, { int rc; aff_info_state_t target_aff_state; - int target_idx = plat_core_pos_by_mpidr(target_cpu); + int ret = plat_core_pos_by_mpidr(target_cpu); + unsigned int target_idx = (unsigned int)ret; /* Calling function must supply valid input arguments */ - assert(target_idx >= 0); + assert(ret >= 0); assert(ep != NULL); + /* * This function must only be called on platforms where the * CPU_ON platform hooks have been implemented. @@ -93,7 +95,7 @@ int psci_cpu_on_start(u_register_t target_cpu, * target CPUs shutdown was not seen by the current CPU's cluster. And * so the cache may contain stale data for the target CPU. */ - flush_cpu_data_by_index((unsigned int)target_idx, + flush_cpu_data_by_index(target_idx, psci_svc_cpu_data.aff_info_state); rc = cpu_on_validate_state(psci_get_aff_info_state_by_idx(target_idx)); if (rc != PSCI_E_SUCCESS) @@ -113,7 +115,7 @@ int psci_cpu_on_start(u_register_t target_cpu, * turned OFF. */ psci_set_aff_info_state_by_idx(target_idx, AFF_STATE_ON_PENDING); - flush_cpu_data_by_index((unsigned int)target_idx, + flush_cpu_data_by_index(target_idx, psci_svc_cpu_data.aff_info_state); /* @@ -126,7 +128,7 @@ int psci_cpu_on_start(u_register_t target_cpu, if (target_aff_state != AFF_STATE_ON_PENDING) { assert(target_aff_state == AFF_STATE_OFF); psci_set_aff_info_state_by_idx(target_idx, AFF_STATE_ON_PENDING); - flush_cpu_data_by_index((unsigned int)target_idx, + flush_cpu_data_by_index(target_idx, psci_svc_cpu_data.aff_info_state); assert(psci_get_aff_info_state_by_idx(target_idx) == @@ -146,11 +148,11 @@ int psci_cpu_on_start(u_register_t target_cpu, if (rc == PSCI_E_SUCCESS) /* Store the re-entry information for the non-secure world. */ - cm_init_context_by_index((unsigned int)target_idx, ep); + cm_init_context_by_index(target_idx, ep); else { /* Restore the state on error. */ psci_set_aff_info_state_by_idx(target_idx, AFF_STATE_OFF); - flush_cpu_data_by_index((unsigned int)target_idx, + flush_cpu_data_by_index(target_idx, psci_svc_cpu_data.aff_info_state); } @@ -164,7 +166,7 @@ exit: * are called by the common finisher routine in psci_common.c. The `state_info` * is the psci_power_state from which this CPU has woken up from. ******************************************************************************/ -void psci_cpu_on_finish(int cpu_idx, const psci_power_state_t *state_info) +void psci_cpu_on_finish(unsigned int cpu_idx, const psci_power_state_t *state_info) { /* * Plat. management: Perform the platform specific actions |