From: =?GBK?B?zuK80cPx?= Subject: Question about Using Grant Table Date: Fri, 11 Jul 2008 08:02:28 +0800 (CST) Message-ID: <3735888.15241215734548318.JavaMail.coremail@bj163app90.163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2054412253==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============2054412253== Content-Type: multipart/alternative; boundary="----=_Part_4013_9926600.1215734548317" ------=_Part_4013_9926600.1215734548317 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: quoted-printable Hi: There is a code sample in , c= hapter 4, "Using Grant Tables". The code sample is as following: #include extern void * shared_page; extern grant_entry_t * grant_table; =20 void offer_page() { uint16_t flags; /* create the grant table*/ gnttab_setup_table_t setup_op; =20 setup_op.dom =A3=BDDOMID=A3=DFSELF=A3=BB setup_op.nr_frames =3D 1; setup_op.frame_list =3D grant_table; =20 HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup_op, 1); /*offer the grant */ grant_table[0].domid=3DDOMID_FRIEND; grant_table[0].frame =3D shared_page >>12; flgas =3D GTF_permit_access & GTF_reading & GTF_writing; grant_table[0].flags=3D flags; =20 } =20 and it also assume that the grant table entry have already been communi= cated via Xenstore. =20 My question is : If I modify this code sample and use it in my own program, How can I han= dle "extern void * shared_page; extern grant_entry_t * grant_table"?? Where= Can I get the pointer to them? Thanks a lot. Danius Wu =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=20 =20 =20 ------=_Part_4013_9926600.1215734548317 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable 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()
   {
        ui= nt16_t flags;
       /* create the grant t= able*/
      gnttab_setup_table_t setup_op;
=     
     setup_op.dom =A3=BDDO= MID=A3=DFSELF=A3=BB
     setup_op.nr_frames =3D 1;
   &nb= sp; setup_op.frame_list =3D grant_table;
   
 &n= bsp;   HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup= _op, 1);

    /*offer the grant */
  &nbs= p; grant_table[0].domid=3DDOMID_FRIEND;
    grant_table[0].frame =3D shared_page >>12;
&nbs= p;   flgas =3D GTF_permit_access & GTF_reading & GTF_writ= ing;
    grant_table[0].flags=3D flags;
 
&nb= sp;   }
  
    and it also assume= that the grant table entry have already been communicated via Xenstore.  
   My question is :
   If I modify this c= ode sample and use it in my own program, How can I handle "extern void * sh= ared_page; extern grant_entry_t * grant_table"?? Where Can I get the pointe= r to them?

Thanks a lot.
        &= nbsp;               =                &nb= sp;               &n= bsp; Danius Wu
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
 
 


=20
=D4=A8=B2=A8=C0=AB=D5=AC = =BA=FE=BE=B0=C8=CB=C9=FA ------=_Part_4013_9926600.1215734548317-- --===============2054412253== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============2054412253==--