aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/machine.c
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2010-01-28 00:00:53 +0300
committerBlue Swirl <blauwirbel@gmail.com>2010-01-27 21:21:57 +0000
commit8f4efc55887957f7ca7d87d4a6b58463cfc9d0d6 (patch)
treecac494047ad326969d34cf031df75df424561c1c /target-sparc/machine.c
parent4f690853bb3053acc6de034b15170894afd9da4e (diff)
downloadqemu-8f4efc55887957f7ca7d87d4a6b58463cfc9d0d6.zip
qemu-8f4efc55887957f7ca7d87d4a6b58463cfc9d0d6.tar.gz
qemu-8f4efc55887957f7ca7d87d4a6b58463cfc9d0d6.tar.bz2
sparc64: reimplement tick timers v4
sparc64 timer has tick counter which can be set and read, and tick compare value used as deadline to fire timer interrupt. The timer is not used as periodic timer, instead deadline is set each time new timer interrupt is needed. v3 -> v4: - coding style v2 -> v3: - added missing timer debug output macro - CPUTimer struct and typedef moved to cpu.h - change CPU_SAVE_VERSION to 6, older save formats not supported v1 -> v2: - new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks - save offset from clock source to implement cpu_tick_set_count - renamed struct sun4u_timer to CPUTimer - load and save cpu timers v0 -> v1: - coding style Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/machine.c')
-rw-r--r--target-sparc/machine.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/target-sparc/machine.c b/target-sparc/machine.c
index c7c03b6..4b87ec6 100644
--- a/target-sparc/machine.c
+++ b/target-sparc/machine.c
@@ -84,8 +84,8 @@ void cpu_save(QEMUFile *f, void *opaque)
qemu_put_be64s(f, &env->fprs);
qemu_put_be64s(f, &env->tick_cmpr);
qemu_put_be64s(f, &env->stick_cmpr);
- qemu_put_ptimer(f, env->tick);
- qemu_put_ptimer(f, env->stick);
+ cpu_put_timer(f, env->tick);
+ cpu_put_timer(f, env->stick);
qemu_put_be64s(f, &env->gsr);
qemu_put_be32s(f, &env->gl);
qemu_put_be64s(f, &env->hpstate);
@@ -96,7 +96,7 @@ void cpu_save(QEMUFile *f, void *opaque)
qemu_put_be64s(f, &env->hver);
qemu_put_be64s(f, &env->hstick_cmpr);
qemu_put_be64s(f, &env->ssr);
- qemu_put_ptimer(f, env->hstick);
+ cpu_put_timer(f, env->hstick);
#endif
}
@@ -106,7 +106,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
int i;
uint32_t tmp;
- if (version_id != 5)
+ if (version_id < 6)
return -EINVAL;
for(i = 0; i < 8; i++)
qemu_get_betls(f, &env->gregs[i]);
@@ -180,8 +180,8 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be64s(f, &env->fprs);
qemu_get_be64s(f, &env->tick_cmpr);
qemu_get_be64s(f, &env->stick_cmpr);
- qemu_get_ptimer(f, env->tick);
- qemu_get_ptimer(f, env->stick);
+ cpu_get_timer(f, env->tick);
+ cpu_get_timer(f, env->stick);
qemu_get_be64s(f, &env->gsr);
qemu_get_be32s(f, &env->gl);
qemu_get_be64s(f, &env->hpstate);
@@ -192,7 +192,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be64s(f, &env->hver);
qemu_get_be64s(f, &env->hstick_cmpr);
qemu_get_be64s(f, &env->ssr);
- qemu_get_ptimer(f, env->hstick);
+ cpu_get_timer(f, env->hstick);
#endif
tlb_flush(env, 1);
return 0;