ia64/xen-unstable

changeset 15794:adad9f3820f1

Improve commenting of xencomm_ctxt_next().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Wed Aug 29 15:01:57 2007 +0100 (2007-08-29)
parents 828e1df114d4
children c868eab6c99b
files xen/common/xencomm.c
line diff
     1.1 --- a/xen/common/xencomm.c	Wed Aug 29 14:57:12 2007 +0100
     1.2 +++ b/xen/common/xencomm.c	Wed Aug 29 15:01:57 2007 +0100
     1.3 @@ -138,6 +138,22 @@ xencomm_ctxt_init(const void *handle, st
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +/*
     1.8 + * Calculate the vaddr of &ctxt->desc_in_paddr->address[i] and get_page().
     1.9 + * And put the results in ctxt->page and ctxt->address.
    1.10 + * If there is the previous page, put_page().
    1.11 + *
    1.12 + * A guest domain passes the array, ctxt->desc_in_paddr->address[].
    1.13 + * It is gpaddr-contiguous, but not maddr-contiguous so that
    1.14 + * we can't obtain the vaddr by simple offsetting.
    1.15 + * We need to convert gpaddr, &ctxt->desc_in_paddr->address[i],
    1.16 + * into maddr and then convert it to the xen virtual address in order
    1.17 + * to access there.
    1.18 + * The conversion can be optimized out by using the last result of
    1.19 + * ctxt->address because we access the array sequentially.
    1.20 + * The conversion, gpaddr -> maddr -> vaddr, is necessary only when
    1.21 + * crossing page boundary.
    1.22 + */
    1.23  static int
    1.24  xencomm_ctxt_next(struct xencomm_ctxt *ctxt, int i)
    1.25  {
    1.26 @@ -147,7 +163,7 @@ xencomm_ctxt_next(struct xencomm_ctxt *c
    1.27  
    1.28      BUG_ON(i >= ctxt->nr_addrs);
    1.29  
    1.30 -    /* In i == 0 case, we already calculated in xecomm_addr_init(). */
    1.31 +    /* For i == 0 case we already calculated it in xencomm_ctxt_init(). */
    1.32      if ( i != 0 )
    1.33          ctxt->address++;
    1.34