aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp/api/plat/time_types.h
blob: e7111c8c51f73f8c32133c8f1cc5a6dfdb7a621c (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* Copyright (c) 2015, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

/**
 * @file
 *
 * ODP time service
 */

#ifndef ODP_TIME_TYPES_H_
#define ODP_TIME_TYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

/** @addtogroup odp_time
 *  @{
 **/

/**
 * @internal Time structure used for both POSIX timespec and HW counter
 * implementations.
 */
typedef struct odp_time_t {
	/** @internal Variant mappings for time type */
	union {
		/** @internal Used with generic 64 bit operations */
		uint64_t u64;

		/** @internal Nanoseconds */
		uint64_t nsec;

		/** @internal HW timer counter value */
		uint64_t count;

	};
} odp_time_t;

#define ODP_TIME_NULL ((odp_time_t){.u64 = 0})

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif