void cpu_dump_state (CPUState *env, FILE *f,

                     int (*cpu_fprintf)(FILE *f, const char *fmt, ...),

                     int flags)

{

#define RGPL  4

#define RFPL  4



    int i;



    cpu_fprintf(f, "NIP " ADDRX "   LR " ADDRX " CTR " ADDRX " XER %08x\n",

                env->nip, env->lr, env->ctr, env->xer);

    cpu_fprintf(f, "MSR " ADDRX " HID0 " ADDRX "  HF " ADDRX " idx %d\n",

                env->msr, env->spr[SPR_HID0], env->hflags, env->mmu_idx);

#if !defined(NO_TIMER_DUMP)

    cpu_fprintf(f, "TB %08x %08x "

#if !defined(CONFIG_USER_ONLY)

                "DECR %08x"

#endif

                "\n",

                cpu_ppc_load_tbu(env), cpu_ppc_load_tbl(env)

#if !defined(CONFIG_USER_ONLY)

                , cpu_ppc_load_decr(env)

#endif

                );

#endif

    for (i = 0; i < 32; i++) {

        if ((i & (RGPL - 1)) == 0)

            cpu_fprintf(f, "GPR%02d", i);

        cpu_fprintf(f, " " REGX, ppc_dump_gpr(env, i));

        if ((i & (RGPL - 1)) == (RGPL - 1))

            cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "CR ");

    for (i = 0; i < 8; i++)

        cpu_fprintf(f, "%01x", env->crf[i]);

    cpu_fprintf(f, "  [");

    for (i = 0; i < 8; i++) {

        char a = '-';

        if (env->crf[i] & 0x08)

            a = 'L';

        else if (env->crf[i] & 0x04)

            a = 'G';

        else if (env->crf[i] & 0x02)

            a = 'E';

        cpu_fprintf(f, " %c%c", a, env->crf[i] & 0x01 ? 'O' : ' ');

    }

    cpu_fprintf(f, " ]             RES " ADDRX "\n", env->reserve);

    for (i = 0; i < 32; i++) {

        if ((i & (RFPL - 1)) == 0)

            cpu_fprintf(f, "FPR%02d", i);

        cpu_fprintf(f, " %016" PRIx64, *((uint64_t *)&env->fpr[i]));

        if ((i & (RFPL - 1)) == (RFPL - 1))

            cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "FPSCR %08x\n", env->fpscr);

#if !defined(CONFIG_USER_ONLY)

    cpu_fprintf(f, "SRR0 " ADDRX " SRR1 " ADDRX " SDR1 " ADDRX "\n",

                env->spr[SPR_SRR0], env->spr[SPR_SRR1], env->sdr1);

#endif



#undef RGPL

#undef RFPL

}

void cpu_dump_state (CPUState *env, FILE *f,

                     int (*cpu_fprintf)(FILE *f, const char *fmt, ...),

                     int flags)

{

#define RGPL  4

#define RFPL  4



    int i;



    cpu_fprintf(f, "NIP " ADDRX "   LR " ADDRX " CTR " ADDRX " XER %08x\n",

                env->nip, env->lr, env->ctr, env->xer);

    cpu_fprintf(f, "MSR " ADDRX " HID0 " ADDRX "  HF " ADDRX " idx %d\n",

                env->msr, env->spr[SPR_HID0], env->hflags, env->mmu_idx);

#if !defined(NO_TIMER_DUMP)

    cpu_fprintf(f, "TB %08x %08x "

#if !defined(CONFIG_USER_ONLY)

                "DECR %08x"

#endif

                "\n",

                cpu_ppc_load_tbu(env), cpu_ppc_load_tbl(env)

#if !defined(CONFIG_USER_ONLY)

                , cpu_ppc_load_decr(env)

#endif

                );

#endif

    for (i = 0; i < 32; i++) {

        if ((i & (RGPL - 1)) == 0)

            cpu_fprintf(f, "GPR%02d", i);

        cpu_fprintf(f, " " REGX, ppc_dump_gpr(env, i));

        if ((i & (RGPL - 1)) == (RGPL - 1))

            cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "CR ");

    for (i = 0; i < 8; i++)

        cpu_fprintf(f, "%01x", env->crf[i]);

    cpu_fprintf(f, "  [");

    for (i = 0; i < 8; i++) {

        char a = '-';

        if (env->crf[i] & 0x08)

            a = 'L';

        else if (env->crf[i] & 0x04)

            a = 'G';

        else if (env->crf[i] & 0x02)

            a = 'E';

        cpu_fprintf(f, " %c%c", a, env->crf[i] & 0x01 ? 'O' : ' ');

    }

    cpu_fprintf(f, " ]             RES " ADDRX "\n", env->reserve);

    for (i = 0; i < 32; i++) {

        if ((i & (RFPL - 1)) == 0)

            cpu_fprintf(f, "FPR%02d", i);

        cpu_fprintf(f, " %016" PRIx64, *((uint64_t *)&env->fpr[i]));

        if ((i & (RFPL - 1)) == (RFPL - 1))

            cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "FPSCR %08x\n", env->fpscr);

#if !defined(CONFIG_USER_ONLY)

    cpu_fprintf(f, "SRR0 " ADDRX " SRR1 " ADDRX " SDR1 " ADDRX "\n",

                env->spr[SPR_SRR0], env->spr[SPR_SRR1], env->sdr1);

#endif



#undef RGPL

#undef RFPL

}

void FUNC_0 (CPUState *VAR_0, FILE *VAR_3,

                     int (*VAR_2)(FILE *VAR_3, const char *VAR_3, ...),

                     int VAR_4)

{

#define RGPL  4

#define RFPL  4



    int VAR_5;



    VAR_2(VAR_3, "NIP " ADDRX "   LR " ADDRX " CTR " ADDRX " XER %08x\n",

                VAR_0->nip, VAR_0->lr, VAR_0->ctr, VAR_0->xer);

    VAR_2(VAR_3, "MSR " ADDRX " HID0 " ADDRX "  HF " ADDRX " idx %d\n",

                VAR_0->msr, VAR_0->spr[SPR_HID0], VAR_0->hflags, VAR_0->mmu_idx);

#if !defined(NO_TIMER_DUMP)

    VAR_2(VAR_3, "TB %08x %08x "

#if !defined(CONFIG_USER_ONLY)

                "DECR %08x"

#endif

                "\n",

                cpu_ppc_load_tbu(VAR_0), cpu_ppc_load_tbl(VAR_0)

#if !defined(CONFIG_USER_ONLY)

                , cpu_ppc_load_decr(VAR_0)

#endif

                );

#endif

    for (VAR_5 = 0; VAR_5 < 32; VAR_5++) {

        if ((VAR_5 & (RGPL - 1)) == 0)

            VAR_2(VAR_3, "GPR%02d", VAR_5);

        VAR_2(VAR_3, " " REGX, ppc_dump_gpr(VAR_0, VAR_5));

        if ((VAR_5 & (RGPL - 1)) == (RGPL - 1))

            VAR_2(VAR_3, "\n");

    }

    VAR_2(VAR_3, "CR ");

    for (VAR_5 = 0; VAR_5 < 8; VAR_5++)

        VAR_2(VAR_3, "%01x", VAR_0->crf[VAR_5]);

    VAR_2(VAR_3, "  [");

    for (VAR_5 = 0; VAR_5 < 8; VAR_5++) {

        char VAR_6 = '-';

        if (VAR_0->crf[VAR_5] & 0x08)

            VAR_6 = 'L';

        else if (VAR_0->crf[VAR_5] & 0x04)

            VAR_6 = 'G';

        else if (VAR_0->crf[VAR_5] & 0x02)

            VAR_6 = 'E';

        VAR_2(VAR_3, " %c%c", VAR_6, VAR_0->crf[VAR_5] & 0x01 ? 'O' : ' ');

    }

    VAR_2(VAR_3, " ]             RES " ADDRX "\n", VAR_0->reserve);

    for (VAR_5 = 0; VAR_5 < 32; VAR_5++) {

        if ((VAR_5 & (RFPL - 1)) == 0)

            VAR_2(VAR_3, "FPR%02d", VAR_5);

        VAR_2(VAR_3, " %016" PRIx64, *((uint64_t *)&VAR_0->fpr[VAR_5]));

        if ((VAR_5 & (RFPL - 1)) == (RFPL - 1))

            VAR_2(VAR_3, "\n");

    }

    VAR_2(VAR_3, "FPSCR %08x\n", VAR_0->fpscr);

#if !defined(CONFIG_USER_ONLY)

    VAR_2(VAR_3, "SRR0 " ADDRX " SRR1 " ADDRX " SDR1 " ADDRX "\n",

                VAR_0->spr[SPR_SRR0], VAR_0->spr[SPR_SRR1], VAR_0->sdr1);

#endif



#undef RGPL

#undef RFPL

}

void FUNC_0 (CPUState *VAR_0, FILE *VAR_3,
int (*VAR_2)(FILE *VAR_3, const char *VAR_3, ...),
int VAR_4)
{ #define RGPL  4
#define RFPL  4
int VAR_5; VAR_2(VAR_3, "NIP " ADDRX "   LR " ADDRX " CTR " ADDRX " XER %08x\n",
VAR_0->nip, VAR_0->lr, VAR_0->ctr, VAR_0->xer); VAR_2(VAR_3, "MSR " ADDRX " HID0 " ADDRX "  HF " ADDRX " idx %d\n",
VAR_0->msr, VAR_0->spr[SPR_HID0], VAR_0->hflags, VAR_0->mmu_idx); #if !defined(NO_TIMER_DUMP)
VAR_2(VAR_3, "TB %08x %08x "
#if !defined(CONFIG_USER_ONLY)
"DECR %08x"
#endif
"\n",
cpu_ppc_load_tbu(VAR_0), cpu_ppc_load_tbl(VAR_0)
#if !defined(CONFIG_USER_ONLY)
, cpu_ppc_load_decr(VAR_0)
#endif
); #endif
for (VAR_5 = 0; VAR_5 < 32; VAR_5++) { if ((VAR_5 & (RGPL - 1)) == 0)
VAR_2(VAR_3, "GPR%02d", VAR_5); VAR_2(VAR_3, " " REGX, ppc_dump_gpr(VAR_0, VAR_5)); if ((VAR_5 & (RGPL - 1)) == (RGPL - 1))
VAR_2(VAR_3, "\n"); } VAR_2(VAR_3, "CR "); for (VAR_5 = 0; VAR_5 < 8; VAR_5++) VAR_2(VAR_3, "%01x", VAR_0->crf[VAR_5]); VAR_2(VAR_3, "  ["); for (VAR_5 = 0; VAR_5 < 8; VAR_5++) { char VAR_6 = '-'; if (VAR_0->crf[VAR_5] & 0x08)
VAR_6 = 'L'; else if (VAR_0->crf[VAR_5] & 0x04)
VAR_6 = 'G'; else if (VAR_0->crf[VAR_5] & 0x02)
VAR_6 = 'E'; VAR_2(VAR_3, " %c%c", VAR_6, VAR_0->crf[VAR_5] & 0x01 ? 'O' : ' '); } VAR_2(VAR_3, " ]             RES " ADDRX "\n", VAR_0->reserve); for (VAR_5 = 0; VAR_5 < 32; VAR_5++) { if ((VAR_5 & (RFPL - 1)) == 0)
VAR_2(VAR_3, "FPR%02d", VAR_5); VAR_2(VAR_3, " %016" PRIx64, *((uint64_t *)&VAR_0->fpr[VAR_5])); if ((VAR_5 & (RFPL - 1)) == (RFPL - 1))
VAR_2(VAR_3, "\n"); } VAR_2(VAR_3, "FPSCR %08x\n", VAR_0->fpscr); #if !defined(CONFIG_USER_ONLY)
VAR_2(VAR_3, "SRR0 " ADDRX " SRR1 " ADDRX " SDR1 " ADDRX "\n",
VAR_0->spr[SPR_SRR0], VAR_0->spr[SPR_SRR1], VAR_0->sdr1); #endif
#undef RGPL
#undef RFPL
}