WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Question about Using Grant Table

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Question about Using Grant Table
From: 吴佳民 <wujiamin_tyut@xxxxxxx>
Date: Fri, 11 Jul 2008 08:02:28 +0800 (CST)
Delivery-date: Thu, 10 Jul 2008 17:02:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>