Module Name: src
Committed By: jym
Date: Tue Mar 2 00:13:50 UTC 2010
Modified Files:
src/sys/arch/xen/x86: xen_bus_dma.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/xen_bus_dma.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.18 src/sys/arch/xen/x86/xen_bus_dma.c:1.19
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.18 Sat Feb 27 09:22:40 2010
+++ src/sys/arch/xen/x86/xen_bus_dma.c Tue Mar 2 00:13:50 2010
@@ -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",