diff mbox

[PATCHv3,4/9] api: cpumask: add odp_cpumask_copy

Message ID 1421275706-11176-5-git-send-email-anders.roxell@linaro.org
State Accepted
Commit c8906ca2935a10344c256d930fbd90907295b804
Headers show

Commit Message

Anders Roxell Jan. 14, 2015, 10:48 p.m. UTC
From: Robbie King <robking@cisco.com>

To be able to copy a const mask so it can be modified.

Signed-off-by: Robbie King <robking@cisco.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 platform/linux-generic/include/api/odp_cpumask.h | 5 +++++
 platform/linux-generic/odp_cpumask.c             | 5 +++++
 2 files changed, 10 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_cpumask.h b/platform/linux-generic/include/api/odp_cpumask.h
index 2e10c4e..0090f9a 100644
--- a/platform/linux-generic/include/api/odp_cpumask.h
+++ b/platform/linux-generic/include/api/odp_cpumask.h
@@ -127,6 +127,11 @@  int odp_cpumask_equal(const odp_cpumask_t *mask1,
 		      const odp_cpumask_t *mask2);
 
 /**
+ * Copy a CPU mask
+ */
+void odp_cpumask_copy(odp_cpumask_t *dest, const odp_cpumask_t *src);
+
+/**
  * @}
  */
 
diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
index c15a971..6be7f1e 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -170,3 +170,8 @@  int odp_cpumask_equal(const odp_cpumask_t *mask1,
 {
 	return CPU_EQUAL(&mask1->set, &mask2->set);
 }
+
+void odp_cpumask_copy(odp_cpumask_t *dest, const odp_cpumask_t *src)
+{
+	memcpy(&dest->set, &src->set, sizeof(src->set));
+}