dm: vpit: add vPIT support

vPIT is used as a source of system timer by UEFI (e.g. OVMF).

This is ported from Bhyve, with a few changes:

- move to user space, using POSIX timer
- support timer mode 3
- improve the emulation of OUT and STATUS byte
- improve the emulation of counter behavior
- improve the emulation of CE update in periodic mode
- treat CR == 0 as 0x10000

Origin: FreeBSD
License: BSD-3-Clause
URL: https://svnweb.freebsd.org/
commit: 283291
Purpose: Adding vPIT support.
Maintained-by: External

Tracked-On: #1392
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Peter Fang
2018-09-27 13:51:55 -07:00
committed by wenlingz
parent 0359bd0f99
commit b5f770707e
6 changed files with 803 additions and 3 deletions

View File

@@ -62,6 +62,7 @@ struct vmctx {
/* fields to track virtual devices */
void *atkbdc_base;
void *vrtc;
void *vpit;
void *ioc_dev;
};