Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/uart_emul.c
Show All 33 Lines | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <dev/ic/ns16550.h> | #include <dev/ic/ns16550.h> | ||||
#ifndef WITHOUT_CAPSICUM | #ifndef WITHOUT_CAPSICUM | ||||
#include <sys/capsicum.h> | #include <sys/capsicum.h> | ||||
#include <capsicum_helpers.h> | #include <capsicum_helpers.h> | ||||
#endif | #endif | ||||
#include <machine/vmm_snapshot.h> | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <termios.h> | #include <termios.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
▲ Show 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | if (strcmp("stdio", opts) == 0) | ||||
retval = uart_stdio_backend(sc); | retval = uart_stdio_backend(sc); | ||||
else | else | ||||
retval = uart_tty_backend(sc, opts); | retval = uart_tty_backend(sc, opts); | ||||
if (retval == 0) | if (retval == 0) | ||||
uart_opentty(sc); | uart_opentty(sc); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
#ifdef BHYVE_SNAPSHOT | |||||
int | |||||
uart_snapshot(struct uart_softc *sc, struct vm_snapshot_meta *meta) | |||||
{ | |||||
int ret; | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->data, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->ier, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->lcr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->mcr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->lsr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->msr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->fcr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->scr, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->dll, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->dlh, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->rxfifo.rindex, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->rxfifo.windex, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->rxfifo.num, meta, ret, done); | |||||
SNAPSHOT_VAR_OR_LEAVE(sc->rxfifo.size, meta, ret, done); | |||||
SNAPSHOT_BUF_OR_LEAVE(sc->rxfifo.buf, sizeof(sc->rxfifo.buf), | |||||
meta, ret, done); | |||||
sc->thre_int_pending = 1; | |||||
done: | |||||
return (ret); | |||||
} | |||||
#endif |