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 643 Lines • ▼ Show 20 Lines | if (!uart_stdio) { | ||||
errx(EX_OSERR, | errx(EX_OSERR, | ||||
"Unable to apply rights for sandbox"); | "Unable to apply rights for sandbox"); | ||||
} | } | ||||
#endif | #endif | ||||
uart_opentty(sc); | uart_opentty(sc); | ||||
} | } | ||||
return (retval); | return (retval); | ||||
} | |||||
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); | |||||
} | } |