aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/include/odp/api/plat/buffer_inline_types.h')
-rw-r--r--platform/linux-generic/include/odp/api/plat/buffer_inline_types.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h b/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h
new file mode 100644
index 000000000..9689ddd06
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2022, Nokia
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#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;
+
+/** @endcond */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif