diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-28 00:32:32 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-28 00:32:32 +0000 |
commit | d2856f1ad4c259e5766847c49acbb4e390731bd4 (patch) | |
tree | a6d87e5188c9951cb9e5c13b58eac28d34755fc0 /target-ppc | |
parent | 923e5e339f16d55109a75e3f99a2c668571cc58b (diff) | |
download | hqemu-d2856f1ad4c259e5766847c49acbb4e390731bd4.zip hqemu-d2856f1ad4c259e5766847c49acbb4e390731bd4.tar.gz |
Factorize code in translate.c
(Glauber Costa)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4274 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/translate.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 7c47dee..8fbf3c8 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6345,3 +6345,45 @@ int gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb) { return gen_intermediate_code_internal(env, tb, 1); } + +void gen_pc_load(CPUState *env, TranslationBlock *tb, + unsigned long searched_pc, int pc_pos, void *puc) +{ + int type, c; + /* for PPC, we need to look at the micro operation to get the + * access type */ + env->nip = gen_opc_pc[pc_pos]; + c = gen_opc_buf[pc_pos]; + switch(c) { +#if defined(CONFIG_USER_ONLY) +#define CASE3(op)\ + case INDEX_op_ ## op ## _raw +#else +#define CASE3(op)\ + case INDEX_op_ ## op ## _user:\ + case INDEX_op_ ## op ## _kernel:\ + case INDEX_op_ ## op ## _hypv +#endif + + CASE3(stfd): + CASE3(stfs): + CASE3(lfd): + CASE3(lfs): + type = ACCESS_FLOAT; + break; + CASE3(lwarx): + type = ACCESS_RES; + break; + CASE3(stwcx): + type = ACCESS_RES; + break; + CASE3(eciwx): + CASE3(ecowx): + type = ACCESS_EXT; + break; + default: + type = ACCESS_INT; + break; + } + env->access_type = type; +} |