IOCTL_PRIVCMD_MMAP: properly map entries from 0 to (mcmd->num - 1), instead

of mapping mcmd->num times entry 0. xentools < 3.1 probably didn't use this
with more than one entry at a time ...
This commit is contained in:
bouyer 2007-06-12 18:53:52 +00:00
parent e19f0cc8f0
commit e4f18e1082
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: privcmd.c,v 1.16 2007/04/27 22:10:39 bouyer Exp $ */
/* $NetBSD: privcmd.c,v 1.17 2007/06/12 18:53:52 bouyer Exp $ */
/*-
* Copyright (c) 2004 Christian Limpach.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.16 2007/04/27 22:10:39 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.17 2007/06/12 18:53:52 bouyer Exp $");
#include "opt_compat_netbsd.h"
@ -119,7 +119,7 @@ privcmd_ioctl(void *v)
pmap_t pmap = vm_map_pmap(vmm);
for (i = 0; i < mcmd->num; i++) {
error = copyin(mcmd->entry, &mentry, sizeof(mentry));
error = copyin(&mcmd->entry[i], &mentry, sizeof(mentry));
if (error)
return error;
//printf("entry %d va 0x%lx npages %lu mfm 0x%lx\n", i, mentry.va, mentry.npages, mentry.mfn);