aboutsummaryrefslogtreecommitdiff
path: root/hw/i8254.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-01 20:31:43 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-17 09:58:22 -0600
commit4aa5d2853a69d95f5e05bd02200dfc6f47cab9de (patch)
tree16251b86d628106b5933949ae7ceb932f3b67569 /hw/i8254.h
parent302fe51b5900c5ca5be921269b61f4862e0634ce (diff)
downloadqemu-4aa5d2853a69d95f5e05bd02200dfc6f47cab9de.zip
qemu-4aa5d2853a69d95f5e05bd02200dfc6f47cab9de.tar.gz
qemu-4aa5d2853a69d95f5e05bd02200dfc6f47cab9de.tar.bz2
i8254: Factor out pit_get_channel_info
Instead of providing 4 individual query functions for mode, gate, output and initial counter state, introduce a service that queries all information at once. This comes with tiny additional costs for pcspk_callback but with a much cleaner interface. Also, it will simplify the implementation of the KVM in-kernel PIT model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/i8254.h')
-rw-r--r--hw/i8254.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/i8254.h b/hw/i8254.h
index 8ad8e07..a1d2e98 100644
--- a/hw/i8254.h
+++ b/hw/i8254.h
@@ -30,6 +30,13 @@
#define PIT_FREQ 1193182
+typedef struct PITChannelInfo {
+ int gate;
+ int mode;
+ int initial_count;
+ int out;
+} PITChannelInfo;
+
static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
qemu_irq alt_irq)
{
@@ -45,9 +52,6 @@ static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
}
void pit_set_gate(ISADevice *dev, int channel, int val);
-int pit_get_gate(ISADevice *dev, int channel);
-int pit_get_initial_count(ISADevice *dev, int channel);
-int pit_get_mode(ISADevice *dev, int channel);
-int pit_get_out(ISADevice *dev, int channel, int64_t current_time);
+void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *info);
#endif /* !HW_I8254_H */