• Home
  • Raw
  • Download

Lines Matching refs:ref

96 	void (*update_entry)(grant_ref_t ref, domid_t domid,
106 int (*end_foreign_access_ref)(grant_ref_t ref, int readonly);
114 unsigned long (*end_foreign_transfer_ref)(grant_ref_t ref);
121 int (*query_foreign_access)(grant_ref_t ref);
130 void (*update_subpage_entry)(grant_ref_t ref, domid_t domid,
143 void (*update_trans_entry)(grant_ref_t ref, domid_t domid, int flags,
172 int ref, rc = 0; in get_free_entries() local
183 ref = head = gnttab_free_head; in get_free_entries()
192 return ref; in get_free_entries()
221 static void put_free_entry(grant_ref_t ref) in put_free_entry() argument
225 gnttab_entry(ref) = gnttab_free_head; in put_free_entry()
226 gnttab_free_head = ref; in put_free_entry()
243 static void gnttab_update_entry_v1(grant_ref_t ref, domid_t domid, in gnttab_update_entry_v1() argument
246 gnttab_shared.v1[ref].domid = domid; in gnttab_update_entry_v1()
247 gnttab_shared.v1[ref].frame = frame; in gnttab_update_entry_v1()
249 gnttab_shared.v1[ref].flags = flags; in gnttab_update_entry_v1()
252 static void gnttab_update_entry_v2(grant_ref_t ref, domid_t domid, in gnttab_update_entry_v2() argument
255 gnttab_shared.v2[ref].hdr.domid = domid; in gnttab_update_entry_v2()
256 gnttab_shared.v2[ref].full_page.frame = frame; in gnttab_update_entry_v2()
258 gnttab_shared.v2[ref].hdr.flags = GTF_permit_access | flags; in gnttab_update_entry_v2()
264 void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid, in gnttab_grant_foreign_access_ref() argument
267 gnttab_interface->update_entry(ref, domid, frame, in gnttab_grant_foreign_access_ref()
275 int ref; in gnttab_grant_foreign_access() local
277 ref = get_free_entries(1); in gnttab_grant_foreign_access()
278 if (unlikely(ref < 0)) in gnttab_grant_foreign_access()
281 gnttab_grant_foreign_access_ref(ref, domid, frame, readonly); in gnttab_grant_foreign_access()
283 return ref; in gnttab_grant_foreign_access()
287 static void gnttab_update_subpage_entry_v2(grant_ref_t ref, domid_t domid, in gnttab_update_subpage_entry_v2() argument
291 gnttab_shared.v2[ref].sub_page.frame = frame; in gnttab_update_subpage_entry_v2()
292 gnttab_shared.v2[ref].sub_page.page_off = page_off; in gnttab_update_subpage_entry_v2()
293 gnttab_shared.v2[ref].sub_page.length = length; in gnttab_update_subpage_entry_v2()
294 gnttab_shared.v2[ref].hdr.domid = domid; in gnttab_update_subpage_entry_v2()
296 gnttab_shared.v2[ref].hdr.flags = in gnttab_update_subpage_entry_v2()
300 int gnttab_grant_foreign_access_subpage_ref(grant_ref_t ref, domid_t domid, in gnttab_grant_foreign_access_subpage_ref() argument
312 gnttab_interface->update_subpage_entry(ref, domid, frame, flags, in gnttab_grant_foreign_access_subpage_ref()
323 int ref, rc; in gnttab_grant_foreign_access_subpage() local
325 ref = get_free_entries(1); in gnttab_grant_foreign_access_subpage()
326 if (unlikely(ref < 0)) in gnttab_grant_foreign_access_subpage()
329 rc = gnttab_grant_foreign_access_subpage_ref(ref, domid, frame, flags, in gnttab_grant_foreign_access_subpage()
332 put_free_entry(ref); in gnttab_grant_foreign_access_subpage()
336 return ref; in gnttab_grant_foreign_access_subpage()
346 static void gnttab_update_trans_entry_v2(grant_ref_t ref, domid_t domid, in gnttab_update_trans_entry_v2() argument
350 gnttab_shared.v2[ref].transitive.trans_domid = trans_domid; in gnttab_update_trans_entry_v2()
351 gnttab_shared.v2[ref].transitive.gref = trans_gref; in gnttab_update_trans_entry_v2()
352 gnttab_shared.v2[ref].hdr.domid = domid; in gnttab_update_trans_entry_v2()
354 gnttab_shared.v2[ref].hdr.flags = in gnttab_update_trans_entry_v2()
358 int gnttab_grant_foreign_access_trans_ref(grant_ref_t ref, domid_t domid, in gnttab_grant_foreign_access_trans_ref() argument
369 gnttab_interface->update_trans_entry(ref, domid, flags, trans_domid, in gnttab_grant_foreign_access_trans_ref()
380 int ref, rc; in gnttab_grant_foreign_access_trans() local
382 ref = get_free_entries(1); in gnttab_grant_foreign_access_trans()
383 if (unlikely(ref < 0)) in gnttab_grant_foreign_access_trans()
386 rc = gnttab_grant_foreign_access_trans_ref(ref, domid, flags, in gnttab_grant_foreign_access_trans()
389 put_free_entry(ref); in gnttab_grant_foreign_access_trans()
393 return ref; in gnttab_grant_foreign_access_trans()
403 static int gnttab_query_foreign_access_v1(grant_ref_t ref) in gnttab_query_foreign_access_v1() argument
405 return gnttab_shared.v1[ref].flags & (GTF_reading|GTF_writing); in gnttab_query_foreign_access_v1()
408 static int gnttab_query_foreign_access_v2(grant_ref_t ref) in gnttab_query_foreign_access_v2() argument
410 return grstatus[ref] & (GTF_reading|GTF_writing); in gnttab_query_foreign_access_v2()
413 int gnttab_query_foreign_access(grant_ref_t ref) in gnttab_query_foreign_access() argument
415 return gnttab_interface->query_foreign_access(ref); in gnttab_query_foreign_access()
419 static int gnttab_end_foreign_access_ref_v1(grant_ref_t ref, int readonly) in gnttab_end_foreign_access_ref_v1() argument
424 pflags = &gnttab_shared.v1[ref].flags; in gnttab_end_foreign_access_ref_v1()
435 static int gnttab_end_foreign_access_ref_v2(grant_ref_t ref, int readonly) in gnttab_end_foreign_access_ref_v2() argument
437 gnttab_shared.v2[ref].hdr.flags = 0; in gnttab_end_foreign_access_ref_v2()
439 if (grstatus[ref] & (GTF_reading|GTF_writing)) { in gnttab_end_foreign_access_ref_v2()
458 static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly) in _gnttab_end_foreign_access_ref() argument
460 return gnttab_interface->end_foreign_access_ref(ref, readonly); in _gnttab_end_foreign_access_ref()
463 int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly) in gnttab_end_foreign_access_ref() argument
465 if (_gnttab_end_foreign_access_ref(ref, readonly)) in gnttab_end_foreign_access_ref()
467 pr_warn("WARNING: g.e. %#x still in use!\n", ref); in gnttab_end_foreign_access_ref()
474 grant_ref_t ref; member
499 if (_gnttab_end_foreign_access_ref(entry->ref, entry->ro)) { in gnttab_handle_deferred()
500 put_free_entry(entry->ref); in gnttab_handle_deferred()
503 entry->ref, page_to_pfn(entry->page)); in gnttab_handle_deferred()
506 pr_info("freeing g.e. %#x\n", entry->ref); in gnttab_handle_deferred()
512 entry->ref); in gnttab_handle_deferred()
529 static void gnttab_add_deferred(grant_ref_t ref, bool readonly, in gnttab_add_deferred() argument
538 entry->ref = ref; in gnttab_add_deferred()
552 what, ref, page ? page_to_pfn(page) : -1); in gnttab_add_deferred()
555 void gnttab_end_foreign_access(grant_ref_t ref, int readonly, in gnttab_end_foreign_access() argument
558 if (gnttab_end_foreign_access_ref(ref, readonly)) { in gnttab_end_foreign_access()
559 put_free_entry(ref); in gnttab_end_foreign_access()
563 gnttab_add_deferred(ref, readonly, in gnttab_end_foreign_access()
570 int ref; in gnttab_grant_foreign_transfer() local
572 ref = get_free_entries(1); in gnttab_grant_foreign_transfer()
573 if (unlikely(ref < 0)) in gnttab_grant_foreign_transfer()
575 gnttab_grant_foreign_transfer_ref(ref, domid, pfn); in gnttab_grant_foreign_transfer()
577 return ref; in gnttab_grant_foreign_transfer()
581 void gnttab_grant_foreign_transfer_ref(grant_ref_t ref, domid_t domid, in gnttab_grant_foreign_transfer_ref() argument
584 gnttab_interface->update_entry(ref, domid, pfn, GTF_accept_transfer); in gnttab_grant_foreign_transfer_ref()
588 static unsigned long gnttab_end_foreign_transfer_ref_v1(grant_ref_t ref) in gnttab_end_foreign_transfer_ref_v1() argument
594 pflags = &gnttab_shared.v1[ref].flags; in gnttab_end_foreign_transfer_ref_v1()
613 frame = gnttab_shared.v1[ref].frame; in gnttab_end_foreign_transfer_ref_v1()
619 static unsigned long gnttab_end_foreign_transfer_ref_v2(grant_ref_t ref) in gnttab_end_foreign_transfer_ref_v2() argument
625 pflags = &gnttab_shared.v2[ref].hdr.flags; in gnttab_end_foreign_transfer_ref_v2()
644 frame = gnttab_shared.v2[ref].full_page.frame; in gnttab_end_foreign_transfer_ref_v2()
650 unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref) in gnttab_end_foreign_transfer_ref() argument
652 return gnttab_interface->end_foreign_transfer_ref(ref); in gnttab_end_foreign_transfer_ref()
656 unsigned long gnttab_end_foreign_transfer(grant_ref_t ref) in gnttab_end_foreign_transfer() argument
658 unsigned long frame = gnttab_end_foreign_transfer_ref(ref); in gnttab_end_foreign_transfer()
659 put_free_entry(ref); in gnttab_end_foreign_transfer()
664 void gnttab_free_grant_reference(grant_ref_t ref) in gnttab_free_grant_reference() argument
666 put_free_entry(ref); in gnttab_free_grant_reference()
672 grant_ref_t ref; in gnttab_free_grant_references() local
678 ref = head; in gnttab_free_grant_references()
679 while (gnttab_entry(ref) != GNTTAB_LIST_END) { in gnttab_free_grant_references()
680 ref = gnttab_entry(ref); in gnttab_free_grant_references()
683 gnttab_entry(ref) = gnttab_free_head; in gnttab_free_grant_references()