aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-06 16:37:18 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-06 16:37:18 +0000
commit06dca6a7c1acd2301cbf5fe06d6cda2833c958be (patch)
tree81412b8bca1c9de497ef05d725fb03d95dbeaac4 /target-ppc/op_helper.c
parent6527f6ea9c2ab3116bd363457021b93bd531d858 (diff)
target-ppc: convert dcr load/store to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5893 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 6137b0e748..8c9b804716 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1756,9 +1756,9 @@ target_ulong helper_602_mfrom (target_ulong arg)
/* Embedded PowerPC specific helpers */
/* XXX: to be improved to check access rights when in user-mode */
-void do_load_dcr (void)
+target_ulong helper_load_dcr (target_ulong dcrn)
{
- target_ulong val;
+ target_ulong val = 0;
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
@@ -1766,18 +1766,17 @@ void do_load_dcr (void)
}
raise_exception_err(env, POWERPC_EXCP_PROGRAM,
POWERPC_EXCP_INVAL | POWERPC_EXCP_INVAL_INVAL);
- } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) {
+ } else if (unlikely(ppc_dcr_read(env->dcr_env, dcrn, &val) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0);
}
raise_exception_err(env, POWERPC_EXCP_PROGRAM,
POWERPC_EXCP_INVAL | POWERPC_EXCP_PRIV_REG);
- } else {
- T0 = val;
}
+ return val;
}
-void do_store_dcr (void)
+void helper_store_dcr (target_ulong dcrn, target_ulong val)
{
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
@@ -1785,7 +1784,7 @@ void do_store_dcr (void)
}
raise_exception_err(env, POWERPC_EXCP_PROGRAM,
POWERPC_EXCP_INVAL | POWERPC_EXCP_INVAL_INVAL);
- } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) {
+ } else if (unlikely(ppc_dcr_write(env->dcr_env, dcrn, val) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0);
}