Lines Matching refs:arg

214 static void	cleanup_function(void *arg, __unused int pending);
339 gntdev_alloc_gref(struct ioctl_gntdev_alloc_gref *arg) in gntdev_alloc_gref() argument
347 readonly = !(arg->flags & GNTDEV_ALLOC_FLAG_WRITABLE); in gntdev_alloc_gref()
357 error = get_file_offset(priv_user, arg->count, &file_offset); in gntdev_alloc_gref()
362 grefs = malloc(sizeof(*grefs) * arg->count, M_GNTDEV, M_WAITOK); in gntdev_alloc_gref()
364 for (i = 0; i < arg->count; i++) { in gntdev_alloc_gref()
377 error = gnttab_grant_foreign_access(arg->domid, in gntdev_alloc_gref()
387 arg->index = file_offset; in gntdev_alloc_gref()
388 for (i = 0; error == 0 && i < arg->count; i++) { in gntdev_alloc_gref()
389 if (suword32(&arg->gref_ids[i], grefs[i].gref_id) != 0) in gntdev_alloc_gref()
401 for (i = 0; i < arg->count; i++) in gntdev_alloc_gref()
413 for (i = 0; i < arg->count; i++) in gntdev_alloc_gref()
427 gntdev_dealloc_gref(struct ioctl_gntdev_dealloc_gref *arg) in gntdev_dealloc_gref() argument
438 gref = gntdev_find_grefs(priv_user, arg->index, arg->count); in gntdev_dealloc_gref()
445 count = arg->count; in gntdev_dealloc_gref()
459 put_file_offset(priv_user, arg->count, arg->index); in gntdev_dealloc_gref()
638 gntdev_map_grant_ref(struct ioctl_gntdev_map_grant_ref *arg) in gntdev_map_grant_ref() argument
650 gmap->count = arg->count; in gntdev_map_grant_ref()
652 malloc(sizeof(struct gnttab_map_grant_ref) * arg->count, in gntdev_map_grant_ref()
655 for (i = 0; i < arg->count; i++) { in gntdev_map_grant_ref()
658 error = copyin(&arg->refs[i], &ref, sizeof(ref)); in gntdev_map_grant_ref()
670 error = get_file_offset(priv_user, arg->count, &gmap->file_index); in gntdev_map_grant_ref()
681 arg->index = gmap->file_index; in gntdev_map_grant_ref()
694 gntdev_unmap_grant_ref(struct ioctl_gntdev_unmap_grant_ref *arg) in gntdev_unmap_grant_ref() argument
704 gmap = gntdev_find_gmap(priv_user, arg->index, arg->count); in gntdev_unmap_grant_ref()
721 put_file_offset(priv_user, arg->count, arg->index); in gntdev_unmap_grant_ref()
737 gntdev_get_offset_for_vaddr(struct ioctl_gntdev_get_offset_for_vaddr *arg, in gntdev_get_offset_for_vaddr() argument
751 error = vm_map_lookup(&map, arg->vaddr, VM_PROT_NONE, &entry, in gntdev_get_offset_for_vaddr()
769 arg->count = gmap->count; in gntdev_get_offset_for_vaddr()
770 arg->offset = gmap->file_index; in gntdev_get_offset_for_vaddr()
892 gntdev_set_unmap_notify(struct ioctl_gntdev_unmap_notify *arg) in gntdev_set_unmap_notify() argument
904 if (arg->action & ~(UNMAP_NOTIFY_CLEAR_BYTE|UNMAP_NOTIFY_SEND_EVENT)) in gntdev_set_unmap_notify()
907 index = arg->index & ~PAGE_MASK; in gntdev_set_unmap_notify()
911 gref->notify = malloc(sizeof(*arg), M_GNTDEV, in gntdev_set_unmap_notify()
913 return (copy_notify_helper(gref->notify, arg)); in gntdev_set_unmap_notify()
919 if (arg->index >= gmap->file_index && in gntdev_set_unmap_notify()
920 arg->index < gmap->file_index + gmap->count * PAGE_SIZE) { in gntdev_set_unmap_notify()
922 gmap->notify = malloc(sizeof(*arg), M_GNTDEV, in gntdev_set_unmap_notify()
924 error = copy_notify_helper(gmap->notify, arg); in gntdev_set_unmap_notify()
936 cleanup_function(void *arg, __unused int pending) in cleanup_function() argument
939 gref_list_dtor((struct cleanup_data_struct *) arg); in cleanup_function()
940 gmap_list_dtor((struct cleanup_data_struct *) arg); in cleanup_function()
944 per_user_data_dtor(void *arg) in per_user_data_dtor() argument
951 priv_user = (struct per_user_data *) arg; in per_user_data_dtor()