From 9fddaa0c0cabb610947146a79b4a9a38b0a216e5 Mon Sep 17 00:00:00 2001 From: bellard Date: Fri, 21 May 2004 12:59:32 +0000 Subject: PowerPC merge: real time TB and decrementer - faster and simpler exception handling (Jocelyn Mayer) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@841 c046a42c-6fe2-441c-8c8c-71466251a162 --- linux-user/main.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) (limited to 'linux-user/main.c') diff --git a/linux-user/main.c b/linux-user/main.c index c0759bfefc..2275b01f97 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -504,6 +504,49 @@ void cpu_loop (CPUSPARCState *env) #endif #ifdef TARGET_PPC + +static inline uint64_t cpu_ppc_get_tb (CPUState *env) +{ + /* TO FIX */ + return 0; +} + +uint32_t cpu_ppc_load_tbl (CPUState *env) +{ + return cpu_ppc_get_tb(env) & 0xFFFFFFFF; +} + +uint32_t cpu_ppc_load_tbu (CPUState *env) +{ + return cpu_ppc_get_tb(env) >> 32; +} + +static void cpu_ppc_store_tb (CPUState *env, uint64_t value) +{ + /* TO FIX */ +} + +void cpu_ppc_store_tbu (CPUState *env, uint32_t value) +{ + cpu_ppc_store_tb(env, ((uint64_t)value << 32) | cpu_ppc_load_tbl(env)); +} + +void cpu_ppc_store_tbl (CPUState *env, uint32_t value) +{ + cpu_ppc_store_tb(env, ((uint64_t)cpu_ppc_load_tbl(env) << 32) | value); +} + +uint32_t cpu_ppc_load_decr (CPUState *env) +{ + /* TO FIX */ + return -1; +} + +void cpu_ppc_store_decr (CPUState *env, uint32_t value) +{ + /* TO FIX */ +} + void cpu_loop(CPUPPCState *env) { target_siginfo_t info; @@ -812,7 +855,7 @@ void cpu_loop(CPUPPCState *env) abort(); case EXCP_MTMSR: /* We reloaded the msr, just go on */ - if (msr_pr) { + if (msr_pr == 0) { fprintf(stderr, "Tried to go into supervisor mode !\n"); if (loglevel) fprintf(logfile, "Tried to go into supervisor mode !\n"); @@ -842,12 +885,7 @@ void cpu_loop(CPUPPCState *env) } abort(); } - if (trapnr < EXCP_PPC_MAX) - env->exceptions &= ~(1 << trapnr); process_pending_signals(env); - if (env->exceptions != 0) { - check_exception_state(env); - } } } #endif -- cgit v1.2.3