aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp/api/plat/event_vector_inline_types.h
blob: 547620df6142858a38f2816366c4aeebaae07463 (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
/* Copyright (c) 2020, Nokia
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#ifndef ODP_PLAT_EVENT_VECTOR_INLINE_TYPES_H_
#define ODP_PLAT_EVENT_VECTOR_INLINE_TYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

/** @cond _ODP_HIDE_FROM_DOXYGEN_ */

/* Event vector field accessors */
#define _odp_event_vect_get(vect, cast, field) \
	(*(cast *)(uintptr_t)((uint8_t *)vect + _odp_event_vector_inline.field))
#define _odp_event_vect_get_ptr(vect, cast, field) \
	((cast *)(uintptr_t)((uint8_t *)vect + _odp_event_vector_inline.field))

/* Event vector header field offsets for inline functions */
typedef struct _odp_event_vector_inline_offset_t {
	uint16_t packet;
	uint16_t pool;
	uint16_t size;
} _odp_event_vector_inline_offset_t;

/** @endcond */

#ifdef __cplusplus
}
#endif

#endif /* ODP_PLAT_EVENT_VECTOR_INLINE_TYPES_H_ */