Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 Catch the return value from the XENMEM_decr...



details:   https://anonhg.NetBSD.org/src/rev/d9af42f90d8b
branches:  trunk
changeset: 752601:d9af42f90d8b
user:      jym <jym%NetBSD.org@localhost>
date:      Tue Mar 02 00:13:50 2010 +0000

description:
Catch the return value from the XENMEM_decrease_reservation hypercall,
and not some error value stored earlier.

While here, fix a typo in a comment.

diffstat:

 sys/arch/xen/x86/xen_bus_dma.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 38f18cd81511 -r d9af42f90d8b sys/arch/xen/x86/xen_bus_dma.c
--- a/sys/arch/xen/x86/xen_bus_dma.c    Mon Mar 01 23:42:41 2010 +0000
+++ b/sys/arch/xen/x86/xen_bus_dma.c    Tue Mar 02 00:13:50 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_bus_dma.c,v 1.18 2010/02/27 09:22:40 jym Exp $     */
+/*     $NetBSD: xen_bus_dma.c,v 1.19 2010/03/02 00:13:50 jym Exp $     */
 /*     NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.18 2010/02/27 09:22:40 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.19 2010/03/02 00:13:50 jym Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -81,7 +81,7 @@
        npagesreq = (size >> PAGE_SHIFT);
        KASSERT(npages >= npagesreq);
 
-       /* get npages from UWM, and give them back to the hypervisor */
+       /* get npages from UVM, and give them back to the hypervisor */
        error = uvm_pglistalloc(((psize_t)npages) << PAGE_SHIFT,
             0, avail_end, 0, 0, mlistp, npages, (flags & BUS_DMA_NOWAIT) == 0);
        if (error)
@@ -96,8 +96,8 @@
                res.nr_extents = 1;
                res.extent_order = 0;
                res.domid = DOMID_SELF;
-               if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, &res)
-                   != 1) {
+               error = HYPERVISOR_memory_op(XENMEM_decrease_reservation, &res);
+               if (error != 1) {
 #ifdef DEBUG
                        printf("xen_alloc_contig: XENMEM_decrease_reservation "
                            "failed: err %d (pa %#" PRIxPADDR " mfn %#lx)\n",



Home | Main Index | Thread Index | Old Index