diff mbox

[v2,06/18] Split out platform-specific part of odp_buffer.h

Message ID 1403027720-9738-7-git-send-email-taras.kondratiuk@linaro.org
State RFC
Headers show

Commit Message

Taras Kondratiuk June 17, 2014, 5:55 p.m. UTC
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
 include/odp_buffer.h                             |   19 +++++---------
 platform/linux-generic/include/plat/odp_buffer.h |   30 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 12 deletions(-)
 create mode 100644 platform/linux-generic/include/plat/odp_buffer.h
diff mbox

Patch

diff --git a/include/odp_buffer.h b/include/odp_buffer.h
index d79e76d..cc62348 100644
--- a/include/odp_buffer.h
+++ b/include/odp_buffer.h
@@ -18,21 +18,20 @@ 
 extern "C" {
 #endif
 
-
-
 #include <odp_std_types.h>
-
-
-
-
+#include <plat/odp_buffer.h>
 
 /**
  * ODP buffer
  */
-typedef uint32_t odp_buffer_t;
+typedef plat_odp_buffer_t odp_buffer_t;
 
-#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */
+#define ODP_BUFFER_INVALID PLAT_ODP_BUFFER_INVALID /**< Invalid buffer */
 
+#define ODP_BUFFER_TYPE_INVALID PLAT_ODP_BUFFER_TYPE_INVALID /**< Buffer type invalid */
+#define ODP_BUFFER_TYPE_RAW     PLAT_ODP_BUFFER_TYPE_RAW     /**< Raw buffer */
+#define ODP_BUFFER_TYPE_PACKET  PLAT_ODP_BUFFER_TYPE_PACKET  /**< Packet buffer */
+#define ODP_BUFFER_TYPE_TIMER   PLAT_ODP_BUFFER_TYPE_TIMER   /**< Timer buffer */
 
 /**
  * Buffer start address
@@ -61,10 +60,6 @@  size_t odp_buffer_size(odp_buffer_t buf);
  */
 int odp_buffer_type(odp_buffer_t buf);
 
-#define ODP_BUFFER_TYPE_INVALID (-1) /**< Buffer type invalid */
-#define ODP_BUFFER_TYPE_RAW       0  /**< Raw buffer */
-#define ODP_BUFFER_TYPE_PACKET    1  /**< Packet buffer */
-#define ODP_BUFFER_TYPE_TIMER     2  /**< Timer buffer */
 
 /**
  * Tests if buffer is part of a scatter/gather list
diff --git a/platform/linux-generic/include/plat/odp_buffer.h b/platform/linux-generic/include/plat/odp_buffer.h
new file mode 100644
index 0000000..6945325
--- /dev/null
+++ b/platform/linux-generic/include/plat/odp_buffer.h
@@ -0,0 +1,30 @@ 
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP buffer descriptor
+ */
+
+#ifndef ODP_BUFFER_H_
+#error This file should be included only into corresponding top level header
+#else
+
+/**
+ * ODP buffer
+ */
+typedef uint32_t plat_odp_buffer_t;
+
+#define PLAT_ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */
+
+#define PLAT_ODP_BUFFER_TYPE_INVALID (-1) /**< Buffer type invalid */
+#define PLAT_ODP_BUFFER_TYPE_RAW       0  /**< Raw buffer */
+#define PLAT_ODP_BUFFER_TYPE_PACKET    1  /**< Packet buffer */
+#define PLAT_ODP_BUFFER_TYPE_TIMER     2  /**< Timer buffer */
+
+#endif