Deleted Added
full compact
vmmapi.c (263035) vmmapi.c (263780)
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/lib/libvmmapi/vmmapi.c 263035 2014-03-11 16:56:00Z tychon $
26 * $FreeBSD: head/lib/libvmmapi/vmmapi.c 263780 2014-03-26 23:34:27Z neel $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libvmmapi/vmmapi.c 263035 2014-03-11 16:56:00Z tychon $");
30__FBSDID("$FreeBSD: head/lib/libvmmapi/vmmapi.c 263780 2014-03-26 23:34:27Z neel $");
31
32#include <sys/types.h>
33#include <sys/sysctl.h>
34#include <sys/ioctl.h>
35#include <sys/mman.h>
36
37#include <machine/specialreg.h>
38

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

337 vmrun.cpuid = vcpu;
338 vmrun.rip = rip;
339
340 error = ioctl(ctx->fd, VM_RUN, &vmrun);
341 bcopy(&vmrun.vm_exit, vmexit, sizeof(struct vm_exit));
342 return (error);
343}
344
31
32#include <sys/types.h>
33#include <sys/sysctl.h>
34#include <sys/ioctl.h>
35#include <sys/mman.h>
36
37#include <machine/specialreg.h>
38

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

337 vmrun.cpuid = vcpu;
338 vmrun.rip = rip;
339
340 error = ioctl(ctx->fd, VM_RUN, &vmrun);
341 bcopy(&vmrun.vm_exit, vmexit, sizeof(struct vm_exit));
342 return (error);
343}
344
345int
346vm_suspend(struct vmctx *ctx)
347{
348
349 return (ioctl(ctx->fd, VM_SUSPEND, 0));
350}
351
345static int
346vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector,
347 int error_code, int error_code_valid)
348{
349 struct vm_exception exc;
350
351 bzero(&exc, sizeof(exc));
352 exc.cpuid = vcpu;

--- 551 unchanged lines hidden ---
352static int
353vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector,
354 int error_code, int error_code_valid)
355{
356 struct vm_exception exc;
357
358 bzero(&exc, sizeof(exc));
359 exc.cpuid = vcpu;

--- 551 unchanged lines hidden ---