blob: e7a38a7c719ca2176e40ac4dceee6416f3d42c64 (
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
|
/* Copyright (c) 2015, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef ODP_MASK_COMMON_H_
#define ODP_MASK_COMMON_H_
/*
* The same set of tests are used for testing both the odp_thrmask_ and
* odp_cpumask_ APIs.
*
* To build the thrmask tests TEST_THRMASK must be defined.
*/
#ifdef TEST_THRMASK
typedef odp_thrmask_t _odp_mask_t;
#define MASK_API_PREFIX(n) odp_thrmask_##n
#define MASK_TESTFUNC(n) void thread_test_odp_thrmask_##n(void)
#else
typedef odp_cpumask_t _odp_mask_t;
#define MASK_API_PREFIX(n) odp_cpumask_##n
#define MASK_TESTFUNC(n) void cpumask_test_odp_cpumask_##n(void)
#endif
#define _odp_mask_from_str MASK_API_PREFIX(from_str)
#define _odp_mask_to_str MASK_API_PREFIX(to_str)
#define _odp_mask_equal MASK_API_PREFIX(equal)
#define _odp_mask_zero MASK_API_PREFIX(zero)
#define _odp_mask_set MASK_API_PREFIX(set)
#define _odp_mask_clr MASK_API_PREFIX(clr)
#define _odp_mask_isset MASK_API_PREFIX(isset)
#define _odp_mask_count MASK_API_PREFIX(count)
#define _odp_mask_and MASK_API_PREFIX(and)
#define _odp_mask_or MASK_API_PREFIX(or)
#define _odp_mask_xor MASK_API_PREFIX(xor)
#define _odp_mask_copy MASK_API_PREFIX(copy)
#define _odp_mask_first MASK_API_PREFIX(first)
#define _odp_mask_next MASK_API_PREFIX(next)
#define _odp_mask_last MASK_API_PREFIX(last)
#define _odp_mask_setall MASK_API_PREFIX(setall)
unsigned mask_capacity(void);
MASK_TESTFUNC(to_from_str);
MASK_TESTFUNC(equal);
MASK_TESTFUNC(zero);
MASK_TESTFUNC(set);
MASK_TESTFUNC(clr);
MASK_TESTFUNC(isset);
MASK_TESTFUNC(count);
MASK_TESTFUNC(and);
MASK_TESTFUNC(or);
MASK_TESTFUNC(xor);
MASK_TESTFUNC(copy);
MASK_TESTFUNC(first);
MASK_TESTFUNC(last);
MASK_TESTFUNC(next);
MASK_TESTFUNC(setall);
#endif
|