aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-03 23:18:25 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-05-03 23:18:25 +0000
commitec844b96c083340a4c04849c2c1cdc09e85e0595 (patch)
treebffd30b677c4423be290835456621c7f06725809 /hw/pc.c
parentf72e8ff4a698c13c69b9f3f06a56b60ca5af3a78 (diff)
pit fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@781 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 261eda9920..e1293aad42 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -39,6 +39,7 @@ int speaker_data_on;
int dummy_refresh_clock;
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
+static PITState *pit;
static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
{
@@ -169,15 +170,15 @@ static void cmos_init(int ram_size, int boot_device)
static void speaker_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
speaker_data_on = (val >> 1) & 1;
- pit_set_gate(&pit_channels[2], val & 1);
+ pit_set_gate(pit, 2, val & 1);
}
static uint32_t speaker_ioport_read(void *opaque, uint32_t addr)
{
int out;
- out = pit_get_out(&pit_channels[2], qemu_get_clock(vm_clock));
+ out = pit_get_out(pit, 2, qemu_get_clock(vm_clock));
dummy_refresh_clock ^= 1;
- return (speaker_data_on << 1) | pit_channels[2].gate | (out << 5) |
+ return (speaker_data_on << 1) | pit_get_gate(pit, 2) | (out << 5) |
(dummy_refresh_clock << 4);
}
@@ -381,7 +382,7 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device,
register_ioport_write(0x92, 1, 1, ioport92_write, NULL);
pic_init();
- pit_init(0x40, 0);
+ pit = pit_init(0x40, 0);
fd = serial_open_device();
serial_init(0x3f8, 4, fd);