Deleted Added
full compact
uart_emul.c (330449) uart_emul.c (336161)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2012 NetApp, Inc.
5 * Copyright (c) 2013 Neel Natu <neel@freebsd.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

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

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

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

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

50#include <string.h>
51#include <pthread.h>
52#include <sysexits.h>
53
54#include "mevent.h"
55#include "uart_emul.h"
56
57#define COM1_BASE 0x3F8
34
35#include <sys/types.h>
36#include <dev/ic/ns16550.h>
37#ifndef WITHOUT_CAPSICUM
38#include <sys/capsicum.h>
39#endif
40
41#include <stdio.h>

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

50#include <string.h>
51#include <pthread.h>
52#include <sysexits.h>
53
54#include "mevent.h"
55#include "uart_emul.h"
56
57#define COM1_BASE 0x3F8
58#define COM1_IRQ 4
58#define COM1_IRQ 4
59#define COM2_BASE 0x2F8
59#define COM2_BASE 0x2F8
60#define COM2_IRQ 3
60#define COM2_IRQ 3
61
62#define DEFAULT_RCLK 1843200
63#define DEFAULT_BAUD 9600
64
65#define FCR_RX_MASK 0xC0
66
67#define MCR_OUT1 0x04
68#define MCR_OUT2 0x08
69
70#define MSR_DELTA_MASK 0x0f
71
72#ifndef REG_SCR
61
62#define DEFAULT_RCLK 1843200
63#define DEFAULT_BAUD 9600
64
65#define FCR_RX_MASK 0xC0
66
67#define MCR_OUT1 0x04
68#define MCR_OUT2 0x08
69
70#define MSR_DELTA_MASK 0x0f
71
72#ifndef REG_SCR
73#define REG_SCR com_scr
73#define REG_SCR com_scr
74#endif
75
76#define FIFOSZ 16
77
78static bool uart_stdio; /* stdio in use for i/o */
79static struct termios tio_stdio_orig;
80
81static struct {

--- 623 unchanged lines hidden ---
74#endif
75
76#define FIFOSZ 16
77
78static bool uart_stdio; /* stdio in use for i/o */
79static struct termios tio_stdio_orig;
80
81static struct {

--- 623 unchanged lines hidden ---