netback.c (249588) | netback.c (254025) |
---|---|
1/*- 2 * Copyright (c) 2009-2011 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Alan Somers (Spectra Logic Corporation) 32 * John Suykerbuyk (Spectra Logic Corporation) 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2011 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Alan Somers (Spectra Logic Corporation) 32 * John Suykerbuyk (Spectra Logic Corporation) 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/dev/xen/netback/netback.c 249588 2013-04-17 11:56:11Z gabor $"); | 36__FBSDID("$FreeBSD: head/sys/dev/xen/netback/netback.c 254025 2013-08-07 06:21:20Z jeff $"); |
37 38/** 39 * \file netback.c 40 * 41 * \brief Device driver supporting the vending of network access 42 * from this FreeBSD domain to other domains. 43 */ 44#include "opt_inet.h" --- 571 unchanged lines hidden (view full) --- 616 * 617 * \param xnb Per-instance xnb configuration structure. 618 */ 619static void 620xnb_free_communication_mem(struct xnb_softc *xnb) 621{ 622 if (xnb->kva != 0) { 623#ifndef XENHVM | 37 38/** 39 * \file netback.c 40 * 41 * \brief Device driver supporting the vending of network access 42 * from this FreeBSD domain to other domains. 43 */ 44#include "opt_inet.h" --- 571 unchanged lines hidden (view full) --- 616 * 617 * \param xnb Per-instance xnb configuration structure. 618 */ 619static void 620xnb_free_communication_mem(struct xnb_softc *xnb) 621{ 622 if (xnb->kva != 0) { 623#ifndef XENHVM |
624 kmem_free(kernel_map, xnb->kva, xnb->kva_size); | 624 kva_free(xnb->kva, xnb->kva_size); |
625#else 626 if (xnb->pseudo_phys_res != NULL) { 627 bus_release_resource(xnb->dev, SYS_RES_MEMORY, 628 xnb->pseudo_phys_res_id, 629 xnb->pseudo_phys_res); 630 xnb->pseudo_phys_res = NULL; 631 } 632#endif /* XENHVM */ --- 173 unchanged lines hidden (view full) --- 806{ 807 xnb_ring_type_t i; 808 809 xnb->kva_size = 0; 810 for (i=0; i < XNB_NUM_RING_TYPES; i++) { 811 xnb->kva_size += xnb->ring_configs[i].ring_pages * PAGE_SIZE; 812 } 813#ifndef XENHVM | 625#else 626 if (xnb->pseudo_phys_res != NULL) { 627 bus_release_resource(xnb->dev, SYS_RES_MEMORY, 628 xnb->pseudo_phys_res_id, 629 xnb->pseudo_phys_res); 630 xnb->pseudo_phys_res = NULL; 631 } 632#endif /* XENHVM */ --- 173 unchanged lines hidden (view full) --- 806{ 807 xnb_ring_type_t i; 808 809 xnb->kva_size = 0; 810 for (i=0; i < XNB_NUM_RING_TYPES; i++) { 811 xnb->kva_size += xnb->ring_configs[i].ring_pages * PAGE_SIZE; 812 } 813#ifndef XENHVM |
814 xnb->kva = kmem_alloc_nofault(kernel_map, xnb->kva_size); | 814 xnb->kva = kva_alloc(xnb->kva_size); |
815 if (xnb->kva == 0) 816 return (ENOMEM); 817 xnb->gnt_base_addr = xnb->kva; 818#else /* defined XENHVM */ 819 /* 820 * Reserve a range of pseudo physical memory that we can map 821 * into kva. These pages will only be backed by machine 822 * pages ("real memory") during the lifetime of front-end requests --- 1715 unchanged lines hidden --- | 815 if (xnb->kva == 0) 816 return (ENOMEM); 817 xnb->gnt_base_addr = xnb->kva; 818#else /* defined XENHVM */ 819 /* 820 * Reserve a range of pseudo physical memory that we can map 821 * into kva. These pages will only be backed by machine 822 * pages ("real memory") during the lifetime of front-end requests --- 1715 unchanged lines hidden --- |