Deleted Added
full compact
vmm_dev.c (249435) vmm_dev.c (250427)
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/sys/amd64/vmm/vmm_dev.c 249435 2013-04-13 05:11:21Z neel $
26 * $FreeBSD: head/sys/amd64/vmm/vmm_dev.c 250427 2013-05-10 02:59:49Z neel $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_dev.c 249435 2013-04-13 05:11:21Z neel $");
30__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_dev.c 250427 2013-05-10 02:59:49Z neel $");
31
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/queue.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>
37#include <sys/malloc.h>
38#include <sys/conf.h>

--- 191 unchanged lines hidden (view full) ---

230 }
231
232 switch(cmd) {
233 case VM_RUN:
234 vmrun = (struct vm_run *)data;
235 error = vm_run(sc->vm, vmrun);
236 break;
237 case VM_STAT_DESC: {
31
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/queue.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>
37#include <sys/malloc.h>
38#include <sys/conf.h>

--- 191 unchanged lines hidden (view full) ---

230 }
231
232 switch(cmd) {
233 case VM_RUN:
234 vmrun = (struct vm_run *)data;
235 error = vm_run(sc->vm, vmrun);
236 break;
237 case VM_STAT_DESC: {
238 const char *desc;
239 statdesc = (struct vm_stat_desc *)data;
238 statdesc = (struct vm_stat_desc *)data;
240 desc = vmm_stat_desc(statdesc->index);
241 if (desc != NULL) {
242 error = 0;
243 strlcpy(statdesc->desc, desc, sizeof(statdesc->desc));
244 } else
245 error = EINVAL;
239 error = vmm_stat_desc_copy(statdesc->index,
240 statdesc->desc, sizeof(statdesc->desc));
246 break;
247 }
248 case VM_STATS: {
241 break;
242 }
243 case VM_STATS: {
249 CTASSERT(MAX_VM_STATS >= MAX_VMM_STAT_TYPES);
244 CTASSERT(MAX_VM_STATS >= MAX_VMM_STAT_ELEMS);
250 vmstats = (struct vm_stats *)data;
251 getmicrotime(&vmstats->tv);
252 error = vmm_stat_copy(sc->vm, vmstats->cpuid,
253 &vmstats->num_entries, vmstats->statbuf);
254 break;
255 }
256 case VM_PPTDEV_MSI:
257 pptmsi = (struct vm_pptdev_msi *)data;

--- 273 unchanged lines hidden ---
245 vmstats = (struct vm_stats *)data;
246 getmicrotime(&vmstats->tv);
247 error = vmm_stat_copy(sc->vm, vmstats->cpuid,
248 &vmstats->num_entries, vmstats->statbuf);
249 break;
250 }
251 case VM_PPTDEV_MSI:
252 pptmsi = (struct vm_pptdev_msi *)data;

--- 273 unchanged lines hidden ---