-/* $OpenBSD: vmmci.c,v 1.2 2017/03/15 18:06:18 reyk Exp $ */
+/* $OpenBSD: vmmci.c,v 1.3 2017/05/02 09:50:38 mlarkin Exp $ */
/*
* Copyright (c) 2017 Reyk Floeter <reyk@openbsd.org>
VMMCI_NONE = 0,
VMMCI_SHUTDOWN,
VMMCI_REBOOT,
+ VMMCI_SYNCRTC,
};
struct vmmci_softc {
/* Feature bits */
#define VMMCI_F_TIMESYNC (1<<0)
#define VMMCI_F_ACK (1<<1)
+#define VMMCI_F_SYNCRTC (1<<2)
struct cfdriver vmmci_cd = {
NULL, "vmmci", DV_DULL
vsc->sc_ipl = IPL_NET;
sc->sc_virtio = vsc;
- features = VMMCI_F_TIMESYNC|VMMCI_F_ACK;
+ features = VMMCI_F_TIMESYNC | VMMCI_F_ACK | VMMCI_F_SYNCRTC;
features = virtio_negotiate_features(vsc, features, NULL);
if (features & VMMCI_F_TIMESYNC) {
case VMMCI_REBOOT:
pvbus_reboot(&sc->sc_dev);
break;
+ case VMMCI_SYNCRTC:
+ inittodr(time_second);
+ sc->sc_cmd = VMMCI_NONE;
+ break;
default:
printf("%s: invalid command %d\n", sc->sc_dev.dv_xname, cmd);
cmd = VMMCI_NONE;