Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/io/vpmtmr.c
Show All 30 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <machine/vmm.h> | #include <machine/vmm.h> | ||||
#include <machine/vmm_snapshot.h> | |||||
#include "vpmtmr.h" | #include "vpmtmr.h" | ||||
/* | /* | ||||
* The ACPI Power Management timer is a free-running 24- or 32-bit | * The ACPI Power Management timer is a free-running 24- or 32-bit | ||||
* timer with a frequency of 3.579545MHz | * timer with a frequency of 3.579545MHz | ||||
* | * | ||||
* This implementation will be 32-bits | * This implementation will be 32-bits | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | vpmtmr_handler(struct vm *vm, int vcpuid, bool in, int port, int bytes, | ||||
*/ | */ | ||||
now = sbinuptime(); | now = sbinuptime(); | ||||
delta = now - vpmtmr->baseuptime; | delta = now - vpmtmr->baseuptime; | ||||
KASSERT(delta >= 0, ("vpmtmr_handler: uptime went backwards: " | KASSERT(delta >= 0, ("vpmtmr_handler: uptime went backwards: " | ||||
"%#lx to %#lx", vpmtmr->baseuptime, now)); | "%#lx to %#lx", vpmtmr->baseuptime, now)); | ||||
*val = vpmtmr->baseval + delta / vpmtmr->freq_sbt; | *val = vpmtmr->baseval + delta / vpmtmr->freq_sbt; | ||||
return (0); | return (0); | ||||
} | |||||
int | |||||
vpmtmr_snapshot(struct vpmtmr *vpmtmr, struct vm_snapshot_meta *meta) | |||||
{ | |||||
int ret; | |||||
SNAPSHOT_VAR_OR_LEAVE(vpmtmr->baseval, meta, ret, done); | |||||
done: | |||||
return (ret); | |||||
} | } |