diff options
Diffstat (limited to 'xen/block.c')
-rw-r--r-- | xen/block.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xen/block.c b/xen/block.c index 4718891d..4253ef04 100644 --- a/xen/block.c +++ b/xen/block.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2009, 2011 Samuel Thibault <samuel.thibault@ens-lyon.org> + * Copyright (C) 2006-2009, 2011 Free Software Foundation * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ #include <sys/types.h> #include <mach/mig_errors.h> +#include <kern/kalloc.h> #include <ipc/ipc_port.h> #include <ipc/ipc_space.h> #include <vm/vm_kern.h> @@ -229,12 +230,12 @@ void hyp_block_init(void) { t = hyp_store_transaction_start(); /* Get a page for ring */ - if (kmem_alloc_wired(kernel_map, &addr, PAGE_SIZE) != KERN_SUCCESS) + if ((addr = vm_page_grab_phys_addr()) == -1) panic("%s: couldn't allocate space for store ring\n", device_name); - ring = (void*) addr; + ring = (void*) phystokv(addr); SHARED_RING_INIT(ring); FRONT_RING_INIT(&bd->ring, ring, PAGE_SIZE); - grant = hyp_grant_give(domid, atop(kvtophys(addr)), 0); + grant = hyp_grant_give(domid, atop(addr), 0); /* and give it to backend. */ i = sprintf(port_name, "%u", grant); @@ -516,7 +517,7 @@ device_read (void *d, ipc_port_t reply_port, thread_block(NULL); if (err) - printf("error reading %d bytes at sector %d\n", amt, + printf("error reading %d bytes at sector %ld\n", amt, bn + offset / 512); for (i = 0; i < nbpages; i++) |