blob: 270a6769b20fd083940ffca6c3dcdc904e0d37d7 (
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
54
55
56
57
58
59
60
|
/* Copyright (c) 2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef ODP_PLAT_TIMER_INLINES_H_
#define ODP_PLAT_TIMER_INLINES_H_
#include <odp/api/event_types.h>
#include <odp/api/timer_types.h>
#include <odp/api/plat/timer_inline_types.h>
#include <stdint.h>
/** @cond _ODP_HIDE_FROM_DOXYGEN_ */
extern const _odp_timeout_inline_offset_t _odp_timeout_inline_offset;
#ifndef _ODP_NO_INLINE
/* Inline functions by default */
#define _ODP_INLINE static inline
#define odp_timeout_timer __odp_timeout_timer
#define odp_timeout_tick __odp_timeout_tick
#define odp_timeout_user_ptr __odp_timeout_user_ptr
#define odp_timeout_from_event __odp_timeout_from_event
#define odp_timeout_to_event __odp_timeout_to_event
#else
#define _ODP_INLINE
#endif
_ODP_INLINE odp_timer_t odp_timeout_timer(odp_timeout_t tmo)
{
return _odp_timeout_hdr_field(tmo, odp_timer_t, timer);
}
_ODP_INLINE uint64_t odp_timeout_tick(odp_timeout_t tmo)
{
return _odp_timeout_hdr_field(tmo, uint64_t, expiration);
}
_ODP_INLINE void *odp_timeout_user_ptr(odp_timeout_t tmo)
{
return _odp_timeout_hdr_field(tmo, void *, user_ptr);
}
_ODP_INLINE odp_timeout_t odp_timeout_from_event(odp_event_t ev)
{
return (odp_timeout_t)ev;
}
_ODP_INLINE odp_event_t odp_timeout_to_event(odp_timeout_t tmo)
{
return (odp_event_t)tmo;
}
/** @endcond */
#endif
|