Deleted Added
full compact
vatpic.c (268891) vatpic.c (268972)
1/*-
2 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/io/vatpic.c 268891 2014-07-19 22:06:46Z jhb $");
28__FBSDID("$FreeBSD: stable/10/sys/amd64/vmm/io/vatpic.c 268972 2014-07-22 03:14:37Z jhb $");
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/queue.h>
33#include <sys/cpuset.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>

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

441}
442
443int
444vatpic_pulse_irq(struct vm *vm, int irq)
445{
446 return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE));
447}
448
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/queue.h>
33#include <sys/cpuset.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>

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

441}
442
443int
444vatpic_pulse_irq(struct vm *vm, int irq)
445{
446 return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE));
447}
448
449int
450vatpic_set_irq_trigger(struct vm *vm, int irq, enum vm_intr_trigger trigger)
451{
452 struct vatpic *vatpic;
453
454 if (irq < 0 || irq > 15)
455 return (EINVAL);
456
457 /*
458 * See comment in vatpic_elc_handler. These IRQs must be
459 * edge triggered.
460 */
461 if (trigger == LEVEL_TRIGGER) {
462 switch (irq) {
463 case 0:
464 case 1:
465 case 2:
466 case 8:
467 case 13:
468 return (EINVAL);
469 }
470 }
471
472 vatpic = vm_atpic(vm);
473
474 VATPIC_LOCK(vatpic);
475
476 if (trigger == LEVEL_TRIGGER)
477 vatpic->elc[irq >> 3] |= 1 << (irq & 0x7);
478 else
479 vatpic->elc[irq >> 3] &= ~(1 << (irq & 0x7));
480
481 VATPIC_UNLOCK(vatpic);
482
483 return (0);
484}
485
449void
450vatpic_pending_intr(struct vm *vm, int *vecptr)
451{
452 struct vatpic *vatpic;
453 struct atpic *atpic;
454 int pin;
455
456 vatpic = vm_atpic(vm);

--- 241 unchanged lines hidden ---
486void
487vatpic_pending_intr(struct vm *vm, int *vecptr)
488{
489 struct vatpic *vatpic;
490 struct atpic *atpic;
491 int pin;
492
493 vatpic = vm_atpic(vm);

--- 241 unchanged lines hidden ---