X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2F8254.c;h=8e7dede87825dfa19a979058deee39f48416af20;hb=596d3c2aa2f0a5360baf1c921e4543f014809b78;hp=51c3f042af12b32820a31fe85abc4e6b63d1edae;hpb=becaedb8845bde9b3e3f64c626b091b94918e50c;p=palacios-OLD.git diff --git a/palacios/src/devices/8254.c b/palacios/src/devices/8254.c index 51c3f04..8e7dede 100644 --- a/palacios/src/devices/8254.c +++ b/palacios/src/devices/8254.c @@ -162,12 +162,6 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint reload_val = 0xffff; } - // TODO: Check this.... - // Is this correct??? - if (reload_val == 0) { - reload_val = 1; - } - oscillations -= ch->counter; ch->counter = 0; channel_cycles = 1; @@ -176,6 +170,12 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint reload_val -= reload_val % 2; } + // TODO: Check this.... + // Is this correct??? + if (reload_val == 0) { + reload_val = 1; + } + channel_cycles += oscillations / reload_val; oscillations = oscillations % reload_val; @@ -236,7 +236,7 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint #include -static void pit_update_time(struct guest_info * info, ullong_t cpu_cycles, ullong_t cpu_freq, void * private_data) { +static void pit_update_timer(struct guest_info * info, ullong_t cpu_cycles, ullong_t cpu_freq, void * private_data) { struct vm_device * dev = (struct vm_device *)private_data; struct pit * state = (struct pit *)dev->private_data; // ullong_t tmp_ctr = state->pit_counter; @@ -313,14 +313,6 @@ static void pit_update_time(struct guest_info * info, ullong_t cpu_cycles, ullon return; } - -static void pit_advance_time(struct guest_info * core, void * private_data) { - - v3_raise_irq(core->vm_info, 0); -} - - - /* This should call out to handle_SQR_WAVE_write, etc... */ static int handle_channel_write(struct channel * ch, char val) { @@ -624,8 +616,7 @@ static int pit_write_command(struct guest_info * core, ushort_t port, void * src static struct vm_timer_ops timer_ops = { - .update_time = pit_update_time, - .advance_timer = pit_advance_time, + .update_timer = pit_update_timer, };