Deleted Added
full compact
vmmapi.c (268953) vmmapi.c (268972)
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: stable/10/lib/libvmmapi/vmmapi.c 268953 2014-07-21 19:08:02Z jhb $
26 * $FreeBSD: stable/10/lib/libvmmapi/vmmapi.c 268972 2014-07-22 03:14:37Z jhb $
27 */
28
29#include <sys/cdefs.h>
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: stable/10/lib/libvmmapi/vmmapi.c 268953 2014-07-21 19:08:02Z jhb $");
30__FBSDID("$FreeBSD: stable/10/lib/libvmmapi/vmmapi.c 268972 2014-07-22 03:14:37Z jhb $");
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

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

502
503 return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq));
504}
505
506int
507vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq)
508{
509 struct vm_isa_irq isa_irq;
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

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

502
503 return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq));
504}
505
506int
507vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq)
508{
509 struct vm_isa_irq isa_irq;
510
510 bzero(&isa_irq, sizeof(struct vm_isa_irq));
511 isa_irq.atpic_irq = atpic_irq;
512 isa_irq.ioapic_irq = ioapic_irq;
513
514 return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq));
515}
516
517int
511 bzero(&isa_irq, sizeof(struct vm_isa_irq));
512 isa_irq.atpic_irq = atpic_irq;
513 isa_irq.ioapic_irq = ioapic_irq;
514
515 return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq));
516}
517
518int
519vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq,
520 enum vm_intr_trigger trigger)
521{
522 struct vm_isa_irq_trigger isa_irq_trigger;
523
524 bzero(&isa_irq_trigger, sizeof(struct vm_isa_irq_trigger));
525 isa_irq_trigger.atpic_irq = atpic_irq;
526 isa_irq_trigger.trigger = trigger;
527
528 return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger));
529}
530
531int
518vm_inject_nmi(struct vmctx *ctx, int vcpu)
519{
520 struct vm_nmi vmnmi;
521
522 bzero(&vmnmi, sizeof(vmnmi));
523 vmnmi.cpuid = vcpu;
524
525 return (ioctl(ctx->fd, VM_INJECT_NMI, &vmnmi));

--- 400 unchanged lines hidden ---
532vm_inject_nmi(struct vmctx *ctx, int vcpu)
533{
534 struct vm_nmi vmnmi;
535
536 bzero(&vmnmi, sizeof(vmnmi));
537 vmnmi.cpuid = vcpu;
538
539 return (ioctl(ctx->fd, VM_INJECT_NMI, &vmnmi));

--- 400 unchanged lines hidden ---