Lines Matching refs:ptr
63 int migrate(uint64_t *ptr, int n1, int n2)
79 ret = move_pages(0, 1, (void **) &ptr, &n2, &status,
97 void *access_mem(void *ptr)
100 volatile uint64_t *x = ptr;
120 uint64_t *ptr;
126 ptr = mmap(NULL, TWOMEG, PROT_READ | PROT_WRITE,
128 ASSERT_NE(ptr, MAP_FAILED);
130 memset(ptr, 0xde, TWOMEG);
132 if (pthread_create(&self->threads[i], NULL, access_mem, ptr))
135 ASSERT_EQ(migrate(ptr, self->n1, self->n2), 0);
146 uint64_t *ptr;
152 ptr = mmap(NULL, TWOMEG, PROT_READ | PROT_WRITE,
154 ASSERT_NE(ptr, MAP_FAILED);
156 memset(ptr, 0xde, TWOMEG);
164 access_mem(ptr);
170 ASSERT_EQ(migrate(ptr, self->n1, self->n2), 0);
180 uint64_t *ptr;
186 ptr = mmap(NULL, 2*TWOMEG, PROT_READ | PROT_WRITE,
188 ASSERT_NE(ptr, MAP_FAILED);
190 ptr = (uint64_t *) ALIGN((uintptr_t) ptr, TWOMEG);
191 ASSERT_EQ(madvise(ptr, TWOMEG, MADV_HUGEPAGE), 0);
192 memset(ptr, 0xde, TWOMEG);
194 if (pthread_create(&self->threads[i], NULL, access_mem, ptr))
197 ASSERT_EQ(migrate(ptr, self->n1, self->n2), 0);