Lines Matching refs:iep
79 import_buffer(import_export_t *iep, void *uaddr, void *kaddr, size_t size, in import_buffer() argument
82 iep->ie_uaddr = uaddr; in import_buffer()
83 iep->ie_size = size; in import_buffer()
84 iep->ie_flags = flags & IE_EXPORT; in import_buffer()
87 *iep = null_ie; in import_buffer()
92 iep->ie_kaddr = kmem_alloc(size, KM_SLEEP); in import_buffer()
93 iep->ie_flags |= IE_FREE; in import_buffer()
95 iep->ie_kaddr = kaddr; in import_buffer()
96 iep->ie_flags &= ~IE_FREE; in import_buffer()
100 (ddi_copyin(uaddr, iep->ie_kaddr, size, 0) != 0)) { in import_buffer()
101 if (iep->ie_flags & IE_FREE) { in import_buffer()
102 kmem_free(iep->ie_kaddr, iep->ie_size); in import_buffer()
103 iep->ie_kaddr = NULL; in import_buffer()
104 iep->ie_flags = 0; in import_buffer()
113 export_buffer(import_export_t *iep, int *error) in export_buffer() argument
117 if (iep->ie_size == 0 || iep->ie_uaddr == NULL) in export_buffer()
125 if ((iep->ie_flags & IE_EXPORT) && (*error >= 0) && in export_buffer()
126 (ddi_copyout(iep->ie_kaddr, iep->ie_uaddr, iep->ie_size, 0) != 0)) in export_buffer()
128 if (iep->ie_flags & IE_FREE) { in export_buffer()
129 kmem_free(iep->ie_kaddr, iep->ie_size); in export_buffer()
130 iep->ie_kaddr = NULL; in export_buffer()
131 iep->ie_flags = 0; in export_buffer()
148 import_handle(import_export_t *iep, void *field, size_t size, int flags) in import_handle() argument
155 err = import_buffer(iep, ptr, NULL, size, (flags)); in import_handle()
158 set_xen_guest_handle((*hdl), (void *)((iep)->ie_kaddr)); in import_handle()