aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h
blob: 3b0307cead9d22a00f0be295a2789dfeeddfca0e (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
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2022 Nokia
 */

#ifndef ODP_PLAT_BUFFER_INLINE_TYPES_H_
#define ODP_PLAT_BUFFER_INLINE_TYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

/** @cond _ODP_HIDE_FROM_DOXYGEN_ */

/* Buffer header field accessors */
#define _odp_buffer_get(buffer_hdr, cast, field) \
	(*(cast *)(uintptr_t)((uint8_t *)buffer_hdr + \
	 _odp_buffer_inline_offset.field))

/* Buffer header field offsets for inline functions */
typedef struct _odp_buffer_inline_offset_t {
	uint16_t uarea_addr;

} _odp_buffer_inline_offset_t;

extern const _odp_buffer_inline_offset_t _odp_buffer_inline_offset;

/** @endcond */

#ifdef __cplusplus
}
#endif

#endif