hpet: Make number of timers configurable

One HPET block supports up to 32 timers. Allow to instantiate more than
the recommended and implemented minimum of 3. The number is configured
via the qdev property "timers". It is also saved/restored so that it
need not match between migration peers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Jan Kiszka 2010-06-13 14:15:44 +02:00 committed by Blue Swirl
parent cea1adfda7
commit be4b44c59b
2 changed files with 45 additions and 14 deletions

View file

@ -17,7 +17,8 @@
#define HPET_CLK_PERIOD 10000000ULL /* 10000000 femtoseconds == 10ns*/
#define FS_PER_NS 1000000
#define HPET_NUM_TIMERS 3
#define HPET_MIN_TIMERS 3
#define HPET_MAX_TIMERS 32
#define HPET_NUM_IRQ_ROUTES 32
@ -34,6 +35,9 @@
#define HPET_TN_ROUTE 0x010
#define HPET_CFG_WRITE_MASK 0x3
#define HPET_ID_NUM_TIM_SHIFT 8
#define HPET_ID_NUM_TIM_MASK 0x1f00
#define HPET_TN_TYPE_LEVEL 0x002
#define HPET_TN_ENABLE 0x004
#define HPET_TN_PERIODIC 0x008