Revision d12d51d5 target-cris/helper.c

b/target-cris/helper.c
28 28
#include "exec-all.h"
29 29
#include "host-utils.h"
30 30

  
31

  
32
//#define CRIS_HELPER_DEBUG
33

  
34

  
35
#ifdef CRIS_HELPER_DEBUG
36
#define D(x) x
37
#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
38
#else
31 39
#define D(x)
40
#define D_LOG(...) do { } while (0)
41
#endif
32 42

  
33 43
#if defined(CONFIG_USER_ONLY)
34 44

  
......
98 108
		r = tlb_set_page(env, address, phy, prot, mmu_idx, is_softmmu);
99 109
	}
100 110
	if (r > 0)
101
		D(fprintf(logfile, "%s returns %d irqreq=%x addr=%x"
111
		D_LOG("%s returns %d irqreq=%x addr=%x"
102 112
			  " phy=%x ismmu=%d vec=%x pc=%x\n", 
103 113
			  __func__, r, env->interrupt_request, 
104
			  address, res.phy, is_softmmu, res.bf_vec, env->pc));
114
			  address, res.phy, is_softmmu, res.bf_vec, env->pc);
105 115
	return r;
106 116
}
107 117

  
......
109 119
{
110 120
	int ex_vec = -1;
111 121

  
112
	D(fprintf (logfile, "exception index=%d interrupt_req=%d\n",
122
	D_LOG( "exception index=%d interrupt_req=%d\n",
113 123
		   env->exception_index,
114
		   env->interrupt_request));
124
		   env->interrupt_request);
115 125

  
116 126
	switch (env->exception_index)
117 127
	{
......
147 157
	env->pregs[PR_EXS] = (ex_vec & 0xff) << 8;
148 158

  
149 159
	if (env->dslot) {
150
		D(fprintf(logfile, "excp isr=%x PC=%x ds=%d SP=%x"
160
		D_LOG("excp isr=%x PC=%x ds=%d SP=%x"
151 161
			  " ERP=%x pid=%x ccs=%x cc=%d %x\n",
152 162
			  ex_vec, env->pc, env->dslot,
153 163
			  env->regs[R_SP],
154 164
			  env->pregs[PR_ERP], env->pregs[PR_PID],
155 165
			  env->pregs[PR_CCS],
156
			  env->cc_op, env->cc_mask));
166
			  env->cc_op, env->cc_mask);
157 167
		/* We loose the btarget, btaken state here so rexec the
158 168
		   branch.  */
159 169
		env->pregs[PR_ERP] -= env->dslot;
......
171 181

  
172 182
	/* Apply the CRIS CCS shift. Clears U if set.  */
173 183
	cris_shift_ccs(env);
174
	D(fprintf (logfile, "%s isr=%x vec=%x ccs=%x pid=%d erp=%x\n", 
184
	D_LOG("%s isr=%x vec=%x ccs=%x pid=%d erp=%x\n", 
175 185
		   __func__, env->pc, ex_vec, 
176 186
		   env->pregs[PR_CCS],
177 187
		   env->pregs[PR_PID], 
178
		   env->pregs[PR_ERP]));
188
		   env->pregs[PR_ERP]);
179 189
}
180 190

  
181 191
target_phys_addr_t cpu_get_phys_page_debug(CPUState * env, target_ulong addr)

Also available in: Unified diff