Lines Matching defs:addr
42 static void write_bytes(char *addr, size_t length)
47 *(addr + i) = (char)i;
50 static unsigned long virt_to_pfn(void *addr)
59 lseek(fd, (unsigned long)addr / pagesize * sizeof(pagemap), SEEK_SET);
106 void *addr;
116 addr = mmap(MAP_ADDR, maplength, PROT_READ | PROT_WRITE, MAP_FLAGS, -1, 0);
117 if (addr == MAP_FAILED) {
123 write_bytes(addr, maplength);
125 pfn = virt_to_pfn(addr);
127 munmap(addr, maplength);
132 printf("Returned address is %p whose pfn is %lx\n", addr, pfn);
135 munmap(addr, maplength);
141 if (munmap(addr, maplength)) {