aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/buffer.h
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2015-01-28 16:46:36 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-01-29 20:42:32 +0300
commitcb197cd973230fe765adc159ba82bd9edda0dd9f (patch)
tree9d75caf2e2804da37278c424b53cfc8e7371a93d /include/odp/api/buffer.h
parentc1b9f1d9fca5904f1eae8416a863bf151d53b523 (diff)
api: move generic API into the odp namespace
Move generic API into an api directory. Force the platform implementation to add its own header file that shall include the generic API header file. This splitup enables platform implementors to implement inline functions without modifying the "public" API files. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/buffer.h')
-rw-r--r--include/odp/api/buffer.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h
new file mode 100644
index 000000000..41d48a183
--- /dev/null
+++ b/include/odp/api/buffer.h
@@ -0,0 +1,107 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP buffer descriptor
+ */
+
+#ifndef ODP_BUFFER_H_
+#define ODP_BUFFER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <odp/std_types.h>
+#include <odp/platform_types.h>
+#include <odp/event.h>
+
+/** @defgroup odp_buffer ODP BUFFER
+ * Operations on a buffer.
+ * @{
+ */
+
+
+/**
+ * Get buffer handle from event
+ *
+ * Converts an ODP_EVENT_BUFFER type event to a buffer.
+ *
+ * @param ev Event handle
+ *
+ * @return Buffer handle
+ *
+ * @see odp_event_type()
+ */
+odp_buffer_t odp_buffer_from_event(odp_event_t ev);
+
+/**
+ * Convert buffer handle to event
+ *
+ * @param buf Buffer handle
+ *
+ * @return Event handle
+ */
+odp_event_t odp_buffer_to_event(odp_buffer_t buf);
+
+/**
+ * Buffer start address
+ *
+ * @param buf Buffer handle
+ *
+ * @return Buffer start address
+ */
+void *odp_buffer_addr(odp_buffer_t buf);
+
+/**
+ * Buffer maximum data size
+ *
+ * @param buf Buffer handle
+ *
+ * @return Buffer maximum data size
+ */
+uint32_t odp_buffer_size(odp_buffer_t buf);
+
+/**
+ * Tests if buffer is valid
+ *
+ * @param buf Buffer handle
+ *
+ * @retval 1 Buffer handle represents a valid buffer.
+ * @retval 0 Buffer handle does not represent a valid buffer.
+ */
+int odp_buffer_is_valid(odp_buffer_t buf);
+
+/**
+ * Buffer pool of the buffer
+ *
+ * @param buf Buffer handle
+ *
+ * @return Handle of buffer pool buffer belongs to
+ */
+odp_pool_t odp_buffer_pool(odp_buffer_t buf);
+
+/**
+ * Print buffer metadata to STDOUT
+ *
+ * @param buf Buffer handle
+ *
+ */
+void odp_buffer_print(odp_buffer_t buf);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif