X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2F8254.c;h=69fe0e702bd1343b414c060233abc2e3b04d9a17;hp=7394224437a2d2a6cb1ba9030a2902d47f9d20d0;hb=fc4b7290edb57a3528a26f95c4478fe07d45a581;hpb=88a3605446744969abe6f193a7bc20e62d5aa555 diff --git a/palacios/src/devices/8254.c b/palacios/src/devices/8254.c index 7394224..69fe0e7 100644 --- a/palacios/src/devices/8254.c +++ b/palacios/src/devices/8254.c @@ -294,7 +294,7 @@ static void pit_update_timer(struct guest_info * info, ullong_t cpu_cycles, ullo // (void *)(addr_t)state->pit_reload); // How do we check for a one shot.... - if (state->pit_reload == 0) { + if (reload_val == 0) { reload_val = 1; } @@ -302,10 +302,10 @@ static void pit_update_timer(struct guest_info * info, ullong_t cpu_cycles, ullo #ifdef __V3_64BIT__ - cpu_cycles = tmp_cycles % state->pit_reload; - tmp_cycles = tmp_cycles / state->pit_reload; + cpu_cycles = tmp_cycles % reload_val; + tmp_cycles = tmp_cycles / reload_val; #else - cpu_cycles = do_divll(tmp_cycles, state->pit_reload); + cpu_cycles = do_divll(tmp_cycles, reload_val); #endif oscillations += tmp_cycles; @@ -871,7 +871,7 @@ static int pit_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { // Get cpu frequency and calculate the global pit oscilattor counter/cycle - do_divll(reload_val, OSC_HZ); + do_divll(reload_val, OSC_HZ); // this is a floor, but will be >=1 for any machine faster than 1.2 MHz pit_state->pit_counter = reload_val; pit_state->pit_reload = reload_val;