diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-12 21:11:03 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-12 21:11:03 +0000 |
commit | 2e719ba3476fcf1c7c74649d9e16f486eb8c02fc (patch) | |
tree | 266674805dfd350f526312e8d158e25d72b4ffe7 /target-ppc | |
parent | 83b1fb88f854fcd631dc411ab955d5bd3498fbd3 (diff) | |
download | qemu-2e719ba3476fcf1c7c74649d9e16f486eb8c02fc.zip qemu-2e719ba3476fcf1c7c74649d9e16f486eb8c02fc.tar.gz qemu-2e719ba3476fcf1c7c74649d9e16f486eb8c02fc.tar.bz2 |
Embedded PowerPC Device Control Registers infrastructure.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2653 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/cpu.h | 6 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 0560a38..2a2c440 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -730,8 +730,6 @@ struct CPUPPCState { /* Time base and decrementer */ ppc_tb_t *tb_env; /* Device control registers */ - int (*dcr_read)(ppc_dcr_t *dcr_env, int dcr_num, target_ulong *val); - int (*dcr_write)(ppc_dcr_t *dcr_env, int dcr_num, target_ulong val); ppc_dcr_t *dcr_env; /* PowerPC TLB registers (for 4xx and 60x software driven TLBs) */ @@ -863,6 +861,10 @@ void store_booke_tsr (CPUPPCState *env, target_ulong val); #endif #endif +/* Device control registers */ +int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, target_ulong *valp); +int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val); + #define TARGET_PAGE_BITS 12 #include "cpu-all.h" diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index e1fff7f..a65da36 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -1249,20 +1249,26 @@ void do_load_dcr (void) { target_ulong val; - if (unlikely(env->dcr_read == NULL)) + if (unlikely(env->dcr_env == NULL)) { + printf("No DCR environment\n"); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); - else if (unlikely((*env->dcr_read)(env->dcr_env, T0, &val) != 0)) + } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) { + printf("DCR read error\n"); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); - else + } else { T0 = val; + } } void do_store_dcr (void) { - if (unlikely(env->dcr_write == NULL)) + if (unlikely(env->dcr_env == NULL)) { + printf("No DCR environment\n"); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); - else if (unlikely((*env->dcr_write)(env->dcr_env, T0, T1) != 0)) + } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) { + printf("DCR write error\n"); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); + } } void do_load_403_pb (int num) |