diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-10-16 19:12:13 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-10-16 19:12:13 +0200 |
commit | 586d866ec61ad927a42e01f92883b7b0e0419eb6 (patch) | |
tree | 6441c313d39f1849f30ba9d8de90debce61f5220 | |
parent | d7db1f01832014e08e2dcf589abab1316d5a45db (diff) | |
parent | 033689ab90dc62b2dc349d37fa91708750a1ed93 (diff) |
Merge branch 'master' of callisto:gnumach
-rw-r--r-- | xen/block.c | 6 | ||||
-rw-r--r-- | xen/net.c | 20 |
2 files changed, 13 insertions, 13 deletions
diff --git a/xen/block.c b/xen/block.c index 10befcc..02d410f 100644 --- a/xen/block.c +++ b/xen/block.c @@ -229,12 +229,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); @@ -283,12 +283,12 @@ void hyp_net_init(void) { t = hyp_store_transaction_start(); /* Get a page for tx_ring */ - if (kmem_alloc_wired(kernel_map, &addr, PAGE_SIZE) != KERN_SUCCESS) + if ((addr = vm_page_grab_phys_addr()) == -1) panic("eth: couldn't allocate space for store tx_ring"); - tx_ring = (void*) addr; + tx_ring = (void*) phystokv(addr); SHARED_RING_INIT(tx_ring); FRONT_RING_INIT(&nd->tx, tx_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); @@ -298,12 +298,12 @@ void hyp_net_init(void) { kfree((vm_offset_t) c, strlen(c)+1); /* Get a page for rx_ring */ - if (kmem_alloc_wired(kernel_map, &addr, PAGE_SIZE) != KERN_SUCCESS) + if ((addr = vm_page_grab_phys_addr()) == -1) panic("eth: couldn't allocate space for store tx_ring"); - rx_ring = (void*) addr; + rx_ring = (void*) phystokv(addr); SHARED_RING_INIT(rx_ring); FRONT_RING_INIT(&nd->rx, rx_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); @@ -396,12 +396,12 @@ void hyp_net_init(void) { /* Get a page for packet reception */ for (i= 0; i<WINDOW; i++) { - if (kmem_alloc_wired(kernel_map, &addr, PAGE_SIZE) != KERN_SUCCESS) + if ((addr = vm_page_grab_phys_addr()) == -1) panic("eth: couldn't allocate space for store tx_ring"); - nd->rx_buf[i] = (void*)phystokv(kvtophys(addr)); - nd->rx_buf_pfn[i] = atop(kvtophys((vm_offset_t)nd->rx_buf[i])); + nd->rx_buf[i] = (void*)phystokv(addr); + nd->rx_buf_pfn[i] = atop(addr); if (!nd->rx_copy) { - if (hyp_do_update_va_mapping(kvtolin(addr), 0, UVMF_INVLPG|UVMF_ALL)) + if (hyp_do_update_va_mapping(kvtolin(nd->rx_buf[i]), 0, UVMF_INVLPG|UVMF_ALL)) panic("eth: couldn't clear rx kv buf %d at %p", i, addr); } /* and enqueue it to backend. */ |