diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2018-05-24 14:43:38 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-05-28 18:07:56 +0300 |
commit | d6e4b3df266ee1c847763ba50fa802d9e9e62b5e (patch) | |
tree | c7b6350d9c341229ee31af00f7b418ecb0e3dab5 /platform/linux-generic/odp_init.c | |
parent | bdc44eae6bac8aed26170d21cf05fe99ba9d84d6 (diff) |
linux-gen: cpu: add cpu cycles init global
Add global init function to check e.g. if CPU cycle counter
instruction is available on x86.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/odp_init.c')
-rw-r--r-- | platform/linux-generic/odp_init.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 7de3d6893..b2b75f12b 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -21,6 +21,7 @@ enum init_stage { NO_INIT = 0, /* No init stages completed */ LIBCONFIG_INIT, CPUMASK_INIT, + CPU_CYCLES_INIT, TIME_INIT, SYSINFO_INIT, ISHM_INIT, @@ -173,6 +174,8 @@ static int term_global(enum init_stage stage) } /* Fall through */ + case CPU_CYCLES_INIT: + /* Fall through */ case CPUMASK_INIT: if (odp_cpumask_term_global()) { ODP_ERR("ODP cpumask term failed.\n"); @@ -224,6 +227,12 @@ int odp_init_global(odp_instance_t *instance, } stage = CPUMASK_INIT; + if (_odp_cpu_cycles_init_global()) { + ODP_ERR("ODP cpu cycle init failed.\n"); + goto init_failed; + } + stage = CPU_CYCLES_INIT; + if (odp_time_init_global()) { ODP_ERR("ODP time init failed.\n"); goto init_failed; |