Deleted Added
full compact
vmmapi.c (256645) vmmapi.c (258075)
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 256645 2013-10-16 18:20:27Z neel $
26 * $FreeBSD: head/lib/libvmmapi/vmmapi.c 258075 2013-11-12 22:51:03Z neel $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libvmmapi/vmmapi.c 256645 2013-10-16 18:20:27Z neel $");
30__FBSDID("$FreeBSD: head/lib/libvmmapi/vmmapi.c 258075 2013-11-12 22:51:03Z 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

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

392 bzero(&vmirq, sizeof(vmirq));
393 vmirq.cpuid = vcpu;
394 vmirq.vector = vector;
395
396 return (ioctl(ctx->fd, VM_LAPIC_IRQ, &vmirq));
397}
398
399int
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

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

392 bzero(&vmirq, sizeof(vmirq));
393 vmirq.cpuid = vcpu;
394 vmirq.vector = vector;
395
396 return (ioctl(ctx->fd, VM_LAPIC_IRQ, &vmirq));
397}
398
399int
400vm_ioapic_assert_irq(struct vmctx *ctx, int irq)
401{
402 struct vm_ioapic_irq ioapic_irq;
403
404 bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq));
405 ioapic_irq.irq = irq;
406
407 return (ioctl(ctx->fd, VM_IOAPIC_ASSERT_IRQ, &ioapic_irq));
408}
409
410int
411vm_ioapic_deassert_irq(struct vmctx *ctx, int irq)
412{
413 struct vm_ioapic_irq ioapic_irq;
414
415 bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq));
416 ioapic_irq.irq = irq;
417
418 return (ioctl(ctx->fd, VM_IOAPIC_DEASSERT_IRQ, &ioapic_irq));
419}
420
421int
400vm_inject_nmi(struct vmctx *ctx, int vcpu)
401{
402 struct vm_nmi vmnmi;
403
404 bzero(&vmnmi, sizeof(vmnmi));
405 vmnmi.cpuid = vcpu;
406
407 return (ioctl(ctx->fd, VM_INJECT_NMI, &vmnmi));

--- 387 unchanged lines hidden ---
422vm_inject_nmi(struct vmctx *ctx, int vcpu)
423{
424 struct vm_nmi vmnmi;
425
426 bzero(&vmnmi, sizeof(vmnmi));
427 vmnmi.cpuid = vcpu;
428
429 return (ioctl(ctx->fd, VM_INJECT_NMI, &vmnmi));

--- 387 unchanged lines hidden ---