Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_lpc.c
Show All 28 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <machine/vmm.h> | #include <machine/vmm.h> | ||||
#include <vmmapi.h> | |||||
#include <machine/vmm_snapshot.h> | #include <machine/vmm_snapshot.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <vmmapi.h> | |||||
#include "acpi.h" | #include "acpi.h" | ||||
#include "debug.h" | #include "debug.h" | ||||
#include "bootrom.h" | #include "bootrom.h" | ||||
#include "config.h" | #include "config.h" | ||||
#include "inout.h" | #include "inout.h" | ||||
#include "pci_emul.h" | #include "pci_emul.h" | ||||
#include "pci_irq.h" | #include "pci_irq.h" | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
lpc_print_supported_devices() | lpc_print_supported_devices() | ||||
{ | { | ||||
size_t i; | size_t i; | ||||
printf("bootrom\n"); | printf("bootrom\n"); | ||||
for (i = 0; i < LPC_UART_NUM; i++) | for (i = 0; i < LPC_UART_NUM; i++) | ||||
printf("%s\n", lpc_uart_names[i]); | printf("%s\n", lpc_uart_names[i]); | ||||
printf("%s\n", pctestdev_getname()); | |||||
} | } | ||||
const char * | const char * | ||||
lpc_bootrom(void) | lpc_bootrom(void) | ||||
{ | { | ||||
return (get_config_value("lpc.bootrom")); | return (get_config_value("lpc.bootrom")); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | |||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
static int | static int | ||||
pci_lpc_snapshot(struct vm_snapshot_meta *meta) | pci_lpc_snapshot(struct vm_snapshot_meta *meta) | ||||
{ | { | ||||
int unit, ret; | int unit, ret; | ||||
struct uart_softc *sc; | struct uart_softc *sc; | ||||
SNAPSHOT_ADD_INTERN_ARR(uart, meta); | |||||
for (unit = 0; unit < LPC_UART_NUM; unit++) { | for (unit = 0; unit < LPC_UART_NUM; unit++) { | ||||
sc = lpc_uart_softc[unit].uart_softc; | sc = lpc_uart_softc[unit].uart_softc; | ||||
SNAPSHOT_SET_INTERN_ARR_INDEX(meta, unit); | |||||
ret = uart_snapshot(sc, meta); | ret = uart_snapshot(sc, meta); | ||||
if (ret != 0) | if (ret != 0) | ||||
goto done; | goto done; | ||||
} | } | ||||
SNAPSHOT_CLEAR_INTERN_ARR_INDEX(meta); | |||||
SNAPSHOT_REMOVE_INTERN_ARR(uart, meta); | |||||
done: | done: | ||||
return (ret); | return (ret); | ||||
} | } | ||||
#endif | #endif | ||||
struct pci_devemu pci_de_lpc = { | struct pci_devemu pci_de_lpc = { | ||||
.pe_emu = "lpc", | .pe_emu = "lpc", | ||||
Show All 10 Lines |