Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/ps2kbd.c
| Show All 26 Lines | |||||
| * SUCH DAMAGE. | * SUCH DAMAGE. | ||||
| */ | */ | ||||
| #include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
| __FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| #include <machine/vmm_snapshot.h> | |||||
| #include <assert.h> | #include <assert.h> | ||||
| #include <stdbool.h> | #include <stdbool.h> | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | |||||
| #include <strings.h> | #include <strings.h> | ||||
| #include <pthread.h> | #include <pthread.h> | ||||
| #include <pthread_np.h> | #include <pthread_np.h> | ||||
| #include "atkbdc.h" | #include "atkbdc.h" | ||||
| #include "debug.h" | #include "debug.h" | ||||
| #include "console.h" | #include "console.h" | ||||
| ▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | ps2kbd_init(struct atkbdc_softc *atkbdc_sc) | ||||
| pthread_mutex_init(&sc->mtx, NULL); | pthread_mutex_init(&sc->mtx, NULL); | ||||
| fifo_init(sc); | fifo_init(sc); | ||||
| sc->atkbdc_sc = atkbdc_sc; | sc->atkbdc_sc = atkbdc_sc; | ||||
| console_kbd_register(ps2kbd_event, sc, 1); | console_kbd_register(ps2kbd_event, sc, 1); | ||||
| return (sc); | return (sc); | ||||
| } | } | ||||
| #ifdef BHYVE_SNAPSHOT | |||||
| int | |||||
| ps2kbd_snapshot(struct ps2kbd_softc *sc, struct vm_snapshot_meta *meta) | |||||
| { | |||||
| int ret; | |||||
| SNAPSHOT_VAR_OR_LEAVE(sc->enabled, meta, ret, done); | |||||
| SNAPSHOT_VAR_OR_LEAVE(sc->curcmd, meta, ret, done); | |||||
| done: | |||||
| return (ret); | |||||
| } | |||||
| #endif | |||||