Deleted Added
full compact
vmm_ioport.c (273683) vmm_ioport.c (276428)
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: head/sys/amd64/vmm/vmm_ioport.c 273683 2014-10-26 04:44:28Z neel $");
28__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_ioport.c 276428 2014-12-30 22:19:34Z neel $");
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/queue.h>
33#include <sys/cpuset.h>
34#include <sys/systm.h>
35
36#include <vm/vm.h>
37
38#include <machine/vmm.h>
39#include <machine/vmm_instruction_emul.h>
40#include <x86/psl.h>
41
42#include "vatpic.h"
43#include "vatpit.h"
44#include "vpmtmr.h"
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/queue.h>
33#include <sys/cpuset.h>
34#include <sys/systm.h>
35
36#include <vm/vm.h>
37
38#include <machine/vmm.h>
39#include <machine/vmm_instruction_emul.h>
40#include <x86/psl.h>
41
42#include "vatpic.h"
43#include "vatpit.h"
44#include "vpmtmr.h"
45#include "vrtc.h"
45#include "vmm_ioport.h"
46#include "vmm_ktr.h"
47
48#define MAX_IOPORTS 1280
49
50ioport_handler_func_t ioport_handler[MAX_IOPORTS] = {
51 [TIMER_MODE] = vatpit_handler,
52 [TIMER_CNTR0] = vatpit_handler,
53 [TIMER_CNTR1] = vatpit_handler,
54 [TIMER_CNTR2] = vatpit_handler,
55 [NMISC_PORT] = vatpit_nmisc_handler,
56 [IO_ICU1] = vatpic_master_handler,
57 [IO_ICU1 + ICU_IMR_OFFSET] = vatpic_master_handler,
58 [IO_ICU2] = vatpic_slave_handler,
59 [IO_ICU2 + ICU_IMR_OFFSET] = vatpic_slave_handler,
60 [IO_ELCR1] = vatpic_elc_handler,
61 [IO_ELCR2] = vatpic_elc_handler,
62 [IO_PMTMR] = vpmtmr_handler,
46#include "vmm_ioport.h"
47#include "vmm_ktr.h"
48
49#define MAX_IOPORTS 1280
50
51ioport_handler_func_t ioport_handler[MAX_IOPORTS] = {
52 [TIMER_MODE] = vatpit_handler,
53 [TIMER_CNTR0] = vatpit_handler,
54 [TIMER_CNTR1] = vatpit_handler,
55 [TIMER_CNTR2] = vatpit_handler,
56 [NMISC_PORT] = vatpit_nmisc_handler,
57 [IO_ICU1] = vatpic_master_handler,
58 [IO_ICU1 + ICU_IMR_OFFSET] = vatpic_master_handler,
59 [IO_ICU2] = vatpic_slave_handler,
60 [IO_ICU2 + ICU_IMR_OFFSET] = vatpic_slave_handler,
61 [IO_ELCR1] = vatpic_elc_handler,
62 [IO_ELCR2] = vatpic_elc_handler,
63 [IO_PMTMR] = vpmtmr_handler,
64 [IO_RTC] = vrtc_addr_handler,
65 [IO_RTC + 1] = vrtc_data_handler,
63};
64
65#ifdef KTR
66static const char *
67inout_instruction(struct vm_exit *vmexit)
68{
69 int index;
70

--- 109 unchanged lines hidden ---
66};
67
68#ifdef KTR
69static const char *
70inout_instruction(struct vm_exit *vmexit)
71{
72 int index;
73

--- 109 unchanged lines hidden ---