Deleted Added
full compact
inout.c (330449) inout.c (336161)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2011 NetApp, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2011 NetApp, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: stable/11/usr.sbin/bhyve/inout.c 330449 2018-03-05 07:26:05Z eadler $
28 * $FreeBSD: stable/11/usr.sbin/bhyve/inout.c 336161 2018-07-10 04:26:32Z araujo $
29 */
30
31#include <sys/cdefs.h>
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/11/usr.sbin/bhyve/inout.c 330449 2018-03-05 07:26:05Z eadler $");
32__FBSDID("$FreeBSD: stable/11/usr.sbin/bhyve/inout.c 336161 2018-07-10 04:26:32Z araujo $");
33
34#include <sys/param.h>
35#include <sys/linker_set.h>
36#include <sys/_iovec.h>
37#include <sys/mman.h>
38
39#include <x86/psl.h>
40#include <x86/segments.h>

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

63 inout_func_t handler;
64 void *arg;
65} inout_handlers[MAX_IOPORTS];
66
67static int
68default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
69 uint32_t *eax, void *arg)
70{
33
34#include <sys/param.h>
35#include <sys/linker_set.h>
36#include <sys/_iovec.h>
37#include <sys/mman.h>
38
39#include <x86/psl.h>
40#include <x86/segments.h>

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

63 inout_func_t handler;
64 void *arg;
65} inout_handlers[MAX_IOPORTS];
66
67static int
68default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
69 uint32_t *eax, void *arg)
70{
71 if (in) {
72 switch (bytes) {
73 case 4:
74 *eax = 0xffffffff;
75 break;
76 case 2:
77 *eax = 0xffff;
78 break;
79 case 1:
80 *eax = 0xff;
81 break;
82 }
83 }
84
85 return (0);
71 if (in) {
72 switch (bytes) {
73 case 4:
74 *eax = 0xffffffff;
75 break;
76 case 2:
77 *eax = 0xffff;
78 break;
79 case 1:
80 *eax = 0xff;
81 break;
82 }
83 }
84
85 return (0);
86}
87
88static void
89register_default_iohandler(int start, int size)
90{
91 struct inout_port iop;
92
93 VERIFY_IOPORT(start, size);

--- 206 unchanged lines hidden ---
86}
87
88static void
89register_default_iohandler(int start, int size)
90{
91 struct inout_port iop;
92
93 VERIFY_IOPORT(start, size);

--- 206 unchanged lines hidden ---