xenpv.c (283516) | xenpv.c (296336) |
---|---|
1/* 2 * Copyright (c) 2014 Roger Pau Monn�� <roger.pau@citrix.com> 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2014 Roger Pau Monn�� <roger.pau@citrix.com> 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/x86/xen/xenpv.c 283516 2015-05-25 09:47:16Z royger $"); | 28__FBSDID("$FreeBSD: head/sys/x86/xen/xenpv.c 296336 2016-03-03 05:07:35Z jhibbits $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/pcpu.h> 36#include <sys/rman.h> --- 78 unchanged lines hidden (view full) --- 115static struct resource * 116xenpv_alloc_physmem(device_t dev, device_t child, int *res_id, size_t size) 117{ 118 struct resource *res; 119 vm_paddr_t phys_addr; 120 int error; 121 122 res = bus_alloc_resource(child, SYS_RES_MEMORY, res_id, LOW_MEM_LIMIT, | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/pcpu.h> 36#include <sys/rman.h> --- 78 unchanged lines hidden (view full) --- 115static struct resource * 116xenpv_alloc_physmem(device_t dev, device_t child, int *res_id, size_t size) 117{ 118 struct resource *res; 119 vm_paddr_t phys_addr; 120 int error; 121 122 res = bus_alloc_resource(child, SYS_RES_MEMORY, res_id, LOW_MEM_LIMIT, |
123 ~0ul, size, RF_ACTIVE); | 123 ~0, size, RF_ACTIVE); |
124 if (res == NULL) 125 return (NULL); 126 127 phys_addr = rman_get_start(res); 128 error = vm_phys_fictitious_reg_range(phys_addr, phys_addr + size, 129 VM_MEMATTR_DEFAULT); 130 if (error) { 131 bus_release_resource(child, SYS_RES_MEMORY, *res_id, res); --- 70 unchanged lines hidden --- | 124 if (res == NULL) 125 return (NULL); 126 127 phys_addr = rman_get_start(res); 128 error = vm_phys_fictitious_reg_range(phys_addr, phys_addr + size, 129 VM_MEMATTR_DEFAULT); 130 if (error) { 131 bus_release_resource(child, SYS_RES_MEMORY, *res_id, res); --- 70 unchanged lines hidden --- |