summaryrefslogtreecommitdiff
path: root/hw/ppc.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-10 03:04:26 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:52 -0500
commit6ee093c90761eabfc6255624000d3d8248802209 (patch)
treef550274a05a1cd7a379f3e4d1cb7789fb2e64b8c /hw/ppc.c
parentb03b2e48cb322cb695ff7a6666b25712140ea3c9 (diff)
downloadqemu-6ee093c90761eabfc6255624000d3d8248802209.tar.gz
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ppc.c')
-rw-r--r--hw/ppc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/ppc.c b/hw/ppc.c
index a01bde9b38..2d66b9dc59 100644
--- a/hw/ppc.c
+++ b/hw/ppc.c
@@ -397,7 +397,7 @@ static inline uint64_t cpu_ppc_get_tb(ppc_tb_t *tb_env, uint64_t vmclk,
int64_t tb_offset)
{
/* TB time in tb periods */
- return muldiv64(vmclk, tb_env->tb_freq, ticks_per_sec) + tb_offset;
+ return muldiv64(vmclk, tb_env->tb_freq, get_ticks_per_sec()) + tb_offset;
}
uint32_t cpu_ppc_load_tbl (CPUState *env)
@@ -430,7 +430,7 @@ uint32_t cpu_ppc_load_tbu (CPUState *env)
static inline void cpu_ppc_store_tb(ppc_tb_t *tb_env, uint64_t vmclk,
int64_t *tb_offsetp, uint64_t value)
{
- *tb_offsetp = value - muldiv64(vmclk, tb_env->tb_freq, ticks_per_sec);
+ *tb_offsetp = value - muldiv64(vmclk, tb_env->tb_freq, get_ticks_per_sec());
LOG_TB("%s: tb %016" PRIx64 " offset %08" PRIx64 "\n",
__func__, value, *tb_offsetp);
}
@@ -557,9 +557,9 @@ static inline uint32_t _cpu_ppc_load_decr(CPUState *env, uint64_t next)
diff = next - qemu_get_clock(vm_clock);
if (diff >= 0)
- decr = muldiv64(diff, tb_env->decr_freq, ticks_per_sec);
+ decr = muldiv64(diff, tb_env->decr_freq, get_ticks_per_sec());
else
- decr = -muldiv64(-diff, tb_env->decr_freq, ticks_per_sec);
+ decr = -muldiv64(-diff, tb_env->decr_freq, get_ticks_per_sec());
LOG_TB("%s: %08" PRIx32 "\n", __func__, decr);
return decr;
@@ -586,7 +586,7 @@ uint64_t cpu_ppc_load_purr (CPUState *env)
diff = qemu_get_clock(vm_clock) - tb_env->purr_start;
- return tb_env->purr_load + muldiv64(diff, tb_env->tb_freq, ticks_per_sec);
+ return tb_env->purr_load + muldiv64(diff, tb_env->tb_freq, get_ticks_per_sec());
}
/* When decrementer expires,
@@ -618,7 +618,7 @@ static void __cpu_ppc_store_decr (CPUState *env, uint64_t *nextp,
LOG_TB("%s: %08" PRIx32 " => %08" PRIx32 "\n", __func__,
decr, value);
now = qemu_get_clock(vm_clock);
- next = now + muldiv64(value, ticks_per_sec, tb_env->decr_freq);
+ next = now + muldiv64(value, get_ticks_per_sec(), tb_env->decr_freq);
if (is_excp)
next += *nextp - now;
if (next == now)
@@ -788,7 +788,7 @@ static void cpu_4xx_fit_cb (void *opaque)
/* Cannot occur, but makes gcc happy */
return;
}
- next = now + muldiv64(next, ticks_per_sec, tb_env->tb_freq);
+ next = now + muldiv64(next, get_ticks_per_sec(), tb_env->tb_freq);
if (next == now)
next++;
qemu_mod_timer(ppcemb_timer->fit_timer, next);
@@ -818,7 +818,7 @@ static void start_stop_pit (CPUState *env, ppc_tb_t *tb_env, int is_excp)
__func__, ppcemb_timer->pit_reload);
now = qemu_get_clock(vm_clock);
next = now + muldiv64(ppcemb_timer->pit_reload,
- ticks_per_sec, tb_env->decr_freq);
+ get_ticks_per_sec(), tb_env->decr_freq);
if (is_excp)
next += tb_env->decr_next - now;
if (next == now)
@@ -878,7 +878,7 @@ static void cpu_4xx_wdt_cb (void *opaque)
/* Cannot occur, but makes gcc happy */
return;
}
- next = now + muldiv64(next, ticks_per_sec, tb_env->decr_freq);
+ next = now + muldiv64(next, get_ticks_per_sec(), tb_env->decr_freq);
if (next == now)
next++;
LOG_TB("%s: TCR " TARGET_FMT_lx " TSR " TARGET_FMT_lx "\n", __func__,