diff options
author | Alexander Graf <agraf@suse.de> | 2009-12-21 12:24:17 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-12-21 13:42:37 +0100 |
commit | e3ea652962383a2ffc05b2f1b10a0e97542eb6f8 (patch) | |
tree | 7ce782d8d043830083b0aed139da7f28ea591383 /target-ppc | |
parent | c4b3be39661d158b3480ad6982dfdee36ec67c7a (diff) | |
download | qemu-e3ea652962383a2ffc05b2f1b10a0e97542eb6f8.zip qemu-e3ea652962383a2ffc05b2f1b10a0e97542eb6f8.tar.gz qemu-e3ea652962383a2ffc05b2f1b10a0e97542eb6f8.tar.bz2 |
PPC64: Fix timebase
On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using
two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL.
On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full
64 bits as return value. If we only take the lower ones, fine. But Linux
wants to see all 64 bits or it breaks.
This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary,
which usually happened a few seconds after bootup.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/cpu.h | 2 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 2535cbc..2dc301d 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -741,7 +741,7 @@ int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def); /* Time-base and decrementer management */ #ifndef NO_CPU_IO_DEFS -uint32_t cpu_ppc_load_tbl (CPUPPCState *env); +uint64_t cpu_ppc_load_tbl (CPUPPCState *env); uint32_t cpu_ppc_load_tbu (CPUPPCState *env); void cpu_ppc_store_tbu (CPUPPCState *env, uint32_t value); void cpu_ppc_store_tbl (CPUPPCState *env, uint32_t value); diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index e3bd29c..e7bcd71 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -68,7 +68,7 @@ void helper_store_dump_spr (uint32_t sprn) target_ulong helper_load_tbl (void) { - return cpu_ppc_load_tbl(env); + return (target_ulong)cpu_ppc_load_tbl(env); } target_ulong helper_load_tbu (void) |