Lines Matching refs:cpumask

31   char* cpumask;  in check_affinity()  local
35 cpumask = (char*)arg; in check_affinity()
39 r = uv_thread_setaffinity(&tid, cpumask, NULL, cpumasksize); in check_affinity()
41 r = uv_thread_setaffinity(&tid, cpumask + cpumasksize, cpumask, cpumasksize); in check_affinity()
52 char* cpumask; in TEST_IMPL() local
68 cpumask = calloc(4 * cpumasksize, 1); in TEST_IMPL()
69 ASSERT(cpumask); in TEST_IMPL()
71 r = uv_thread_getaffinity(&threads[0], cpumask, cpumasksize); in TEST_IMPL()
73 ASSERT(cpumask[0] && "test must be run with cpu 0 affinity"); in TEST_IMPL()
75 while (cpumask[++ncpus]) { } in TEST_IMPL()
76 memset(cpumask, 0, 4 * cpumasksize); in TEST_IMPL()
83 cpumask[t1second + 0] = 1; in TEST_IMPL()
84 cpumask[t2first + 0] = 1; in TEST_IMPL()
85 cpumask[t1first + (ncpus >= 2)] = 1; in TEST_IMPL()
86 cpumask[t2second + (ncpus >= 2)] = 1; in TEST_IMPL()
88 cpumask[t1second + 2] = 1; in TEST_IMPL()
89 cpumask[t2first + 2] = 1; in TEST_IMPL()
90 cpumask[t1first + 3] = 1; in TEST_IMPL()
91 cpumask[t2second + 3] = 1; in TEST_IMPL()
94 cpumask[t1second + 2] = 1; in TEST_IMPL()
95 cpumask[t2first + 2] = 1; in TEST_IMPL()
98 cpumask[t1first + 3] = 1; in TEST_IMPL()
99 cpumask[t2second + 3] = 1; in TEST_IMPL()
105 &cpumask[t1first])); in TEST_IMPL()
108 &cpumask[t2first])); in TEST_IMPL()
112 ASSERT(cpumask[t1first + 0] == (ncpus == 1)); in TEST_IMPL()
113 ASSERT(cpumask[t1first + 1] == (ncpus >= 2)); in TEST_IMPL()
114 ASSERT_OK(cpumask[t1first + 2]); in TEST_IMPL()
115 ASSERT(cpumask[t1first + 3] == (ncpus >= 4)); in TEST_IMPL()
117 ASSERT_EQ(1, cpumask[t2first + 0]); in TEST_IMPL()
118 ASSERT_OK(cpumask[t2first + 1]); in TEST_IMPL()
119 ASSERT(cpumask[t2first + 2] == (ncpus >= 3)); in TEST_IMPL()
120 ASSERT_OK(cpumask[t2first + 3]); in TEST_IMPL()
125 memset(cpumask, 0, cpumasksize); in TEST_IMPL()
126 cpumask[c] = 1; in TEST_IMPL()
127 r = uv_thread_setaffinity(&threads[0], cpumask, NULL, cpumasksize); in TEST_IMPL()
130 memset(cpumask, 0, cpumasksize); in TEST_IMPL()
131 r = uv_thread_getaffinity(&threads[0], cpumask, cpumasksize); in TEST_IMPL()
135 ASSERT_EQ(1, cpumask[i]); in TEST_IMPL()
137 ASSERT_OK(cpumask[i]); in TEST_IMPL()
140 free(cpumask); in TEST_IMPL()