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;
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;
#include <palacios/vm_guest.h>
-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;
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) {
static struct vm_timer_ops timer_ops = {
- .update_time = pit_update_time,
- .advance_timer = pit_advance_time,
+ .update_timer = pit_update_timer,
};