diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/locks/bakery/bakery_lock_normal.c | 6 | ||||
-rw-r--r-- | lib/pmf/pmf_main.c | 19 | ||||
-rw-r--r-- | lib/psci/psci_stat.c | 7 |
3 files changed, 17 insertions, 15 deletions
diff --git a/lib/locks/bakery/bakery_lock_normal.c b/lib/locks/bakery/bakery_lock_normal.c index 8f59215e3..37697f521 100644 --- a/lib/locks/bakery/bakery_lock_normal.c +++ b/lib/locks/bakery/bakery_lock_normal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -10,6 +10,7 @@ #include <cpu_data.h> #include <platform.h> #include <string.h> +#include <utils_def.h> /* * Functions in this file implement Bakery Algorithm for mutual exclusion with the @@ -49,8 +50,7 @@ CASSERT((PLAT_PERCPU_BAKERY_LOCK_SIZE & (CACHE_WRITEBACK_GRANULE - 1)) == 0, \ * Use the linker defined symbol which has evaluated the size reqiurement. * This is not as efficient as using a platform defined constant */ -extern void *__PERCPU_BAKERY_LOCK_SIZE__; -#define PERCPU_BAKERY_LOCK_SIZE ((uintptr_t)&__PERCPU_BAKERY_LOCK_SIZE__) +IMPORT_SYM(uintptr_t, __PERCPU_BAKERY_LOCK_SIZE__, PERCPU_BAKERY_LOCK_SIZE); #endif #define get_bakery_info(cpu_ix, lock) \ diff --git a/lib/pmf/pmf_main.c b/lib/pmf/pmf_main.c index 2cf260ec1..0208948fe 100644 --- a/lib/pmf/pmf_main.c +++ b/lib/pmf/pmf_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,6 +11,7 @@ #include <platform.h> #include <pmf.h> #include <string.h> +#include <utils_def.h> /******************************************************************************* * The 'pmf_svc_descs' array holds the PMF service descriptors exported by @@ -21,16 +22,12 @@ * index of the descriptor in the 'pmf_svc_descs' array which contains the * service function pointers. ******************************************************************************/ -extern uintptr_t __PMF_SVC_DESCS_START__; -extern uintptr_t __PMF_SVC_DESCS_END__; -#define PMF_SVC_DESCS_START ((uintptr_t)(&__PMF_SVC_DESCS_START__)) -#define PMF_SVC_DESCS_END ((uintptr_t)(&__PMF_SVC_DESCS_END__)) -extern void *__PERCPU_TIMESTAMP_SIZE__; -#define PMF_PERCPU_TIMESTAMP_SIZE ((uintptr_t)&__PERCPU_TIMESTAMP_SIZE__) -extern uintptr_t __PMF_TIMESTAMP_START__; -#define PMF_TIMESTAMP_ARRAY_START ((uintptr_t)&__PMF_TIMESTAMP_START__) -extern uintptr_t __PMF_TIMESTAMP_END__; -#define PMF_TIMESTAMP_ARRAY_END ((uintptr_t)&__PMF_TIMESTAMP_END__) + +IMPORT_SYM(uintptr_t, __PMF_SVC_DESCS_START__, PMF_SVC_DESCS_START); +IMPORT_SYM(uintptr_t, __PMF_SVC_DESCS_END__, PMF_SVC_DESCS_END); +IMPORT_SYM(uintptr_t, __PERCPU_TIMESTAMP_SIZE__, PMF_PERCPU_TIMESTAMP_SIZE); +IMPORT_SYM(intptr_t, __PMF_TIMESTAMP_START__, PMF_TIMESTAMP_ARRAY_START); +IMPORT_SYM(uintptr_t, __PMF_TIMESTAMP_END__, PMF_TIMESTAMP_ARRAY_END); #define PMF_SVC_DESCS_MAX 10 diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c index 3e79c5d7c..e925d34ed 100644 --- a/lib/psci/psci_stat.c +++ b/lib/psci/psci_stat.c @@ -24,7 +24,8 @@ typedef struct psci_stat { * Following is used to keep track of the last cpu * that goes to power down in non cpu power domains. */ -static int last_cpu_in_non_cpu_pd[PSCI_NUM_NON_CPU_PWR_DOMAINS] = {-1}; +static int last_cpu_in_non_cpu_pd[PSCI_NUM_NON_CPU_PWR_DOMAINS] = { + [0 ... PSCI_NUM_NON_CPU_PWR_DOMAINS-1] = -1}; /* * Following are used to store PSCI STAT values for @@ -129,6 +130,10 @@ void psci_stats_update_pwr_up(unsigned int end_pwrlvl, * prior to this CPU powering on. */ parent_idx = psci_cpu_pd_nodes[cpu_idx].parent_node; + /* Return early if this is the first power up. */ + if (last_cpu_in_non_cpu_pd[parent_idx] == -1) + return; + for (lvl = PSCI_CPU_PWR_LVL + 1; lvl <= end_pwrlvl; lvl++) { local_state = state_info->pwr_domain_state[lvl]; if (is_local_state_run(local_state)) { |