diff mbox

[RFC,12/17] Split out platform-specific part of odp_queue.h

Message ID 1398685276-4610-13-git-send-email-taras.kondratiuk@linaro.org
State RFC
Headers show

Commit Message

Taras Kondratiuk April 28, 2014, 11:41 a.m. UTC
---
 include/odp_queue.h                             |   45 +++++++++-----------
 platform/linux-generic/include/plat/odp_queue.h |   50 +++++++++++++++++++++++
 2 files changed, 70 insertions(+), 25 deletions(-)
 create mode 100644 platform/linux-generic/include/plat/odp_queue.h
diff mbox

Patch

diff --git a/include/odp_queue.h b/include/odp_queue.h
index 6401aea..695513f 100644
--- a/include/odp_queue.h
+++ b/include/odp_queue.h
@@ -24,18 +24,6 @@  extern "C" {
 
 
 /**
- * ODP queue
- */
-typedef uint32_t odp_queue_t;
-
-/** Invalid queue */
-#define ODP_QUEUE_INVALID  0
-
-/** Maximum queue name lenght in chars */
-#define ODP_QUEUE_NAME_LEN 32
-
-
-/**
  * ODP queue type
  */
 typedef int odp_queue_type_t;
@@ -51,20 +39,21 @@  typedef int odp_queue_type_t;
 typedef int odp_schedule_prio_t;
 
 /** Highest scheduling priority */
-#define ODP_SCHED_PRIO_HIGHEST  0
+#define ODP_SCHED_PRIO_HIGHEST  PLAT_ODP_SCHED_PRIO_HIGHEST
 
 /** Normal scheduling priority */
-#define ODP_SCHED_PRIO_NORMAL   (ODP_CONFIG_SCHED_PRIOS / 2)
+#define ODP_SCHED_PRIO_NORMAL   PLAT_ODP_SCHED_PRIO_NORMAL
 
 /** Lowest scheduling priority */
-#define ODP_SCHED_PRIO_LOWEST   (ODP_CONFIG_SCHED_PRIOS - 1)
+#define ODP_SCHED_PRIO_LOWEST   PLAT_ODP_SCHED_PRIO_LOWEST
 
 /** Default scheduling priority */
-#define ODP_SCHED_PRIO_DEFAULT  ODP_SCHED_PRIO_NORMAL
+#define ODP_SCHED_PRIO_DEFAULT  PLAT_ODP_SCHED_PRIO_NORMAL
 
 
 /**
  * ODP schedule synchronisation
+ * TODO: Can sync type values be platform specific?
  */
 typedef int odp_schedule_sync_t;
 
@@ -73,7 +62,7 @@  typedef int odp_schedule_sync_t;
 #define ODP_SCHED_SYNC_ORDERED  2  /**< Ordered queue */
 
 /** Default queue synchronisation */
-#define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
+#define ODP_SCHED_SYNC_DEFAULT  PLAT_ODP_SCHED_SYNC_DEFAULT
 
 /**
  * ODP schedule core group
@@ -84,7 +73,7 @@  typedef int odp_schedule_group_t;
 #define ODP_SCHED_GROUP_ALL     0
 
 /** Default core group */
-#define ODP_SCHED_GROUP_DEFAULT ODP_SCHED_GROUP_ALL
+#define ODP_SCHED_GROUP_DEFAULT PLAT_ODP_SCHED_GROUP_DEFAULT
 
 
 /**
@@ -100,6 +89,19 @@  typedef union odp_queue_param_t {
 
 } odp_queue_param_t;
 
+#include <plat/odp_queue.h>
+
+/**
+ * ODP queue
+ */
+typedef plat_odp_queue_t odp_queue_t;
+
+/** Invalid queue */
+#define ODP_QUEUE_INVALID  PLAT_ODP_QUEUE_INVALID
+
+/** Maximum queue name lenght in chars */
+#define ODP_QUEUE_NAME_LEN PLAT_ODP_QUEUE_NAME_LEN
+
 
 /**
  * Queue create
@@ -193,10 +195,3 @@  odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue);
 #endif
 
 #endif
-
-
-
-
-
-
-
diff --git a/platform/linux-generic/include/plat/odp_queue.h b/platform/linux-generic/include/plat/odp_queue.h
new file mode 100644
index 0000000..ff174b4
--- /dev/null
+++ b/platform/linux-generic/include/plat/odp_queue.h
@@ -0,0 +1,50 @@ 
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP queue
+ */
+
+#ifndef ODP_QUEUE_H_
+#error This file should be included only into corresponding top level header
+#else
+
+#include <odp_std_types.h>
+
+/**
+ * ODP queue
+ */
+typedef uint32_t plat_odp_queue_t;
+
+/** Invalid queue */
+#define PLAT_ODP_QUEUE_INVALID  0
+
+/** Maximum queue name lenght in chars */
+#define PLAT_ODP_QUEUE_NAME_LEN 32
+
+
+/** Highest scheduling priority */
+#define PLAT_ODP_SCHED_PRIO_HIGHEST  0
+
+/** Normal scheduling priority */
+#define PLAT_ODP_SCHED_PRIO_NORMAL   (ODP_CONFIG_SCHED_PRIOS / 2)
+
+/** Lowest scheduling priority */
+#define PLAT_ODP_SCHED_PRIO_LOWEST   (ODP_CONFIG_SCHED_PRIOS - 1)
+
+/** Default scheduling priority */
+#define PLAT_ODP_SCHED_PRIO_DEFAULT  PLAT_ODP_SCHED_PRIO_NORMAL
+
+/** Default queue synchronisation */
+#define PLAT_ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
+
+/** Default core group */
+#define PLAT_ODP_SCHED_GROUP_DEFAULT ODP_SCHED_GROUP_ALL
+
+#endif