diff options
Diffstat (limited to 'usr/src/cmd/bhyve/pci_lpc.c')
-rw-r--r-- | usr/src/cmd/bhyve/pci_lpc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/pci_lpc.c b/usr/src/cmd/bhyve/pci_lpc.c index 50413250d3..9c8f25e89d 100644 --- a/usr/src/cmd/bhyve/pci_lpc.c +++ b/usr/src/cmd/bhyve/pci_lpc.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "pci_irq.h" #include "pci_lpc.h" +#include "pctestdev.h" #include "uart_emul.h" #define IO_ICU1 0x20 @@ -83,6 +84,8 @@ static struct lpc_uart_softc { static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2" }; +static bool pctestdev_present; + /* * LPC device configuration is in the following form: * <lpc_device_name>[,<options>] @@ -110,6 +113,18 @@ lpc_device_parse(const char *opts) goto done; } } + if (strcasecmp(lpcdev, pctestdev_getname()) == 0) { + if (pctestdev_present) { + EPRINTLN("More than one %s device conf is " + "specified; only one is allowed.", + pctestdev_getname()); + } else if (pctestdev_parse(str) == 0) { + pctestdev_present = true; + error = 0; + free(cpy); + goto done; + } + } } done: @@ -127,6 +142,7 @@ lpc_print_supported_devices() printf("bootrom\n"); for (i = 0; i < LPC_UART_NUM; i++) printf("%s\n", lpc_uart_names[i]); + printf("%s\n", pctestdev_getname()); } const char * @@ -250,6 +266,13 @@ lpc_init(struct vmctx *ctx) sc->enabled = 1; } + /* pc-testdev */ + if (pctestdev_present) { + error = pctestdev_init(ctx); + if (error) + return (error); + } + return (0); } |