diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-08-17 15:39:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 15:39:46 +0300 |
commit | 5d505fde6d4327b27446389699abf3a593c02a17 (patch) | |
tree | 937164d89e7b8679a42f0e3705e19243baaf0147 /platform/linux-generic/arch/common/odp_time_cpu.c | |
parent | de97121a2e3afa072f7c51a0570f4b3bed0236c2 (diff) | |
parent | 7a200d709b64e743c002dd9737cd71f54ccc54ac (diff) |
Merge ODP v1.42.0.0v1.42.0.0_DPDK_22.11
Merge ODP linux-generic v1.42.0.0 into linux-dpdk.
Diffstat (limited to 'platform/linux-generic/arch/common/odp_time_cpu.c')
-rw-r--r-- | platform/linux-generic/arch/common/odp_time_cpu.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/platform/linux-generic/arch/common/odp_time_cpu.c b/platform/linux-generic/arch/common/odp_time_cpu.c new file mode 100644 index 000000000..bbfe82e21 --- /dev/null +++ b/platform/linux-generic/arch/common/odp_time_cpu.c @@ -0,0 +1,48 @@ +/* Copyright (c) 2013-2018, Linaro Limited + * Copyright (c) 2020-2023, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/time_types.h> + +#include <odp/api/abi/time_cpu.h> +#include <odp/api/abi/time_cpu_inlines.h> + +#include <odp_debug_internal.h> +#include <odp_init_internal.h> + +#include <inttypes.h> +#include <stdint.h> +#include <string.h> + +#include <odp/visibility_begin.h> + +_odp_time_global_t _odp_time_glob; + +#include <odp/visibility_end.h> + +int _odp_time_init_global(void) +{ + _odp_time_global_t *global = &_odp_time_glob; + + memset(global, 0, sizeof(_odp_time_global_t)); + + if (!_odp_time_cpu_global_freq_is_const()) + return -1; + + global->freq_hz = _odp_time_cpu_global_freq(); + if (global->freq_hz == 0) + return -1; + + _ODP_PRINT("HW time counter freq: %" PRIu64 " hz\n\n", global->freq_hz); + + global->start_time = _odp_time_cpu_global(); + return 0; +} + +int _odp_time_term_global(void) +{ + return 0; +} |