aboutsummaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/cpu.h6
-rw-r--r--target-ppc/op_helper.c16
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)