Lines Matching refs:ptr
24 static void mem_test_fail(void* ptr, uint32_t should, uint32_t is) {
25 printf("ERROR at %p: should be 0x%x, is 0x%x\n", ptr, should, is);
27 ptr = (void*)ROUNDDOWN((uintptr_t)ptr, 64);
28 hexdump(ptr, 128);
31 static zx_status_t do_pattern_test(void* ptr, size_t len, uint32_t pat) {
32 volatile uint32_t* vbuf32 = reinterpret_cast<volatile uint32_t*>(ptr);
50 static zx_status_t do_moving_inversion_test(void* ptr, size_t len, uint32_t pat) {
51 volatile uint32_t* vbuf32 = reinterpret_cast<volatile uint32_t*>(ptr);
95 static void do_mem_tests(void* ptr, size_t len) {
100 volatile uint32_t* vbuf32 = reinterpret_cast<volatile uint32_t*>(ptr);
121 if (do_pattern_test(ptr, len, pat[p]) < 0)
126 if (do_pattern_test(ptr, len, p) < 0)
131 if (do_pattern_test(ptr, len, ((~p) << 16) | p) < 0)
138 if (do_moving_inversion_test(ptr, len, pat[p]) < 0)
143 if (do_moving_inversion_test(ptr, len, p) < 0)
148 if (do_moving_inversion_test(ptr, len, ((~p) << 16) | p) < 0)
166 void* ptr;
178 "memtest", len, &ptr, 0, VmAspace::VMM_FLAG_COMMIT,
186 pa = vaddr_to_paddr(ptr);
189 printf("got buffer at %p of length 0x%lx\n", ptr, len);
192 do_mem_tests(ptr, len);
195 VmAspace::kernel_aspace()->FreeRegion(reinterpret_cast<vaddr_t>(ptr));
197 void* ptr = argv[1].p;
201 do_mem_tests(ptr, len);