aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_thrmask.c
blob: f2144287d590f97b240dcadb40abb286b3e5015a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* Copyright (c) 2015, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#include "config.h"

#include <odp/api/thrmask.h>
#include <odp/api/cpumask.h>

void odp_thrmask_from_str(odp_thrmask_t *mask, const char *str)
{
	odp_cpumask_from_str(&mask->m, str);
}

int32_t odp_thrmask_to_str(const odp_thrmask_t *mask, char *str, int32_t size)
{
	return odp_cpumask_to_str(&mask->m, str, size);
}

void odp_thrmask_zero(odp_thrmask_t *mask)
{
	odp_cpumask_zero(&mask->m);
}

void odp_thrmask_set(odp_thrmask_t *mask, int thr)
{
	odp_cpumask_set(&mask->m, thr);
}

void odp_thrmask_setall(odp_thrmask_t *mask)
{
	odp_cpumask_setall(&mask->m);
}

void odp_thrmask_clr(odp_thrmask_t *mask, int thr)
{
	odp_cpumask_clr(&mask->m, thr);
}

int odp_thrmask_isset(const odp_thrmask_t *mask, int thr)
{
	return odp_cpumask_isset(&mask->m, thr);
}

int odp_thrmask_count(const odp_thrmask_t *mask)
{
	return odp_cpumask_count(&mask->m);
}

void odp_thrmask_and(odp_thrmask_t *dest, const odp_thrmask_t *src1,
		     const odp_thrmask_t *src2)
{
	odp_cpumask_and(&dest->m, &src1->m, &src2->m);
}

void odp_thrmask_or(odp_thrmask_t *dest, const odp_thrmask_t *src1,
		    const odp_thrmask_t *src2)
{
	odp_cpumask_or(&dest->m, &src1->m, &src2->m);
}

void odp_thrmask_xor(odp_thrmask_t *dest, const odp_thrmask_t *src1,
		     const odp_thrmask_t *src2)
{
	odp_cpumask_xor(&dest->m, &src1->m, &src2->m);
}

int odp_thrmask_equal(const odp_thrmask_t *mask1,
		      const odp_thrmask_t *mask2)
{
	return odp_cpumask_equal(&mask1->m, &mask2->m);
}

void odp_thrmask_copy(odp_thrmask_t *dest, const odp_thrmask_t *src)
{
	odp_cpumask_copy(&dest->m, &src->m);
}

int odp_thrmask_first(const odp_thrmask_t *mask)
{
	return odp_cpumask_first(&mask->m);
}

int odp_thrmask_last(const odp_thrmask_t *mask)
{
	return odp_cpumask_last(&mask->m);
}

int odp_thrmask_next(const odp_thrmask_t *mask, int thr)
{
	return odp_cpumask_next(&mask->m, thr);
}