Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
grant-table.c File Reference
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/hardirq.h>
#include <xen/xen.h>
#include <xen/interface/xen.h>
#include <xen/page.h>
#include <xen/grant_table.h>
#include <xen/interface/memory.h>
#include <xen/hvc-console.h>
#include <asm/xen/hypercall.h>
#include <asm/xen/interface.h>
#include <asm/pgtable.h>
#include <asm/sync_bitops.h>

Go to the source code of this file.

Data Structures

struct  gnttab_ops
 
struct  deferred_entry
 

Macros

#define NR_RESERVED_ENTRIES   8
 
#define GNTTAB_LIST_END   0xffffffff
 
#define GREFS_PER_GRANT_FRAME
 
#define RPP   (PAGE_SIZE / sizeof(grant_ref_t))
 
#define SPP   (PAGE_SIZE / sizeof(grant_status_t))
 
#define gnttab_entry(entry)   (*__gnttab_entry(entry))
 
#define MAX_DELAY   256
 

Functions

 EXPORT_SYMBOL_GPL (xen_hvm_resume_frames)
 
void gnttab_grant_foreign_access_ref (grant_ref_t ref, domid_t domid, unsigned long frame, int readonly)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access_ref)
 
int gnttab_grant_foreign_access (domid_t domid, unsigned long frame, int readonly)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access)
 
int gnttab_grant_foreign_access_subpage_ref (grant_ref_t ref, domid_t domid, unsigned long frame, int flags, unsigned page_off, unsigned length)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access_subpage_ref)
 
int gnttab_grant_foreign_access_subpage (domid_t domid, unsigned long frame, int flags, unsigned page_off, unsigned length)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access_subpage)
 
bool gnttab_subpage_grants_available (void)
 
 EXPORT_SYMBOL_GPL (gnttab_subpage_grants_available)
 
int gnttab_grant_foreign_access_trans_ref (grant_ref_t ref, domid_t domid, int flags, domid_t trans_domid, grant_ref_t trans_gref)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access_trans_ref)
 
int gnttab_grant_foreign_access_trans (domid_t domid, int flags, domid_t trans_domid, grant_ref_t trans_gref)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_access_trans)
 
bool gnttab_trans_grants_available (void)
 
 EXPORT_SYMBOL_GPL (gnttab_trans_grants_available)
 
int gnttab_query_foreign_access (grant_ref_t ref)
 
 EXPORT_SYMBOL_GPL (gnttab_query_foreign_access)
 
int gnttab_end_foreign_access_ref (grant_ref_t ref, int readonly)
 
 EXPORT_SYMBOL_GPL (gnttab_end_foreign_access_ref)
 
void gnttab_end_foreign_access (grant_ref_t ref, int readonly, unsigned long page)
 
 EXPORT_SYMBOL_GPL (gnttab_end_foreign_access)
 
int gnttab_grant_foreign_transfer (domid_t domid, unsigned long pfn)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_transfer)
 
void gnttab_grant_foreign_transfer_ref (grant_ref_t ref, domid_t domid, unsigned long pfn)
 
 EXPORT_SYMBOL_GPL (gnttab_grant_foreign_transfer_ref)
 
unsigned long gnttab_end_foreign_transfer_ref (grant_ref_t ref)
 
 EXPORT_SYMBOL_GPL (gnttab_end_foreign_transfer_ref)
 
unsigned long gnttab_end_foreign_transfer (grant_ref_t ref)
 
 EXPORT_SYMBOL_GPL (gnttab_end_foreign_transfer)
 
void gnttab_free_grant_reference (grant_ref_t ref)
 
 EXPORT_SYMBOL_GPL (gnttab_free_grant_reference)
 
void gnttab_free_grant_references (grant_ref_t head)
 
 EXPORT_SYMBOL_GPL (gnttab_free_grant_references)
 
int gnttab_alloc_grant_references (u16 count, grant_ref_t *head)
 
 EXPORT_SYMBOL_GPL (gnttab_alloc_grant_references)
 
int gnttab_empty_grant_references (const grant_ref_t *private_head)
 
 EXPORT_SYMBOL_GPL (gnttab_empty_grant_references)
 
int gnttab_claim_grant_reference (grant_ref_t *private_head)
 
 EXPORT_SYMBOL_GPL (gnttab_claim_grant_reference)
 
void gnttab_release_grant_reference (grant_ref_t *private_head, grant_ref_t release)
 
 EXPORT_SYMBOL_GPL (gnttab_release_grant_reference)
 
void gnttab_request_free_callback (struct gnttab_free_callback *callback, void(*fn)(void *), void *arg, u16 count)
 
 EXPORT_SYMBOL_GPL (gnttab_request_free_callback)
 
void gnttab_cancel_free_callback (struct gnttab_free_callback *callback)
 
 EXPORT_SYMBOL_GPL (gnttab_cancel_free_callback)
 
unsigned int gnttab_max_grant_frames (void)
 
 EXPORT_SYMBOL_GPL (gnttab_max_grant_frames)
 
void gnttab_batch_map (struct gnttab_map_grant_ref *batch, unsigned count)
 
 EXPORT_SYMBOL_GPL (gnttab_batch_map)
 
void gnttab_batch_copy (struct gnttab_copy *batch, unsigned count)
 
 EXPORT_SYMBOL_GPL (gnttab_batch_copy)
 
int gnttab_map_refs (struct gnttab_map_grant_ref *map_ops, struct gnttab_map_grant_ref *kmap_ops, struct page **pages, unsigned int count)
 
 EXPORT_SYMBOL_GPL (gnttab_map_refs)
 
int gnttab_unmap_refs (struct gnttab_unmap_grant_ref *unmap_ops, struct gnttab_map_grant_ref *kmap_ops, struct page **pages, unsigned int count)
 
 EXPORT_SYMBOL_GPL (gnttab_unmap_refs)
 
int gnttab_resume (void)
 
int gnttab_suspend (void)
 
int gnttab_init (void)
 
 EXPORT_SYMBOL_GPL (gnttab_init)
 
 core_initcall (__gnttab_init)
 

Variables

unsigned long xen_hvm_resume_frames
 

Macro Definition Documentation

#define gnttab_entry (   entry)    (*__gnttab_entry(entry))

Definition at line 170 of file grant-table.c.

#define GNTTAB_LIST_END   0xffffffff

Definition at line 58 of file grant-table.c.

#define GREFS_PER_GRANT_FRAME
Value:
(grant_table_version == 1 ? \
(PAGE_SIZE / sizeof(struct grant_entry_v1)) : \
(PAGE_SIZE / sizeof(union grant_entry_v2)))

Definition at line 59 of file grant-table.c.

#define MAX_DELAY   256

Definition at line 828 of file grant-table.c.

#define NR_RESERVED_ENTRIES   8

Definition at line 57 of file grant-table.c.

#define RPP   (PAGE_SIZE / sizeof(grant_ref_t))

Definition at line 162 of file grant-table.c.

#define SPP   (PAGE_SIZE / sizeof(grant_status_t))

Definition at line 163 of file grant-table.c.

Function Documentation

core_initcall ( __gnttab_init  )
EXPORT_SYMBOL_GPL ( xen_hvm_resume_frames  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access_ref  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access_subpage_ref  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access_subpage  )
EXPORT_SYMBOL_GPL ( gnttab_subpage_grants_available  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access_trans_ref  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_access_trans  )
EXPORT_SYMBOL_GPL ( gnttab_trans_grants_available  )
EXPORT_SYMBOL_GPL ( gnttab_query_foreign_access  )
EXPORT_SYMBOL_GPL ( gnttab_end_foreign_access_ref  )
EXPORT_SYMBOL_GPL ( gnttab_end_foreign_access  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_transfer  )
EXPORT_SYMBOL_GPL ( gnttab_grant_foreign_transfer_ref  )
EXPORT_SYMBOL_GPL ( gnttab_end_foreign_transfer_ref  )
EXPORT_SYMBOL_GPL ( gnttab_end_foreign_transfer  )
EXPORT_SYMBOL_GPL ( gnttab_free_grant_reference  )
EXPORT_SYMBOL_GPL ( gnttab_free_grant_references  )
EXPORT_SYMBOL_GPL ( gnttab_alloc_grant_references  )
EXPORT_SYMBOL_GPL ( gnttab_empty_grant_references  )
EXPORT_SYMBOL_GPL ( gnttab_claim_grant_reference  )
EXPORT_SYMBOL_GPL ( gnttab_release_grant_reference  )
EXPORT_SYMBOL_GPL ( gnttab_request_free_callback  )
EXPORT_SYMBOL_GPL ( gnttab_cancel_free_callback  )
EXPORT_SYMBOL_GPL ( gnttab_max_grant_frames  )
EXPORT_SYMBOL_GPL ( gnttab_batch_map  )
EXPORT_SYMBOL_GPL ( gnttab_batch_copy  )
EXPORT_SYMBOL_GPL ( gnttab_map_refs  )
EXPORT_SYMBOL_GPL ( gnttab_unmap_refs  )
EXPORT_SYMBOL_GPL ( gnttab_init  )
int gnttab_alloc_grant_references ( u16  count,
grant_ref_t head 
)

Definition at line 694 of file grant-table.c.

void gnttab_batch_copy ( struct gnttab_copy batch,
unsigned  count 
)

Definition at line 860 of file grant-table.c.

void gnttab_batch_map ( struct gnttab_map_grant_ref batch,
unsigned  count 
)

Definition at line 847 of file grant-table.c.

void gnttab_cancel_free_callback ( struct gnttab_free_callback callback)

Definition at line 749 of file grant-table.c.

int gnttab_claim_grant_reference ( grant_ref_t private_head)

Definition at line 713 of file grant-table.c.

int gnttab_empty_grant_references ( const grant_ref_t private_head)

Definition at line 707 of file grant-table.c.

void gnttab_end_foreign_access ( grant_ref_t  ref,
int  readonly,
unsigned long  page 
)

Definition at line 558 of file grant-table.c.

int gnttab_end_foreign_access_ref ( grant_ref_t  ref,
int  readonly 
)

Definition at line 466 of file grant-table.c.

unsigned long gnttab_end_foreign_transfer ( grant_ref_t  ref)

Definition at line 659 of file grant-table.c.

unsigned long gnttab_end_foreign_transfer_ref ( grant_ref_t  ref)

Definition at line 653 of file grant-table.c.

void gnttab_free_grant_reference ( grant_ref_t  ref)

Definition at line 667 of file grant-table.c.

void gnttab_free_grant_references ( grant_ref_t  head)

Definition at line 673 of file grant-table.c.

int gnttab_grant_foreign_access ( domid_t  domid,
unsigned long  frame,
int  readonly 
)

Definition at line 275 of file grant-table.c.

void gnttab_grant_foreign_access_ref ( grant_ref_t  ref,
domid_t  domid,
unsigned long  frame,
int  readonly 
)

Definition at line 267 of file grant-table.c.

int gnttab_grant_foreign_access_subpage ( domid_t  domid,
unsigned long  frame,
int  flags,
unsigned  page_off,
unsigned  length 
)

Definition at line 322 of file grant-table.c.

int gnttab_grant_foreign_access_subpage_ref ( grant_ref_t  ref,
domid_t  domid,
unsigned long  frame,
int  flags,
unsigned  page_off,
unsigned  length 
)

Definition at line 303 of file grant-table.c.

int gnttab_grant_foreign_access_trans ( domid_t  domid,
int  flags,
domid_t  trans_domid,
grant_ref_t  trans_gref 
)

Definition at line 379 of file grant-table.c.

int gnttab_grant_foreign_access_trans_ref ( grant_ref_t  ref,
domid_t  domid,
int  flags,
domid_t  trans_domid,
grant_ref_t  trans_gref 
)

Definition at line 361 of file grant-table.c.

int gnttab_grant_foreign_transfer ( domid_t  domid,
unsigned long  pfn 
)

Definition at line 571 of file grant-table.c.

void gnttab_grant_foreign_transfer_ref ( grant_ref_t  ref,
domid_t  domid,
unsigned long  pfn 
)

Definition at line 584 of file grant-table.c.

int gnttab_init ( void  )

Definition at line 1187 of file grant-table.c.

int gnttab_map_refs ( struct gnttab_map_grant_ref map_ops,
struct gnttab_map_grant_ref kmap_ops,
struct page **  pages,
unsigned int  count 
)

Definition at line 873 of file grant-table.c.

unsigned int gnttab_max_grant_frames ( void  )

Definition at line 817 of file grant-table.c.

int gnttab_query_foreign_access ( grant_ref_t  ref)

Definition at line 416 of file grant-table.c.

void gnttab_release_grant_reference ( grant_ref_t private_head,
grant_ref_t  release 
)

Definition at line 723 of file grant-table.c.

void gnttab_request_free_callback ( struct gnttab_free_callback callback,
void(*)(void *)  fn,
void arg,
u16  count 
)

Definition at line 731 of file grant-table.c.

int gnttab_resume ( void  )

Definition at line 1136 of file grant-table.c.

bool gnttab_subpage_grants_available ( void  )

Definition at line 343 of file grant-table.c.

int gnttab_suspend ( void  )

Definition at line 1163 of file grant-table.c.

bool gnttab_trans_grants_available ( void  )

Definition at line 400 of file grant-table.c.

int gnttab_unmap_refs ( struct gnttab_unmap_grant_ref unmap_ops,
struct gnttab_map_grant_ref kmap_ops,
struct page **  pages,
unsigned int  count 
)

Definition at line 925 of file grant-table.c.

Variable Documentation

void* addr

Definition at line 76 of file grant-table.c.

Definition at line 74 of file grant-table.c.

union grant_entry_v2* v2

Definition at line 75 of file grant-table.c.

unsigned long xen_hvm_resume_frames

Definition at line 70 of file grant-table.c.