Revision 93fcfe39 target-mips/helper.c

b/target-mips/helper.c
117 117
    int ret = TLBRET_MATCH;
118 118

  
119 119
#if 0
120
    if (logfile) {
121
        fprintf(logfile, "user mode %d h %08x\n",
122
                user_mode, env->hflags);
123
    }
120
    qemu_log("user mode %d h %08x\n", user_mode, env->hflags);
124 121
#endif
125 122

  
126 123
    if (address <= (int32_t)0x7FFFFFFFUL) {
......
198 195
        }
199 196
    }
200 197
#if 0
201
    if (logfile) {
202
        fprintf(logfile, TARGET_FMT_lx " %d %d => " TARGET_FMT_lx " %d (%d)\n",
203
                address, rw, access_type, *physical, *prot, ret);
198
    qemu_log(TARGET_FMT_lx " %d %d => " TARGET_FMT_lx " %d (%d)\n",
199
            address, rw, access_type, *physical, *prot, ret);
204 200
    }
205 201
#endif
206 202

  
......
233 229
    int access_type;
234 230
    int ret = 0;
235 231

  
236
    if (logfile) {
237 232
#if 0
238
        cpu_dump_state(env, logfile, fprintf, 0);
233
    log_cpu_state(env, 0);
239 234
#endif
240
        fprintf(logfile, "%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " rw %d mmu_idx %d smmu %d\n",
241
                __func__, env->active_tc.PC, address, rw, mmu_idx, is_softmmu);
242
    }
235
    qemu_log("%s pc " TARGET_FMT_lx " ad " TARGET_FMT_lx " rw %d mmu_idx %d smmu %d\n",
236
              __func__, env->active_tc.PC, address, rw, mmu_idx, is_softmmu);
243 237

  
244 238
    rw &= 1;
245 239

  
......
252 246
#else
253 247
    ret = get_physical_address(env, &physical, &prot,
254 248
                               address, rw, access_type);
255
    if (logfile) {
256
        fprintf(logfile, "%s address=" TARGET_FMT_lx " ret %d physical " TARGET_FMT_lx " prot %d\n",
257
                __func__, address, ret, physical, prot);
258
    }
249
    qemu_log("%s address=" TARGET_FMT_lx " ret %d physical " TARGET_FMT_lx " prot %d\n",
250
              __func__, address, ret, physical, prot);
259 251
    if (ret == TLBRET_MATCH) {
260 252
       ret = tlb_set_page(env, address & TARGET_PAGE_MASK,
261 253
                          physical & TARGET_PAGE_MASK, prot,
......
357 349
    int cause = -1;
358 350
    const char *name;
359 351

  
360
    if (logfile && env->exception_index != EXCP_EXT_INTERRUPT) {
352
    if (qemu_log_enabled() && env->exception_index != EXCP_EXT_INTERRUPT) {
361 353
        if (env->exception_index < 0 || env->exception_index > EXCP_LAST)
362 354
            name = "unknown";
363 355
        else
364 356
            name = excp_names[env->exception_index];
365 357

  
366
        fprintf(logfile, "%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n",
367
                __func__, env->active_tc.PC, env->CP0_EPC, name);
358
        qemu_log("%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n",
359
                 __func__, env->active_tc.PC, env->CP0_EPC, name);
368 360
    }
369 361
    if (env->exception_index == EXCP_EXT_INTERRUPT &&
370 362
        (env->hflags & MIPS_HFLAG_DM))
......
558 550
        env->CP0_Cause = (env->CP0_Cause & ~(0x1f << CP0Ca_EC)) | (cause << CP0Ca_EC);
559 551
        break;
560 552
    default:
561
        if (logfile) {
562
            fprintf(logfile, "Invalid MIPS exception %d. Exiting\n",
563
                    env->exception_index);
564
        }
553
        qemu_log("Invalid MIPS exception %d. Exiting\n", env->exception_index);
565 554
        printf("Invalid MIPS exception %d. Exiting\n", env->exception_index);
566 555
        exit(1);
567 556
    }
568
    if (logfile && env->exception_index != EXCP_EXT_INTERRUPT) {
569
        fprintf(logfile, "%s: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " cause %d\n"
557
    if (qemu_log_enabled() && env->exception_index != EXCP_EXT_INTERRUPT) {
558
        qemu_log("%s: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " cause %d\n"
570 559
                "    S %08x C %08x A " TARGET_FMT_lx " D " TARGET_FMT_lx "\n",
571 560
                __func__, env->active_tc.PC, env->CP0_EPC, cause,
572 561
                env->CP0_Status, env->CP0_Cause, env->CP0_BadVAddr,

Also available in: Unified diff