summary refs log tree commit diff stats
path: root/hw/hpet_emul.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-06-13 14:15:44 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-06-13 15:33:01 +0300
commitbe4b44c59bcee4b3d63bfef137c0ac7d68ef514b (patch)
treedb3825f2e725273609df6346f6d6a496d03d97df /hw/hpet_emul.h
parentcea1adfda7cca55788fbe55107e5e7943d374065 (diff)
downloadfocaccia-qemu-be4b44c59bcee4b3d63bfef137c0ac7d68ef514b.tar.gz
focaccia-qemu-be4b44c59bcee4b3d63bfef137c0ac7d68ef514b.zip
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>
Diffstat (limited to 'hw/hpet_emul.h')
-rw-r--r--hw/hpet_emul.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/hpet_emul.h b/hw/hpet_emul.h
index 9c268ccae4..e8b794c7fa 100644
--- a/hw/hpet_emul.h
+++ b/hw/hpet_emul.h
@@ -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