@@ -18,23 +18,13 @@
extern "C" {
#endif
-
-
#include <odp_std_types.h>
-
-/** @internal */
-#define ODP_COREMASK_SIZE_U64 1
+#include <plat/odp_coremask.h>
/**
* Core mask
- *
- * Don't access directly, use access functions.
*/
-typedef struct odp_coremask_t {
- uint64_t _u64[ODP_COREMASK_SIZE_U64]; /**< @private Mask*/
-
-} odp_coremask_t;
-
+typedef plat_odp_coremask_t odp_coremask_t;
/**
@@ -86,10 +76,7 @@ void odp_coremask_from_u64(const uint64_t *u64, int num, odp_coremask_t *mask);
* Clear entire mask
* @param mask Core mask to flush with zero value
*/
-static inline void odp_coremask_zero(odp_coremask_t *mask)
-{
- mask->_u64[0] = 0;
-}
+void odp_coremask_zero(odp_coremask_t *mask);
/**
* Add core to mask
@@ -120,8 +107,6 @@ int odp_coremask_isset(int core, const odp_coremask_t *mask);
*/
int odp_coremask_count(const odp_coremask_t *mask);
-
-
/**
* Logical AND over two source masks.
*
@@ -129,11 +114,8 @@ int odp_coremask_count(const odp_coremask_t *mask);
* @param src1 Source mask 1
* @param src2 Source mask 2
*/
-static inline void odp_coremask_and(odp_coremask_t *dest, odp_coremask_t *src1,
- odp_coremask_t *src2)
-{
- dest->_u64[0] = src1->_u64[0] & src2->_u64[0];
-}
+void odp_coremask_and(odp_coremask_t *dest, odp_coremask_t *src1,
+ odp_coremask_t *src2);
/**
* Logical OR over two source masks.
@@ -142,11 +124,8 @@ static inline void odp_coremask_and(odp_coremask_t *dest, odp_coremask_t *src1,
* @param src1 Source mask 1
* @param src2 Source mask 2
*/
-static inline void odp_coremask_or(odp_coremask_t *dest, odp_coremask_t *src1,
- odp_coremask_t *src2)
-{
- dest->_u64[0] = src1->_u64[0] | src2->_u64[0];
-}
+void odp_coremask_or(odp_coremask_t *dest, odp_coremask_t *src1,
+ odp_coremask_t *src2);
/**
* Logical XOR over two source masks.
@@ -155,20 +134,13 @@ static inline void odp_coremask_or(odp_coremask_t *dest, odp_coremask_t *src1,
* @param src1 Source mask 1
* @param src2 Source mask 2
*/
-static inline void odp_coremask_xor(odp_coremask_t *dest, odp_coremask_t *src1,
- odp_coremask_t *src2)
-{
- dest->_u64[0] = src1->_u64[0] ^ src2->_u64[0];
-}
+void odp_coremask_xor(odp_coremask_t *dest, odp_coremask_t *src1,
+ odp_coremask_t *src2);
/**
* Test if two masks contain the same cores
*/
-static inline int odp_coremask_equal(odp_coremask_t *mask1,
- odp_coremask_t *mask2)
-{
- return (mask1->_u64[0] == mask2->_u64[0]);
-}
+int odp_coremask_equal(odp_coremask_t *mask1, odp_coremask_t *mask2);
#ifdef __cplusplus
}
new file mode 100644
@@ -0,0 +1,91 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP core masks and enumeration
+ */
+
+#ifndef ODP_COREMASK_H_
+#error This file should be included only into corresponding top level header
+#else
+
+/** @internal */
+#define ODP_COREMASK_SIZE_U64 1
+
+/**
+ * Core mask
+ *
+ * Don't access directly, use access functions.
+ */
+typedef struct plat_odp_coremask_t {
+ uint64_t _u64[ODP_COREMASK_SIZE_U64]; /**< @private Mask*/
+
+} plat_odp_coremask_t;
+
+/**
+ * Clear entire mask
+ * @param mask Core mask to flush with zero value
+ */
+static inline void odp_coremask_zero(plat_odp_coremask_t *mask)
+{
+ mask->_u64[0] = 0;
+}
+
+/**
+ * Logical AND over two source masks.
+ *
+ * @param dest Destination mask, can be one of the source masks
+ * @param src1 Source mask 1
+ * @param src2 Source mask 2
+ */
+static inline void odp_coremask_and(plat_odp_coremask_t *dest,
+ plat_odp_coremask_t *src1,
+ plat_odp_coremask_t *src2)
+{
+ dest->_u64[0] = src1->_u64[0] & src2->_u64[0];
+}
+
+/**
+ * Logical OR over two source masks.
+ *
+ * @param dest Destination mask, can be one of the source masks
+ * @param src1 Source mask 1
+ * @param src2 Source mask 2
+ */
+static inline void odp_coremask_or(plat_odp_coremask_t *dest,
+ plat_odp_coremask_t *src1,
+ plat_odp_coremask_t *src2)
+{
+ dest->_u64[0] = src1->_u64[0] | src2->_u64[0];
+}
+
+/**
+ * Logical XOR over two source masks.
+ *
+ * @param dest Destination mask, can be one of the source masks
+ * @param src1 Source mask 1
+ * @param src2 Source mask 2
+ */
+static inline void odp_coremask_xor(plat_odp_coremask_t *dest,
+ plat_odp_coremask_t *src1,
+ plat_odp_coremask_t *src2)
+{
+ dest->_u64[0] = src1->_u64[0] ^ src2->_u64[0];
+}
+
+/**
+ * Test if two masks contain the same cores
+ */
+static inline int odp_coremask_equal(plat_odp_coremask_t *mask1,
+ plat_odp_coremask_t *mask2)
+{
+ return (mask1->_u64[0] == mask2->_u64[0]);
+}
+
+#endif
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> --- include/odp_coremask.h | 48 +++-------- platform/linux-generic/include/plat/odp_coremask.h | 91 ++++++++++++++++++++ 2 files changed, 101 insertions(+), 38 deletions(-) create mode 100644 platform/linux-generic/include/plat/odp_coremask.h