Lines Matching refs:uffd_desc
102 struct uffd_desc *uffd_setup_demand_paging(int uffd_mode, useconds_t delay, in uffd_setup_demand_paging()
107 struct uffd_desc *uffd_desc; in uffd_setup_demand_paging() local
119 uffd_desc = malloc(sizeof(struct uffd_desc)); in uffd_setup_demand_paging()
120 TEST_ASSERT(uffd_desc, "Failed to malloc uffd descriptor"); in uffd_setup_demand_paging()
122 uffd_desc->pipefds = calloc(sizeof(int), num_readers); in uffd_setup_demand_paging()
123 TEST_ASSERT(uffd_desc->pipefds, "Failed to alloc pipes"); in uffd_setup_demand_paging()
125 uffd_desc->readers = calloc(sizeof(pthread_t), num_readers); in uffd_setup_demand_paging()
126 TEST_ASSERT(uffd_desc->readers, "Failed to alloc reader threads"); in uffd_setup_demand_paging()
128 uffd_desc->reader_args = calloc(sizeof(struct uffd_reader_args), num_readers); in uffd_setup_demand_paging()
129 TEST_ASSERT(uffd_desc->reader_args, "Failed to alloc reader_args"); in uffd_setup_demand_paging()
131 uffd_desc->num_readers = num_readers; in uffd_setup_demand_paging()
154 uffd_desc->uffd = uffd; in uffd_setup_demand_paging()
155 for (i = 0; i < uffd_desc->num_readers; ++i) { in uffd_setup_demand_paging()
160 i, uffd_desc); in uffd_setup_demand_paging()
162 uffd_desc->pipefds[i] = pipes[1]; in uffd_setup_demand_paging()
164 uffd_desc->reader_args[i].uffd_mode = uffd_mode; in uffd_setup_demand_paging()
165 uffd_desc->reader_args[i].uffd = uffd; in uffd_setup_demand_paging()
166 uffd_desc->reader_args[i].delay = delay; in uffd_setup_demand_paging()
167 uffd_desc->reader_args[i].handler = handler; in uffd_setup_demand_paging()
168 uffd_desc->reader_args[i].pipe = pipes[0]; in uffd_setup_demand_paging()
170 pthread_create(&uffd_desc->readers[i], NULL, uffd_handler_thread_fn, in uffd_setup_demand_paging()
171 &uffd_desc->reader_args[i]); in uffd_setup_demand_paging()
177 return uffd_desc; in uffd_setup_demand_paging()
180 void uffd_stop_demand_paging(struct uffd_desc *uffd) in uffd_stop_demand_paging()