blob: a20a313257d18177b732b2b81bc28de009fca4e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* Copyright (c) 2015, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <odp/cpu.h>
#include <odp/hints.h>
#include <odp/system_info.h>
uint64_t odp_cpu_cycles(void)
{
#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
#define CVMX_TMP_STR2(x) #x
uint64_t cycle;
__asm__ __volatile__ ("rdhwr %[rt],$" CVMX_TMP_STR(31) :
[rt] "=d" (cycle) : : "memory");
return cycle;
}
uint64_t odp_cpu_cycles_max(void)
{
return UINT64_MAX;
}
uint64_t odp_cpu_cycles_resolution(void)
{
return 1;
}
|