aboutsummaryrefslogtreecommitdiff
path: root/target-cris/op_helper.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 21:48:06 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 21:48:06 +0000
commitd12d51d5ba84817e2e7dcc95aeabebb230cc3781 (patch)
tree8be0db88a5e7970ca29a88aec04f6d7961864c1e /target-cris/op_helper.c
parent40a4539e2041f4a9dd52d269f46926b7ed2b73ff (diff)
Clean up debugging code #ifdefs (Eduardo Habkost)
Use macros to avoid #ifdefs on debugging code. This patch doesn't try to merge logging macros from different files, but just unify the debugging code #ifdefs onto a macro on each file. A further cleanup can unify the debugging macros on a common header, later Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-cris/op_helper.c')
-rw-r--r--target-cris/op_helper.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index c96e48d837..c55ce86b64 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -25,7 +25,16 @@
#include "helper.h"
#include "host-utils.h"
+//#define CRIS_OP_HELPER_DEBUG
+
+
+#ifdef CRIS_OP_HELPER_DEBUG
+#define D(x) x
+#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
+#else
#define D(x)
+#define D_LOG(...) do { } while (0)
+#endif
#if !defined(CONFIG_USER_ONLY)
@@ -59,8 +68,8 @@ void tlb_fill (target_ulong addr, int is_write, int mmu_idx, void *retaddr)
saved_env = env;
env = cpu_single_env;
- D(fprintf(logfile, "%s pc=%x tpc=%x ra=%x\n", __func__,
- env->pc, env->debug1, retaddr));
+ D_LOG("%s pc=%x tpc=%x ra=%x\n", __func__,
+ env->pc, env->debug1, retaddr);
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx, 1);
if (unlikely(ret)) {
if (retaddr) {
@@ -155,9 +164,8 @@ void helper_movl_sreg_reg (uint32_t sreg, uint32_t reg)
env->tlbsets[srs - 1][set][idx].lo = lo;
env->tlbsets[srs - 1][set][idx].hi = hi;
- D(fprintf(logfile,
- "tlb flush vaddr=%x v=%d pc=%x\n",
- vaddr, tlb_v, env->pc));
+ D_LOG("tlb flush vaddr=%x v=%d pc=%x\n",
+ vaddr, tlb_v, env->pc);
tlb_flush_page(env, vaddr);
}
}
@@ -213,10 +221,10 @@ void helper_rfe(void)
{
int rflag = env->pregs[PR_CCS] & R_FLAG;
- D(fprintf(logfile, "rfe: erp=%x pid=%x ccs=%x btarget=%x\n",
+ D_LOG("rfe: erp=%x pid=%x ccs=%x btarget=%x\n",
env->pregs[PR_ERP], env->pregs[PR_PID],
env->pregs[PR_CCS],
- env->btarget));
+ env->btarget);
cris_ccs_rshift(env);
@@ -229,10 +237,10 @@ void helper_rfn(void)
{
int rflag = env->pregs[PR_CCS] & R_FLAG;
- D(fprintf(logfile, "rfn: erp=%x pid=%x ccs=%x btarget=%x\n",
+ D_LOG("rfn: erp=%x pid=%x ccs=%x btarget=%x\n",
env->pregs[PR_ERP], env->pregs[PR_PID],
env->pregs[PR_CCS],
- env->btarget));
+ env->btarget);
cris_ccs_rshift(env);