[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Question about Using Grant Table



Hi:
    There is a code sample in <The Definite Guide to the Xen Hypervisor>, chapter 4, "Using Grant Tables".
    The code sample is as following:
  #include <public/xen.h>
  extern void * shared_page;
  extern grant_entry_t  * grant_table;
 
  void offer_page()
   {
        uint16_t flags;
       /* create the grant table*/
      gnttab_setup_table_t setup_op;
    
     setup_op.dom =DOMID_SELF;
     setup_op.nr_frames = 1;
     setup_op.frame_list = grant_table;
   
     HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup_op, 1);

    /*offer the grant */
    grant_table[0].domid=DOMID_FRIEND;
    grant_table[0].frame = shared_page >>12;
    flgas = GTF_permit_access & GTF_reading & GTF_writing;
    grant_table[0].flags= flags;
 
    }
  
    and it also assume that the grant table entry have already been communicated via Xenstore.
 
   My question is :
   If I modify this code sample and use it in my own program, How can I handle "extern void * shared_page; extern grant_entry_t * grant_table"?? Where Can I get the pointer to them?

Thanks a lot.
                                                          Danius Wu
=========================================================
 
 
 



渊波阔宅 湖景人生
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.