pci_emul.c (267294) | pci_emul.c (267811) |
---|---|
1/*- 2 * Copyright (c) 2011 NetApp, Inc. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * | 1/*- 2 * Copyright (c) 2011 NetApp, Inc. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * $FreeBSD: head/usr.sbin/bhyve/pci_emul.c 267294 2014-06-09 19:55:50Z tychon $ | 26 * $FreeBSD: head/usr.sbin/bhyve/pci_emul.c 267811 2014-06-24 02:02:51Z neel $ |
27 */ 28 29#include <sys/cdefs.h> | 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/usr.sbin/bhyve/pci_emul.c 267294 2014-06-09 19:55:50Z tychon $"); | 30__FBSDID("$FreeBSD: head/usr.sbin/bhyve/pci_emul.c 267811 2014-06-24 02:02:51Z neel $"); |
31 32#include <sys/param.h> 33#include <sys/linker_set.h> 34#include <sys/errno.h> 35 36#include <ctype.h> 37#include <pthread.h> 38#include <stdio.h> --- 1074 unchanged lines hidden (view full) --- 1113 * [0, lowmem) guest system memory 1114 * [lowmem, lowmem_limit) memory hole (may be absent) 1115 * [lowmem_limit, 4GB) PCI hole (32-bit BAR allocation) 1116 * [4GB, 4GB + highmem) 1117 * 1118 * Accesses to memory addresses that are not allocated to system 1119 * memory or PCI devices return 0xff's. 1120 */ | 31 32#include <sys/param.h> 33#include <sys/linker_set.h> 34#include <sys/errno.h> 35 36#include <ctype.h> 37#include <pthread.h> 38#include <stdio.h> --- 1074 unchanged lines hidden (view full) --- 1113 * [0, lowmem) guest system memory 1114 * [lowmem, lowmem_limit) memory hole (may be absent) 1115 * [lowmem_limit, 4GB) PCI hole (32-bit BAR allocation) 1116 * [4GB, 4GB + highmem) 1117 * 1118 * Accesses to memory addresses that are not allocated to system 1119 * memory or PCI devices return 0xff's. 1120 */ |
1121 error = vm_get_memory_seg(ctx, 0, &lowmem, NULL); 1122 assert(error == 0); | 1121 lowmem = vm_get_lowmem_size(ctx); |
1123 1124 memset(&pci_mem_hole, 0, sizeof(struct mem_range)); 1125 pci_mem_hole.name = "PCI hole"; 1126 pci_mem_hole.flags = MEM_F_RW; 1127 pci_mem_hole.base = lowmem; 1128 pci_mem_hole.size = (4ULL * 1024 * 1024 * 1024) - lowmem; 1129 pci_mem_hole.handler = pci_emul_fallback_handler; 1130 --- 894 unchanged lines hidden --- | 1122 1123 memset(&pci_mem_hole, 0, sizeof(struct mem_range)); 1124 pci_mem_hole.name = "PCI hole"; 1125 pci_mem_hole.flags = MEM_F_RW; 1126 pci_mem_hole.base = lowmem; 1127 pci_mem_hole.size = (4ULL * 1024 * 1024 * 1024) - lowmem; 1128 pci_mem_hole.handler = pci_emul_fallback_handler; 1129 --- 894 unchanged lines hidden --- |